hci_usb: do not initialize static variables to 0
Subsystems (3)
PATCH 1/3 hci_usb: do not initialize static variables to 0
From: Pavel Machek <[email protected]>
hci_usb: do not initialize static variables to 0.
---
drivers/bluetooth/hci_usb.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/bluetooth/hci_usb.c renamed from drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0 +7 -7
@@ -62,13 +62,13 @@#define URB_ZERO_PACKET 0#endif -static int ignore =0 ; -static int ignore_dga =0 ; -static int ignore_csr =0 ; -static int ignore_sniffer =0 ; -static int disable_scofix =0 ; -static int force_scofix =0 ; -static int reset =0 ; +static int ignore; +static int ignore_dga; +static int ignore_csr; +static int ignore_sniffer; +static int disable_scofix; +static int force_scofix; +static int reset;#ifdef CONFIG_BT_HCIUSB_SCO static int isoc =2 ;
_
Marcel Holtmann
maintainerHi Andrew,
Quoted 23 lines
hci_usb: do not initialize static variables to 0.Signed-off-by Pavel Machek <[email protected]>Cc Marcel Holtmann <[email protected]>Cc Dave Young <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/bluetooth/hci_usb.c| 14 +++++++-------1 file changed, 7 insertions(+), 7 deletions(-)diff -puN
drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0drivers/bluetooth/hci_usb.c--- a/drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-
variables-to-0
+++a/drivers/bluetooth/hci_usb.cdrivers/bluetooth/hci_usb.c renamed from drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0 +0
-4@@ -62,13 +62,13 @@#define URB_ZERO_PACKET 0#endif -static int ignore =0 ; -static int ignore_dga =0 ; -static int ignore_csr =0 ; -static int ignore_sniffer =0 ;
drivers/bluetooth/hci_usb.c line 71
Quoted 10 lines
drivers/bluetooth/hci_usb.c renamed from drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0 +7
-3-static int disable_scofix =0 ; -static int force_scofix =0 ; -static int reset =0 ; +static int ignore; +static int ignore_dga; +static int ignore_csr; +static int ignore_sniffer; +static int disable_scofix; +static int force_scofix; +static int reset;
I know that some people don't like to do it and I agree, but in case of module parameters, I prefer to have them clearly indicate what the default value is. It is a lot easier to read for other people looking at the code. So that one is a NAK from my side.
Regards
Marcel
Quoted 34 lines · Marcel Holtmann
Hi Andrew,
Quoted 32 lines
hci_usb: do not initialize static variables to 0.Signed-off-by Pavel Machek <[email protected]>Cc Marcel Holtmann <[email protected]>Cc Dave Young <[email protected]>Signed-off-by Andrew Morton <[email protected]>---
drivers/bluetooth/hci_usb.c| 14 +++++++-------1 file changed, 7 insertions(+), 7 deletions(-)diff -puN
drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0drivers/bluetooth/hci_usb.c
---
a/drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0 +++a/drivers/bluetooth/hci_usb.cdrivers/bluetooth/hci_usb.c renamed from drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0 +4
-7@@ -62,13 +62,13 @@#define URB_ZERO_PACKET 0#endif -static int ignore =0 ; -static int ignore_dga =0 ; -static int ignore_csr =0 ; -static int ignore_sniffer =0 ; -static int disable_scofix =0 ; -static int force_scofix =0 ; -static int reset =0 ; +static int ignore; +static int ignore_dga; +static int ignore_csr; +static int ignore_sniffer;
Quoted 8 lines
drivers/bluetooth/hci_usb.c line 71
Quoted 3 lines
drivers/bluetooth/hci_usb.c renamed from drivers/bluetooth/hci_usb.c~hci_usb-do-not-initialize-static-variables-to-0 +3
-0+static int disable_scofix; +static int force_scofix; +static int reset;I know that some people don't like to do it and I agree, but in case of module parameters, I prefer to have them clearly indicate what the default value is. It is a lot easier to read for other people looking at the code. So that one is a NAK from my side.
According to you noone should read this one, anyway :-)... and this wastes space in vmlinux.
Pavel
Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
A message that is not in the archive (sent off-list or not yet received): 20080419161245.GA1577-I/[email protected]
From: Pavel Machek <[email protected]>
Date: Sat, 19 Apr 2008 18:12:45 +0200
Quoted 2 lines
According to you noone should read this one, anyway :-)... and this wastes space in vmlinux.
This is getting rediculious :-)
I've applied this patch.