Skip to contentSkip to conversation

usb: ehci: ohci: use true/false for bool

PATCH In review Geyslan G. Bem 2 participants 4 messages Dec 2, 2015

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

PATCH v2 1/1 usb: ehci: ohci: use true/false for bool

When declaring/initializing bool use true instead of 1. If it's false, there's no need to explicit initialize it, once it's default.

Caught by coccinelle.

---
 drivers/usb/host/ehci-hcd.c | 2 +-
 drivers/usb/host/ohci-hcd.c | 4 ++--
 drivers/usb/host/u132-hcd.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-hcd.c +1 -1
index 48c92bf..1b01967 100644
@@ -98,7 +98,7 @@ module_param (park, uint, S_IRUGO);
 MODULE_PARM_DESC (park, "park setting; 1-3 back-to-back async packets");
 
 /* for flakey hardware, ignore overcurrent indicators */
-static bool ignore_oc = 0;
+static bool ignore_oc;
 module_param (ignore_oc, bool, S_IRUGO);
 MODULE_PARM_DESC (ignore_oc, "ignore bogus hardware overcurrent indications");
 
drivers/usb/host/ohci-hcd.c +2 -2
index 760cb57..5547dbf 100644
@@ -99,13 +99,13 @@ static void io_watchdog_func(unsigned long _ohci);
 
 
 /* Some boards misreport power switching/overcurrent */
-static bool distrust_firmware = 1;
+static bool distrust_firmware = true;
 module_param (distrust_firmware, bool, 0);
 MODULE_PARM_DESC (distrust_firmware,
 	"true to distrust firmware power/overcurrent setup");
 
 /* Some boards leave IR set wrongly, since they fail BIOS/SMM handshakes */
-static bool no_handshake = 0;
+static bool no_handshake;
 module_param (no_handshake, bool, 0);
 MODULE_PARM_DESC (no_handshake, "true (not default) disables BIOS handshake");
 
drivers/usb/host/u132-hcd.c +1 -1
index 692ccc6..05c85c7 100644
@@ -73,7 +73,7 @@ MODULE_LICENSE("GPL");
 #define INT_MODULE_PARM(n, v) static int n = v;module_param(n, int, 0444)
 INT_MODULE_PARM(testing, 0);
 /* Some boards misreport power switching/overcurrent*/
-static bool distrust_firmware = 1;
+static bool distrust_firmware = true;
 module_param(distrust_firmware, bool, 0);
 MODULE_PARM_DESC(distrust_firmware, "true to distrust firmware power/overcurren"
 	"t setup");
Signature · 1 line
2.6.3
#1 lore raw
Quoted 17 lines · Geyslan G. Bem

When declaring/initializing bool use true instead of 1. If it's false, there's no need to explicit initialize it, once it's default.

Caught by coccinelle.

---
 drivers/usb/host/ehci-hcd.c | 2 +-
 drivers/usb/host/ohci-hcd.c | 4 ++--
 drivers/usb/host/u132-hcd.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-hcd.c +0 -0
index 48c92bf..1b01967 100644

drivers/usb/host/ehci-hcd.c module_param (park, uint, S_IRUGO); · line 101

Quoted 5 lines
drivers/usb/host/ehci-hcd.c +1 -1
@@ -98,7 +98,7 @@ module_param (park, uint, S_IRUGO);
 MODULE_PARM_DESC (park, "park setting; 1-3 back-to-back async packets");
 
 /* for flakey hardware, ignore overcurrent indicators */
-static bool ignore_oc = 0;
+static bool ignore_oc;

This should be a separate patch as it's doing something differently than what you describe.

thanks,

greg k-h

#2 lore raw

2015-12-02 19:16 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 27 lines · Geyslan G. Bem
Quoted 17 lines

When declaring/initializing bool use true instead of 1. If it's false, there's no need to explicit initialize it, once it's default.

Caught by coccinelle.

---
 drivers/usb/host/ehci-hcd.c | 2 +-
 drivers/usb/host/ohci-hcd.c | 4 ++--
 drivers/usb/host/u132-hcd.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-hcd.c +0 -0
index 48c92bf..1b01967 100644

drivers/usb/host/ehci-hcd.c module_param (park, uint, S_IRUGO); · line 101

Quoted 5 lines
drivers/usb/host/ehci-hcd.c +1 -1
@@ -98,7 +98,7 @@ module_param (park, uint, S_IRUGO);
 MODULE_PARM_DESC (park, "park setting; 1-3 back-to-back async packets");
 
 /* for flakey hardware, ignore overcurrent indicators */
-static bool ignore_oc = 0;
+static bool ignore_oc;

This should be a separate patch as it's doing something differently than what you describe.

Quoted 3 lines

thanks,

greg k-h

Greg,

I think that the v2 description is ok, the title is misleading indeed. I'll make a new one entitled "fix bool initialization". Anything else?

Thanks.

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com
#3 lore raw

2015-12-02 19:23 GMT-03:00 Geyslan G. Bem <[email protected]>:

Quoted 28 lines

2015-12-02 19:16 GMT-03:00 Greg Kroah-Hartman <[email protected]>:

Quoted 27 lines · Geyslan G. Bem
Quoted 17 lines

When declaring/initializing bool use true instead of 1. If it's false, there's no need to explicit initialize it, once it's default.

Caught by coccinelle.

---
 drivers/usb/host/ehci-hcd.c | 2 +-
 drivers/usb/host/ohci-hcd.c | 4 ++--
 drivers/usb/host/u132-hcd.c | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/usb/host/ehci-hcd.c +0 -0
index 48c92bf..1b01967 100644

drivers/usb/host/ehci-hcd.c module_param (park, uint, S_IRUGO); · line 101

Quoted 5 lines
drivers/usb/host/ehci-hcd.c +1 -1
@@ -98,7 +98,7 @@ module_param (park, uint, S_IRUGO);
 MODULE_PARM_DESC (park, "park setting; 1-3 back-to-back async packets");
 
 /* for flakey hardware, ignore overcurrent indicators */
-static bool ignore_oc = 0;
+static bool ignore_oc;

This should be a separate patch as it's doing something differently than what you describe.

Quoted 8 lines
Quoted 3 lines

thanks,

greg k-h

Greg,

I think that the v2 description is ok, the title is misleading indeed. I'll make a new one entitled "fix bool initialization". Anything else?

Please ignore my last statements.

Report to this: [PATCH] usb: ehci: ohci: fix bool assignments

Quoted 8 lines

Thanks.

--
Regards,

Geyslan G. Bem
hackingbits.com

Signature · 4 lines
Regards,

Geyslan G. Bem
hackingbits.com