The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] staging: media: Replace a bit shift by a use of BIT.
@ 2017-03-22  4:20 Arushi Singhal
  2017-03-22 10:23 ` [Outreachy kernel] " Julia Lawall
  2017-03-22 12:11 ` Dilger, Andreas
  0 siblings, 2 replies; 3+ messages in thread
From: Arushi Singhal @ 2017-03-22  4:20 UTC (permalink / raw)
  To: oleg.drokin
  Cc: Andreas Dilger, James Simmons, Greg Kroah-Hartman, lustre-devel,
	devel, linux-kernel, outreachy-kernel

This patch replaces bit shifting on 1 with the BIT(x) macro.
This was done with coccinelle:
@@
constant c;
@@

-1 << c
+BIT(c)

Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com>
---
 drivers/staging/octeon/ethernet-tx.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/octeon/ethernet-tx.c b/drivers/staging/octeon/ethernet-tx.c
index ff4119e8de42..f00186ac4e27 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -381,7 +381,7 @@ int cvm_oct_xmit(struct sk_buff *skb, struct net_device *dev)
 	    (ip_hdr(skb)->version == 4) &&
 	    (ip_hdr(skb)->ihl == 5) &&
 	    ((ip_hdr(skb)->frag_off == 0) ||
-	     (ip_hdr(skb)->frag_off == htons(1 << 14))) &&
+	     (ip_hdr(skb)->frag_off == htons(BIT(14)))) &&
 	    ((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
 	     (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
 		/* Use hardware checksum calc */
@@ -613,7 +613,7 @@ int cvm_oct_xmit_pow(struct sk_buff *skb, struct net_device *dev)
 #endif
 		work->word2.s.is_frag = !((ip_hdr(skb)->frag_off == 0) ||
 					  (ip_hdr(skb)->frag_off ==
-					      1 << 14));
+					      BIT(14)));
 #if 0
 		/* Assume Linux is sending a good packet */
 		work->word2.s.IP_exc = 0;
-- 
2.11.0

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

end of thread, other threads:[~2017-03-22 12:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-22  4:20 [PATCH] staging: media: Replace a bit shift by a use of BIT Arushi Singhal
2017-03-22 10:23 ` [Outreachy kernel] " Julia Lawall
2017-03-22 12:11 ` Dilger, Andreas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox