Skip to contentSkip to conversation

IB/rxe: fix compare_const_fl.cocci warnings

PATCH Applied Julia Lawall 2 participants 2 messages Feb 18, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 IB/rxe: fix compare_const_fl.cocci warnings

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

CC Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/[email protected]>

---

The constants on the right look a bit nicer. Another possibility would be !!.

tree:   https://github.com/dledford/linux.git rxe-v2
head:   bc91f3e63df667e8da8894a51149a2fc9acf0e71
commit: 30e5584cf453cd90bbcd3ebb5f3e774c0195dd83 [30/31] IB/rxe: Add

Soft-RoCE to kbuild and makefiles

 rxe_mr.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/rdma/rxe/rxe_mr.c +2 -2
@@ -43,8 +43,8 @@ static u8 rxe_get_key(void)
 
 	key = key << 1;
 
-	key |= (0 != (key & 0x100)) ^ (0 != (key & 0x10))
-		^ (0 != (key & 0x80)) ^ (0 != (key & 0x40));
+	key |= ((key & 0x100) != 0) ^ ((key & 0x10) != 0)
+		^ ((key & 0x80) != 0) ^ ((key & 0x40) != 0);
 
 	key &= 0xff;
 

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#1 lore raw
Quoted 23 lines · Julia Lawall

Move constants to the right of binary operators.

Generated by: scripts/coccinelle/misc/compare_const_fl.cocci

CC Kamal Heib <kamalh-VPRAkNaXOzVWk0Htik3J/[email protected]>

---

The constants on the right look a bit nicer. Another possibility would be !!.

tree:   https://github.com/dledford/linux.git rxe-v2
head:   bc91f3e63df667e8da8894a51149a2fc9acf0e71
commit: 30e5584cf453cd90bbcd3ebb5f3e774c0195dd83 [30/31] IB/rxe: Add

Soft-RoCE to kbuild and makefiles

 rxe_mr.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

drivers/staging/rdma/rxe/rxe_mr.c static u8 rxe_get_key(void) · line 50

Quoted 10 lines
drivers/staging/rdma/rxe/rxe_mr.c +2 -2
@@ -43,8 +43,8 @@ static u8 rxe_get_key(void)
 
 	key = key << 1;
 
-	key |= (0 != (key & 0x100)) ^ (0 != (key & 0x10))
-		^ (0 != (key & 0x80)) ^ (0 != (key & 0x40));
+	key |= ((key & 0x100) != 0) ^ ((key & 0x10) != 0)
+		^ ((key & 0x80) != 0) ^ ((key & 0x40) != 0);
 
 	key &= 0xff;
 

Thanks, applied to my rxe-v2 branch.