* [PATCH] tty: Convert use of __constant_htons to htons
@ 2015-06-06 0:35 Vaishali Thakkar
0 siblings, 0 replies; only message in thread
From: Vaishali Thakkar @ 2015-06-06 0:35 UTC (permalink / raw)
To: Greg Kroah-Hartman; +Cc: Jiri Slaby, Julia Lawall, linux-kernel
In little endian cases, 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/tty/n_gsm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 2c34c32..dc0f371 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -2713,7 +2713,7 @@ static void gsm_mux_rx_netchar(struct gsm_dlci *dlci,
memcpy(skb_put(skb, size), in_buf, size);
skb->dev = net;
- skb->protocol = __constant_htons(ETH_P_IP);
+ skb->protocol = htons(ETH_P_IP);
/* Ship it off to the kernel */
netif_rx(skb);
--
1.9.1
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-06-06 0:35 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-06 0:35 [PATCH] tty: Convert use of __constant_htons to htons Vaishali Thakkar
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®