Skip to contentSkip to conversation

Another bitop on boolean in pnpbios

PATCH In review John Levon 2 participants 3 messages Mar 3, 2003

lore
Share & tools
lore

John Levon

author
#0 lore raw

PATCH 1/1 Another bitop on boolean in pnpbios

First obvious case from -Wbitop-boolean

Not tested ...

regards,
john

include/linux/pnpbios.h +1 -1
@@ -86,7 +86,7 @@
 #define PNPBIOS_DOCK			0x0020
 #define PNPBIOS_REMOVABLE		0x0040
 #define pnpbios_is_static(x) ((x)->flags & 0x0100) == 0x0000
-#define pnpbios_is_dynamic(x) (x)->flags & 0x0080
+#define pnpbios_is_dynamic(x) ((x)->flags & 0x0080)
 
 /* 0x8000 through 0xffff are OEM defined */
 
#1 lore raw

include/linux/pnpbios.h line 89

Quoted 3 lines · John Levon

#define pnpbios_is_static(x) ((x)->flags & 0x0100) == 0x0000

include/linux/pnpbios.h +1 -1
-#define pnpbios_is_dynamic(x) (x)->flags & 0x0080
+#define pnpbios_is_dynamic(x) ((x)->flags & 0x0080)

pnpbios_is_static() could probably use the same treatment.

-- wli

author
#2 lore raw
Quoted 1 line · William Lee Irwin III

pnpbios_is_static() could probably use the same treatment.

Sure. Linus, at least one of the below actually broke...

regards
john

include/linux/pnpbios.h +2 -2
@@ -85,8 +85,8 @@
 #define PNPBIOS_BOOTABLE		0x0010
 #define PNPBIOS_DOCK			0x0020
 #define PNPBIOS_REMOVABLE		0x0040
-#define pnpbios_is_static(x) ((x)->flags & 0x0100) == 0x0000
-#define pnpbios_is_dynamic(x) (x)->flags & 0x0080
+#define pnpbios_is_static(x) (((x)->flags & 0x0100) == 0x0000)
+#define pnpbios_is_dynamic(x) ((x)->flags & 0x0080)
 
 /* 0x8000 through 0xffff are OEM defined */