linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Valdis.Kletnieks@vt.edu
Cc: linux-fsdevel@vger.kernel.org,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	Nick Krause <xerofoiffy@gmail.com>,
	Richard Weinberger <richard.weinberger@gmail.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] spi: Remove unused definitions
Date: Wed, 20 Aug 2014 23:56:18 +0200	[thread overview]
Message-ID: <20140820215618.GA744@amd> (raw)
In-Reply-To: <26099.1408569162@turing-police.cc.vt.edu>

On Wed 2014-08-20 17:12:42, Valdis.Kletnieks@vt.edu wrote:
> (Adding Al Viro and linux-fsdevel, dropping Mark Brown and the SPI list, because this is
> heading off in a different direction now)
> 
> On Wed, 20 Aug 2014 22:26:02 +0200, Pavel Machek said:
> > On Wed 2014-08-06 14:27:20, Valdis.Kletnieks@vt.edu wrote:
> > > On Wed, 06 Aug 2014 13:53:17 -0400, Nick Krause said:
> > > > Remove unused definition which cause the following warnings
> > > >
> > > > drivers/spi/spi-omap-100k.c:73:0: warning: "WRITE" redefined [enabled by default]
> > > > include/linux/fs.h:193:0: note: this is the location of the previous definition
> > > > drivers/spi/spi-omap-100k.c:74:0: warning: "READ" redefined [enabled by default]
> > > > include/linux/fs.h:192:0: note: this is the location of the previous definition
> > >
> > > > -#define WRITE 0
> > > > -#define READ  1
> > >
> > > NAK.  Full stop.  These are potentially used in an inner macro someplace, and by
> > > removing these, the conflicting values from fs.h will be used instead.
> > >
> > > #define READ                    0
> > > #define WRITE                   RW_MASK
> > >
> > > So if there *is* a use in an inner macro, you just screwed the pooch
> > > and introduced a bug in this "clean up" - somebody will be expecting to see
> > > a 0 for a READ, and will receive a 1 instead.  This can't end well.
> >
> > Actually.. having macros called READ and WRITE in fs.h is already something I'd say
> > can't end well. Can we rename those?
> 
> I had the same thought, but other than a test rename to XYZZY_READ and PLUGH_WRITE
> and doing a 'make allmodconfig' and seeing what throws an error, I'm not sure how
> to track down all the users.  On my fairly stripped-down .config, I have:
> 
> [/usr/src/linux-next] find * -name '.*.cmd' | wc -l
> 4671
> [/usr/src/linux-next] find * -name '.*.cmd' | xargs grep include/linux/fs.h | wc -l
> 2339
> 
> Which is telling me that pretty much half the world ends up including fs.h indirectly.

Yep.

I hope sh math emulator does not include fs.h.

arch/sh/math-emu/math.c:#define READ(d,a)       ({if(get_user(d, (typeof (d)*)a)

> Now for the mandatory bikeshedding:
> 
> What do we want to rename them to? :)

REQ_ prefix would fit there well, I'd say.
									Pavel


-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

      reply	other threads:[~2014-08-20 21:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1407347597-2168-1-git-send-email-xerofoiffy@gmail.com>
     [not found] ` <17153.1407349640@turing-police.cc.vt.edu>
     [not found]   ` <20140820202235.GA28350@xo-6d-61-c0.localdomain>
2014-08-20 21:12     ` [PATCH 1/1] spi: Remove unused definitions Valdis.Kletnieks
2014-08-20 21:56       ` Pavel Machek [this message]

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=20140820215618.GA744@amd \
    --to=pavel@ucw.cz \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=richard.weinberger@gmail.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xerofoiffy@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).