All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Hannes Eder <hannes@hanneseder.net>
Cc: trivial@kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c
Date: Thu, 05 Mar 2009 21:58:53 +0000	[thread overview]
Message-ID: <1236290333.5626.78.camel@localhost.localdomain> (raw)
In-Reply-To: <154e089b0903051215q1216aa53icd41556e2af8b234@mail.gmail.com>

On Thu, 2009-03-05 at 21:15 +0100, Hannes Eder wrote:
> On Thu, Mar 5, 2009 at 9:05 PM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > On Thu, 2009-03-05 at 20:16 +0100, Hannes Eder wrote:
> >> Fix this sparse warnings:
> >>   drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
> >>   drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
> >>   drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer
> >>
> >> Signed-off-by: Hannes Eder <hannes@hanneseder.net>
> >> ---
> >> v2: fix checkpatch.pl issue.
> >> v2.1: other subject, as suggested by Al Viro
> >>
> >>  drivers/scsi/FlashPoint.c |    7 +++----
> >>  1 files changed, 3 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
> >> index b898d38..9eb2e86 100644
> >> --- a/drivers/scsi/FlashPoint.c
> >> +++ b/drivers/scsi/FlashPoint.c
> >> @@ -903,8 +903,8 @@ static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
> >>  static void FPT_autoLoadDefaultMap(unsigned long p_port);
> >>
> >>  static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] > >> L-    { {{0}} };
> >> -static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
> >> +    { { {NULL} } };
> >> +static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {NULL} };
> >>  static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
> >>  static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };
> >
> > This doesn't look right:  {0} as a structure initialiser is a C
> > convention for zero fill this structure; sparse should recognise this.
> > Of course, since these structures are static, they should be in BSS
> > anyway ...
> 
> So a proper fix is just not to initialize the variables.

That works ... and probably also teach sparse to recognise {0}.

> ... and report this issue to the sparse mailing list.
> 
> >
> >> @@ -918,8 +918,7 @@ static unsigned char FPT_scamHAString[] > >>
> >>  static unsigned short FPT_default_intena = 0;
> >>
> >> -static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
> >> -0};
> >> +static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {NULL};
> >>
> >>  /*---------------------------------------------------------------------
> >>   *
> 
> Same her, right?

I had to look that one up, but yes, it appears {0} does zero initialise
an array as well.

James



WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Hannes Eder <hannes@hanneseder.net>
Cc: trivial@kernel.org, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c
Date: Thu, 05 Mar 2009 21:58:53 +0000	[thread overview]
Message-ID: <1236290333.5626.78.camel@localhost.localdomain> (raw)
In-Reply-To: <154e089b0903051215q1216aa53icd41556e2af8b234@mail.gmail.com>

On Thu, 2009-03-05 at 21:15 +0100, Hannes Eder wrote:
> On Thu, Mar 5, 2009 at 9:05 PM, James Bottomley
> <James.Bottomley@hansenpartnership.com> wrote:
> > On Thu, 2009-03-05 at 20:16 +0100, Hannes Eder wrote:
> >> Fix this sparse warnings:
> >>   drivers/scsi/FlashPoint.c:906:9: warning: Using plain integer as NULL pointer
> >>   drivers/scsi/FlashPoint.c:907:53: warning: Using plain integer as NULL pointer
> >>   drivers/scsi/FlashPoint.c:922:1: warning: Using plain integer as NULL pointer
> >>
> >> Signed-off-by: Hannes Eder <hannes@hanneseder.net>
> >> ---
> >> v2: fix checkpatch.pl issue.
> >> v2.1: other subject, as suggested by Al Viro
> >>
> >>  drivers/scsi/FlashPoint.c |    7 +++----
> >>  1 files changed, 3 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/scsi/FlashPoint.c b/drivers/scsi/FlashPoint.c
> >> index b898d38..9eb2e86 100644
> >> --- a/drivers/scsi/FlashPoint.c
> >> +++ b/drivers/scsi/FlashPoint.c
> >> @@ -903,8 +903,8 @@ static void FPT_autoCmdCmplt(unsigned long p_port, unsigned char p_card);
> >>  static void FPT_autoLoadDefaultMap(unsigned long p_port);
> >>
> >>  static struct sccb_mgr_tar_info FPT_sccbMgrTbl[MAX_CARDS][MAX_SCSI_TAR] =
> >> L-    { {{0}} };
> >> -static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {0} };
> >> +    { { {NULL} } };
> >> +static struct sccb_card FPT_BL_Card[MAX_CARDS] = { {NULL} };
> >>  static SCCBSCAM_INFO FPT_scamInfo[MAX_SCSI_TAR] = { {{0}} };
> >>  static struct nvram_info FPT_nvRamInfo[MAX_MB_CARDS] = { {0} };
> >
> > This doesn't look right:  {0} as a structure initialiser is a C
> > convention for zero fill this structure; sparse should recognise this.
> > Of course, since these structures are static, they should be in BSS
> > anyway ...
> 
> So a proper fix is just not to initialize the variables.

That works ... and probably also teach sparse to recognise {0}.

> ... and report this issue to the sparse mailing list.
> 
> >
> >> @@ -918,8 +918,7 @@ static unsigned char FPT_scamHAString[] =
> >>
> >>  static unsigned short FPT_default_intena = 0;
> >>
> >> -static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {
> >> -0};
> >> +static void (*FPT_s_PhaseTbl[8]) (unsigned long, unsigned char) = {NULL};
> >>
> >>  /*---------------------------------------------------------------------
> >>   *
> 
> Same her, right?

I had to look that one up, but yes, it appears {0} does zero initialise
an array as well.

James



  parent reply	other threads:[~2009-03-05 21:58 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-05 19:10 [PATCH v2 00/15] NULL noise fix: allmodconfig (x86_64), entire tree Hannes Eder
2009-03-05 19:10 ` Hannes Eder
2009-03-05 19:12 ` [PATCH v2 01/15] NULL noise: arch/x86/kernel Hannes Eder
2009-03-05 19:12   ` Hannes Eder
2009-03-05 19:13 ` [PATCH v2 02/15] NULL noise: arch/x86/kernel/amd_iommu*.c Hannes Eder
2009-03-05 19:13   ` Hannes Eder
2009-03-05 19:53   ` [PATCH v3 " Hannes Eder
2009-03-05 19:53     ` Hannes Eder
2009-03-05 19:13 ` [PATCH v2 03/15] NULL noise: arch/x86/xen/smp.c Hannes Eder
2009-03-05 19:13   ` Hannes Eder
2009-03-05 19:13   ` Hannes Eder
2009-03-05 20:15   ` Jeremy Fitzhardinge
2009-03-05 20:15     ` Jeremy Fitzhardinge
2009-03-05 20:15     ` Jeremy Fitzhardinge
2009-03-17 13:17     ` Jiri Kosina
2009-03-17 13:17       ` Jiri Kosina
2009-03-18  0:27       ` Jeremy Fitzhardinge
2009-03-18  0:27         ` Jeremy Fitzhardinge
2009-03-18 10:28         ` Jiri Kosina
2009-03-18 10:28           ` Jiri Kosina
2009-03-05 19:14 ` [PATCH v2 04/15] NULL noise: drivers/gpu/drm/radeon/radeon_*.c Hannes Eder
2009-03-05 19:14   ` Hannes Eder
2009-03-05 19:14 ` [PATCH v2 05/15] NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h Hannes Eder
2009-03-05 19:14   ` Hannes Eder
2009-03-09 10:58   ` [PATCH v2 05/15] NULL noise: Mauro Carvalho Chehab
2009-03-09 10:58     ` [PATCH v2 05/15] NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h Mauro Carvalho Chehab
2009-03-17 13:20     ` [PATCH v2 05/15] NULL noise: Jiri Kosina
2009-03-17 13:20       ` [PATCH v2 05/15] NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h Jiri Kosina
2009-03-05 19:15 ` [PATCH v2 06/15] NULL noise: drivers/mtd/tests/mtd_*test.c Hannes Eder
2009-03-05 19:15   ` Hannes Eder
2009-03-06  6:09   ` Artem Bityutskiy
2009-03-06  6:09     ` Artem Bityutskiy
2009-03-17 13:21     ` Jiri Kosina
2009-03-17 13:21       ` Jiri Kosina
2009-03-17 14:27       ` Artem Bityutskiy
2009-03-17 14:27         ` Artem Bityutskiy
2009-03-17 14:27         ` Artem Bityutskiy
2009-03-05 19:15 ` [PATCH v2 07/15] NULL noise: drivers/pci/dmar.c Hannes Eder
2009-03-05 19:15   ` Hannes Eder
2009-03-05 19:15 ` [PATCH v2 08/15] NULL noise: drivers/platform/x86/panasonic-laptop.c Hannes Eder
2009-03-05 19:15   ` Hannes Eder
2009-04-07  5:56   ` [PATCH v2 08/15] NULL noise: Len Brown
2009-04-07  5:56     ` [PATCH v2 08/15] NULL noise: drivers/platform/x86/panasonic-laptop.c Len Brown
2009-03-05 19:16 ` [PATCH v2 09/15] NULL noise: drivers/scsi/FlashPoint.c Hannes Eder
2009-03-05 19:16   ` Hannes Eder
2009-03-05 20:05   ` James Bottomley
2009-03-05 20:05     ` James Bottomley
2009-03-05 20:15     ` Hannes Eder
2009-03-05 20:15       ` Hannes Eder
2009-03-05 20:15       ` Hannes Eder
2009-03-05 21:55       ` [PATCH v3 " Hannes Eder
2009-03-05 21:55         ` Hannes Eder
2009-03-05 21:55         ` Hannes Eder
2009-03-05 21:58       ` James Bottomley [this message]
2009-03-05 21:58         ` [PATCH v2 " James Bottomley
2009-03-05 19:16 ` [PATCH v2 10/15] NULL noise: drivers/usb/host/oxu210hp-hcd.c Hannes Eder
2009-03-05 19:16   ` Hannes Eder
2009-03-05 19:16 ` [PATCH v2 11/15] NULL noise: drivers/video/via/hw.c Hannes Eder
2009-03-05 19:16   ` Hannes Eder
2009-03-05 19:16   ` Hannes Eder
2009-03-05 19:17 ` [PATCH v2 12/15] NULL noise: fs/super.c Hannes Eder
2009-03-05 19:17   ` Hannes Eder
2009-03-05 19:18 ` [PATCH v2 13/15] NULL noise: fs/reiserfs/inode.c Hannes Eder
2009-03-05 19:18   ` Hannes Eder
2009-03-05 19:18   ` Hannes Eder
2009-03-05 19:18 ` [PATCH v2 14/15] NULL noise: kernel/test_kprobes.c Hannes Eder
2009-03-05 19:18   ` Hannes Eder
2009-03-05 19:18 ` [PATCH v2 15/15] NULL noise: mm/memcontrol.c Hannes Eder
2009-03-05 19:18   ` Hannes Eder
2009-03-05 22:42   ` Andrew Morton
2009-03-05 22:42     ` Andrew Morton
2009-03-05 23:04     ` Hannes Eder
2009-03-05 23:04       ` Hannes Eder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1236290333.5626.78.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=hannes@hanneseder.net \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=trivial@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.