Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753405AbbFLHmu (ORCPT ); Fri, 12 Jun 2015 03:42:50 -0400 Received: from e06smtp14.uk.ibm.com ([195.75.94.110]:36468 "EHLO e06smtp14.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750800AbbFLHmr (ORCPT ); Fri, 12 Jun 2015 03:42:47 -0400 Message-ID: <1434094962.12558.2.camel@BR9GV9YG.de.ibm.com> Subject: Re: [PATCH] qeth: Convert use of __constant_htons to htons From: Ursula Braun To: Vaishali Thakkar Cc: Ursula Braun , linux390@de.ibm.com, Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, Julia Lawall Date: Fri, 12 Jun 2015 09:42:42 +0200 In-Reply-To: <20150610105249.GA3212@vaishali-Ideapad-Z570> References: <20150610105249.GA3212@vaishali-Ideapad-Z570> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.3-0ubuntu6 Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15061207-0017-0000-0000-00000461167C Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2832 Lines: 74 Thanks Vaishali. I have added your patch to our local kernel git, and will submit it within a following upstream shipment. Regards, Ursula Braun On Wed, 2015-06-10 at 16:22 +0530, Vaishali Thakkar wrote: > In little endian cases, the macro htons unfolds to __swab16 which > provides special case for constants. In big endian cases, > __constant_htons and htons expand directly to the same expression. > So, replace __constant_htons with htons with the goal of getting > rid of the definition of __constant_htons completely. > > The semantic patch that performs this transformation is as follows: > > @@expression x;@@ > > - __constant_htons(x) > + htons(x) > > Signed-off-by: Vaishali Thakkar > --- > drivers/s390/net/qeth_l2_main.c | 2 +- > drivers/s390/net/qeth_l3_main.c | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c > index 0ea0869..a124f59 100644 > --- a/drivers/s390/net/qeth_l2_main.c > +++ b/drivers/s390/net/qeth_l2_main.c > @@ -272,7 +272,7 @@ static void qeth_l2_fill_header(struct qeth_card *card, struct qeth_hdr *hdr, > /* VSWITCH relies on the VLAN > * information to be present in > * the QDIO header */ > - if (veth->h_vlan_proto == __constant_htons(ETH_P_8021Q)) { > + if (veth->h_vlan_proto == htons(ETH_P_8021Q)) { > hdr->hdr.l2.flags[2] |= QETH_LAYER2_FLAG_VLAN; > hdr->hdr.l2.vlan_id = ntohs(veth->h_vlan_TCI); > } > diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c > index 04e42c6..bd6b5a9 100644 > --- a/drivers/s390/net/qeth_l3_main.c > +++ b/drivers/s390/net/qeth_l3_main.c > @@ -1887,13 +1887,13 @@ static inline int qeth_l3_rebuild_skb(struct qeth_card *card, > case QETH_CAST_MULTICAST: > switch (prot) { > #ifdef CONFIG_QETH_IPV6 > - case __constant_htons(ETH_P_IPV6): > + case htons(ETH_P_IPV6): > ndisc_mc_map((struct in6_addr *) > skb->data + 24, > tg_addr, card->dev, 0); > break; > #endif > - case __constant_htons(ETH_P_IP): > + case htons(ETH_P_IP): > ip_hdr = (struct iphdr *)skb->data; > ip_eth_mc_map(ip_hdr->daddr, tg_addr); > break; > @@ -3015,7 +3015,7 @@ static int qeth_l3_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) > skb_copy_to_linear_data_offset(new_skb, 8, > new_skb->data + 12, 4); > tag = (u16 *)(new_skb->data + 12); > - *tag = __constant_htons(ETH_P_8021Q); > + *tag = htons(ETH_P_8021Q); > *(tag + 1) = htons(skb_vlan_tag_get(new_skb)); > } > } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/