2015-05-25 19:54:06

by Shailendra Verma

[permalink] [raw]
Subject: [PATCH] atm:he - Do not initialise statics to 0.

Static variables are initialised to 0 by GCC.
Fixes the following checkpatch error:
ERROR: do not initialise statics to 0 or NULL
FILE: drivers/atm/he.c:120:
static bool sdh = 0;

Signed-off-by: Shailendra Verma <[email protected]>
---
drivers/atm/he.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/atm/he.c b/drivers/atm/he.c
index 93dca2e..2cd6f17 100644
--- a/drivers/atm/he.c
+++ b/drivers/atm/he.c
@@ -117,7 +117,7 @@ static short nvpibits = -1;
static short nvcibits = -1;
static short rx_skb_reserve = 16;
static bool irq_coalesce = 1;
-static bool sdh = 0;
+static bool sdh;

/* Read from EEPROM = 0000 0011b */
static unsigned int readtab[] = {
--
1.7.9.5


2015-05-25 20:36:23

by David Miller

[permalink] [raw]
Subject: Re: [PATCH] atm:he - Do not initialise statics to 0.

From: Shailendra Verma <[email protected]>
Date: Tue, 26 May 2015 01:23:53 +0530

> Static variables are initialised to 0 by GCC.
> Fixes the following checkpatch error:
> ERROR: do not initialise statics to 0 or NULL
> FILE: drivers/atm/he.c:120:
> static bool sdh = 0;
>
> Signed-off-by: Shailendra Verma <[email protected]>

true is not necessarily '1' and false is not necessarily '0',
therefore the correct fix would be to assign 'false' to this variable.

Furthermore you've submitted this in such a way that it cannot be
applied alongside the other atm:he patch you submitted.

This is why when you submit multiple patches to the same file, you
must group them and submit them relative to eachother and in a
specific order.