From: Harvey Harrison <harvey.harrison@gmail.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: akpm@linux-foundation.org, linux-scsi@vger.kernel.org
Subject: Re: [patch 11/17] scsi: ch.c fix shadowed variable warnings
Date: Sun, 30 Mar 2008 11:43:40 -0700 [thread overview]
Message-ID: <1206902620.6543.32.camel@brick> (raw)
In-Reply-To: <1206897715.4224.55.camel@localhost.localdomain>
On Sun, 2008-03-30 at 12:21 -0500, James Bottomley wrote:
> On Fri, 2008-03-28 at 14:48 -0700, akpm@linux-foundation.org wrote:
> > From: Harvey Harrison <harvey.harrison@gmail.com>
> >
> > err shadows the array of errors in this driver, switch to ch_err
> > drivers/scsi/ch.c:271:6: warning: symbol 'err' shadows an earlier one
> > drivers/scsi/ch.c:116:3: originally declared here
> >
> > cmd shadows the argument to this function, switch to ch_cmd
> > drivers/scsi/ch.c:724:11: warning: symbol 'cmd' shadows an earlier one
> > drivers/scsi/ch.c:596:20: originally declared here
> >
> > Small code cleanup as well in if() statement.
> >
> > [akpm@linux-foundation.org: coding-style fixes]
> > Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> > Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > ---
> >
> > drivers/scsi/ch.c | 29 +++++++++++++++--------------
> > 1 file changed, 15 insertions(+), 14 deletions(-)
> >
> > diff -puN drivers/scsi/ch.c~scsi-chc-fix-shadowed-variable-warnings drivers/scsi/ch.c
> > --- a/drivers/scsi/ch.c~scsi-chc-fix-shadowed-variable-warnings
> > +++ a/drivers/scsi/ch.c
> > @@ -268,16 +268,16 @@ ch_read_element_status(scsi_changer *ch,
> > static int
> > ch_init_elem(scsi_changer *ch)
> > {
> > - int err;
> > + int ch_err;
>
> This isn't really the correct fix, is it? The driver stupidity is
> having a global (although static) variable called err which invites
> problems like this. How about this fix?
>
If you like that better, sure.
Harvey
next prev parent reply other threads:[~2008-03-30 18:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-28 21:48 [patch 11/17] scsi: ch.c fix shadowed variable warnings akpm
2008-03-30 17:21 ` James Bottomley
2008-03-30 18:43 ` Harvey Harrison [this message]
2008-03-30 18:55 ` James Bottomley
2008-03-30 18:59 ` Harvey Harrison
2008-04-01 3:10 ` James Bottomley
2008-04-01 5:05 ` [PATCH] scsi: ch.c fix sparse " Harvey Harrison
2008-04-01 14:51 ` James Bottomley
2008-04-01 15:16 ` Boaz Harrosh
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=1206902620.6543.32.camel@brick \
--to=harvey.harrison@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=akpm@linux-foundation.org \
--cc=linux-scsi@vger.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.