From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Harvey Harrison <harvey.harrison@gmail.com>
Cc: akpm@linux-foundation.org, linux-scsi@vger.kernel.org
Subject: Re: [patch 11/17] scsi: ch.c fix shadowed variable warnings
Date: Mon, 31 Mar 2008 22:10:51 -0500 [thread overview]
Message-ID: <1207019451.3192.92.camel@localhost.localdomain> (raw)
In-Reply-To: <1206903583.6543.38.camel@brick>
On Sun, 2008-03-30 at 11:59 -0700, Harvey Harrison wrote:
> On Sun, 2008-03-30 at 13:55 -0500, James Bottomley wrote:
> > > >
> > > > 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.
> >
> > Er, well it's not really a question of like; it's more a question of the
> > programming principle of reducing namespace pollution.
> >
> > The more global something is (and you start with global headers, then
> > arch headers, then globally exported symbols, then subsystem symbols,
> > etc ...) the more polluting. So, the only thing that should be allowed
> > to name something totally generic, like 'err' or 'ret' should be right
> > at the lowest level (i.e. unexported symbols of local functions).
> >
> > Your patch was wrong because you changed the name of the lowest level
> > and left the actual polluting symbol in the next level up, thus inviting
> > another patch or function addition to do it all over again. The correct
> > way to fix something like this is to rename the more globally polluting
> > symbol to make a clash far less likely.
>
> True, but being somewhat unfamiliar with scsi code, I chose the more
> localized version that was easier to verify.
>
> Are you going to apply your above version, or did you want me to redo
> mine that way?
Sure ... I only spent a few seconds with an editor and checked that it
compiled ... if there's a problem with my patch, by all means fix it up
and resubmit it.
James
next prev parent reply other threads:[~2008-04-01 3:10 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
2008-03-30 18:55 ` James Bottomley
2008-03-30 18:59 ` Harvey Harrison
2008-04-01 3:10 ` James Bottomley [this message]
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=1207019451.3192.92.camel@localhost.localdomain \
--to=james.bottomley@hansenpartnership.com \
--cc=akpm@linux-foundation.org \
--cc=harvey.harrison@gmail.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox