linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: ehci: ohci: fix bool assignments
@ 2015-12-02 23:25 Geyslan G. Bem
  2015-12-07 10:11 ` Peter Senna Tschudin
  0 siblings, 1 reply; 2+ messages in thread
From: Geyslan G. Bem @ 2015-12-02 23:25 UTC (permalink / raw)
  To: peter.senna
  Cc: Geyslan G. Bem, Alan Stern, Greg Kroah-Hartman, Sergei Shtylyov,
	Mel Gorman, Saurabh Karajgaonkar, Masanari Iida,
	Rafael J. Wysocki, linux-usb, linux-kernel

When assigning bool use true instead of 1. If declaring it as static and
it's false there's no need to initialize it, since static variables are
zeroed by default.

Caught by coccinelle.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
---
 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(-)

diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
index 48c92bf..1b01967 100644
--- a/drivers/usb/host/ehci-hcd.c
+++ b/drivers/usb/host/ehci-hcd.c
@@ -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");
 
diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
index 760cb57..5547dbf 100644
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -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");
 
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
index 692ccc6..05c85c7 100644
--- a/drivers/usb/host/u132-hcd.c
+++ b/drivers/usb/host/u132-hcd.c
@@ -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");
-- 
2.6.3


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

* Re: [PATCH] usb: ehci: ohci: fix bool assignments
  2015-12-02 23:25 [PATCH] usb: ehci: ohci: fix bool assignments Geyslan G. Bem
@ 2015-12-07 10:11 ` Peter Senna Tschudin
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Senna Tschudin @ 2015-12-07 10:11 UTC (permalink / raw)
  To: Geyslan G. Bem
  Cc: Alan Stern, Greg Kroah-Hartman, Sergei Shtylyov, Mel Gorman,
	Saurabh Karajgaonkar, Masanari Iida, Rafael J. Wysocki,
	linux-usb, linux-kernel

On Thu, Dec 3, 2015 at 12:25 AM, Geyslan G. Bem <geyslan@gmail.com> wrote:
> When assigning bool use true instead of 1. If declaring it as static and
> it's false there's no need to initialize it, since static variables are
> zeroed by default.
>
> Caught by coccinelle.
>
> Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Acked-by: Peter Senna Tschudin <peter.senna@gmail.com>

> ---
>  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(-)
>
> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 48c92bf..1b01967 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -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");
>
> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
> index 760cb57..5547dbf 100644
> --- a/drivers/usb/host/ohci-hcd.c
> +++ b/drivers/usb/host/ohci-hcd.c
> @@ -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");
>
> diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c
> index 692ccc6..05c85c7 100644
> --- a/drivers/usb/host/u132-hcd.c
> +++ b/drivers/usb/host/u132-hcd.c
> @@ -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");
> --
> 2.6.3
>



-- 
Peter

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

end of thread, other threads:[~2015-12-07 10:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-02 23:25 [PATCH] usb: ehci: ohci: fix bool assignments Geyslan G. Bem
2015-12-07 10:11 ` Peter Senna Tschudin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).