linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] qeth: Convert use of __constant_htons to htons
       [not found] <OF92C6D110.21C79ACA-ONC1257EA6.002BFA53-C1257EA6.002C1CD6@de.ibm.com>
@ 2015-08-19  8:30 ` Ursula Braun
  2015-08-19 11:45   ` Vaishali Thakkar
  0 siblings, 1 reply; 5+ messages in thread
From: Ursula Braun @ 2015-08-19  8:30 UTC (permalink / raw)
  To: Vaishali Thakkar; +Cc: mschwid2, heicars2, linux-s390, linux-kernel, Linux390


> From:        Vaishali Thakkar <vthakkar1994@gmail.com> 
> To:        Ursula Braun <ubraun@linux.vnet.ibm.com>, 
> Cc:        Ursula Braun1/Germany/IBM@IBMDE, BOEBLINGEN
> LINUX390/Germany/IBM@IBMDE, mschwid2@linux.vnet.ibm.com,
> heicars2@linux.vnet.ibm.com, linux-s390@vger.kernel.org, Linux Kernel
> Mailing List <linux-kernel@vger.kernel.org> 
> Date:        19/08/2015 07:02 
> Subject:        Re: [PATCH] qeth: Convert use of __constant_htons to
> htons 
> 
> ______________________________________________________________________
> 
> 
> 
> On Fri, Jun 12, 2015 at 1:12 PM, Ursula Braun
> <ubraun@linux.vnet.ibm.com> wrote:
> > Thanks Vaishali. I have added your patch to our local kernel git,
> and
> > will submit it within a following upstream shipment.
> 
> Hi Ursula,
> 
> Can you please tell me when this patch is going to be added in
> linux-next? I don't see them in linux-next and they are blocking
> removal of these macros.
> 
> Do inform me in case there is any problem with this patch.
> 
> Thank You.
> 
Hi Vaishali,

sorry, I have not been aware that you are urgently waiting for my next
upstream posting. I shipped your patch a few minutes ago to Dave Miller
for inclusion into net-next.

Regards, Ursula Braun



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] qeth: Convert use of __constant_htons to htons
  2015-08-19  8:30 ` [PATCH] qeth: Convert use of __constant_htons to htons Ursula Braun
@ 2015-08-19 11:45   ` Vaishali Thakkar
  0 siblings, 0 replies; 5+ messages in thread
From: Vaishali Thakkar @ 2015-08-19 11:45 UTC (permalink / raw)
  To: Ursula Braun
  Cc: mschwid2, heicars2, linux-s390, Linux Kernel Mailing List, Linux390

On Wed, Aug 19, 2015 at 2:00 PM, Ursula Braun <ubraun@linux.vnet.ibm.com> wrote:
>
>> From:        Vaishali Thakkar <vthakkar1994@gmail.com>
>> To:        Ursula Braun <ubraun@linux.vnet.ibm.com>,
>> Cc:        Ursula Braun1/Germany/IBM@IBMDE, BOEBLINGEN
>> LINUX390/Germany/IBM@IBMDE, mschwid2@linux.vnet.ibm.com,
>> heicars2@linux.vnet.ibm.com, linux-s390@vger.kernel.org, Linux Kernel
>> Mailing List <linux-kernel@vger.kernel.org>
>> Date:        19/08/2015 07:02
>> Subject:        Re: [PATCH] qeth: Convert use of __constant_htons to
>> htons
>>
>> ______________________________________________________________________
>>
>>
>>
>> On Fri, Jun 12, 2015 at 1:12 PM, Ursula Braun
>> <ubraun@linux.vnet.ibm.com> wrote:
>> > Thanks Vaishali. I have added your patch to our local kernel git,
>> and
>> > will submit it within a following upstream shipment.
>>
>> Hi Ursula,
>>
>> Can you please tell me when this patch is going to be added in
>> linux-next? I don't see them in linux-next and they are blocking
>> removal of these macros.
>>
>> Do inform me in case there is any problem with this patch.
>>
>> Thank You.
>>
> Hi Vaishali,
>
> sorry, I have not been aware that you are urgently waiting for my next
> upstream posting. I shipped your patch a few minutes ago to Dave Miller
> for inclusion into net-next.
>
> Regards, Ursula Braun
>
>

I am just concerned about removing these macros. Because its been long since
we came to know that they are useless. :)

So, Thank you for sending this patch to Dave Miller for net-next.

-- 
Vaishali

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] qeth: Convert use of __constant_htons to htons
  2015-06-12  7:42 ` Ursula Braun
@ 2015-08-19  5:02   ` Vaishali Thakkar
  0 siblings, 0 replies; 5+ messages in thread
From: Vaishali Thakkar @ 2015-08-19  5:02 UTC (permalink / raw)
  To: Ursula Braun
  Cc: Ursula Braun, linux390, Martin Schwidefsky, Heiko Carstens,
	linux-s390, Linux Kernel Mailing List

On Fri, Jun 12, 2015 at 1:12 PM, Ursula Braun <ubraun@linux.vnet.ibm.com> wrote:
> Thanks Vaishali. I have added your patch to our local kernel git, and
> will submit it within a following upstream shipment.

Hi Ursula,

Can you please tell me when this patch is going to be added in
linux-next? I don't see them in linux-next and they are blocking
removal of these macros.

Do inform me in case there is any problem with this patch.

Thank You.

> 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 <vthakkar1994@gmail.com>
>> ---
>>  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));
>>               }
>>       }
>
>



-- 
Vaishali

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] qeth: Convert use of __constant_htons to htons
  2015-06-10 10:52 Vaishali Thakkar
@ 2015-06-12  7:42 ` Ursula Braun
  2015-08-19  5:02   ` Vaishali Thakkar
  0 siblings, 1 reply; 5+ messages in thread
From: Ursula Braun @ 2015-06-12  7:42 UTC (permalink / raw)
  To: Vaishali Thakkar
  Cc: Ursula Braun, linux390, Martin Schwidefsky, Heiko Carstens,
	linux-s390, linux-kernel, Julia Lawall

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 <vthakkar1994@gmail.com>
> ---
>  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));
>  		}
>  	}



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] qeth: Convert use of __constant_htons to htons
@ 2015-06-10 10:52 Vaishali Thakkar
  2015-06-12  7:42 ` Ursula Braun
  0 siblings, 1 reply; 5+ messages in thread
From: Vaishali Thakkar @ 2015-06-10 10:52 UTC (permalink / raw)
  To: Ursula Braun
  Cc: linux390, Martin Schwidefsky, Heiko Carstens, linux-s390,
	linux-kernel, Julia Lawall

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 <vthakkar1994@gmail.com>
---
 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));
 		}
 	}
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-08-19 11:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <OF92C6D110.21C79ACA-ONC1257EA6.002BFA53-C1257EA6.002C1CD6@de.ibm.com>
2015-08-19  8:30 ` [PATCH] qeth: Convert use of __constant_htons to htons Ursula Braun
2015-08-19 11:45   ` Vaishali Thakkar
2015-06-10 10:52 Vaishali Thakkar
2015-06-12  7:42 ` Ursula Braun
2015-08-19  5:02   ` Vaishali Thakkar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).