Skip to contentSkip to conversation

spi: Remove unused definitions

PATCH In review Nick Krause 8 participants 10 messages Aug 6, 2014 – Aug 20, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 spi: Remove unused definitions

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

---
 drivers/spi/spi-omap-100k.c | 4 ----
 1 file changed, 4 deletions(-)
drivers/spi/spi-omap-100k.c +0 -4
index 5e91858..fb52276 100644
@@ -70,10 +70,6 @@
 #define SPI_STATUS_WE                   (1UL << 1)
 #define SPI_STATUS_RD                   (1UL << 0)
 
-#define WRITE 0
-#define READ  1
-
-
 /* use PIO for small transfers, avoiding DMA setup/teardown overhead and
  * cache operations; better heuristics consider wordsize and bitrate.
  */
Signature · 1 line
1.9.1
#1 lore raw

drivers/spi/spi-omap-100k.c line 74

Quoted 9 lines · Nick Krause

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

drivers/spi/spi-omap-100k.c +0 -2
-#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.

Nick - how *exactly* did you identify that these are in fact not used? Given your history of submitting poorly researched patches, you're going to have to justify the "unused" better than the handwaving you've done here.

#8 lore raw
In reply to Nick Krause
Quoted 11 lines · Nick Krause

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

---
 drivers/spi/spi-omap-100k.c | 4 ----
 1 file changed, 4 deletions(-)

Nick, you were warned about this numerous times in the past.

By changing email addresses you have now ensured that we will never listen to you, as you obviously are not listening to us.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#2 lore raw
In reply to [email protected]
Quoted 14 lines · On Wed, Aug 6, 2014 at 2:27 PM, <[email protected]…

drivers/spi/spi-omap-100k.c line 74

Quoted 9 lines · Nick Krause

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

drivers/spi/spi-omap-100k.c +0 -2
-#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.

Quoted 6 lines

#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.

I was actually about to send a similar response, but then I noticed I couldn't actually find any uses of READ/WRITE in the file... But I could easily have missed them.

Quoted 4 lines

Nick - how *exactly* did you identify that these are in fact not used? Given your history of submitting poorly researched patches, you're going to have to justify the "unused" better than the handwaving you've done here.

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw
In reply to [email protected]
Quoted 17 lines · On Wed, Aug 6, 2014 at 8:27 PM, <[email protected]…

drivers/spi/spi-omap-100k.c line 74

Quoted 9 lines · Nick Krause

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

drivers/spi/spi-omap-100k.c +0 -2
-#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

Quoted 7 lines

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.

Nick - how *exactly* did you identify that these are in fact not used? Given your history of submitting poorly researched patches, you're going to have to justify the "unused" better than the handwaving you've done here.

Just looking into this...

It seems READ and WRITE are not used at all in this file.

To be 100% sure, I tried to find with which kernel config this warning shows up. It doesn't happen for omap1_defconfig with CONFIG_SPI_OMAP_100K, which was the most likely culprit.

It does happen with sparc/sparc64 allmodconfig. However, changing or removing the READ and WRITE definitions in drivers/spi/spi-omap-100k.c doesn't have any influence on the preprocessed source files ("make drivers/spi/spi-omap-100k.i", modulo line number changes), for both omap1 and sparc builds.

(Nick: I believe the above is what people really want to see)

So I conclude they are really not used, and they can be safely removed.

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#9 lore raw
In reply to Greg KH
Quoted 13 lines · Greg KH
Quoted 11 lines · Nick Krause

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

---
 drivers/spi/spi-omap-100k.c | 4 ----
 1 file changed, 4 deletions(-)
Quoted 5 lines

Nick, you were warned about this numerous times in the past.

By changing email addresses you have now ensured that we will never listen to you, as you obviously are not listening to us.

He does manage to get our attention, though. Also, it is not that simple - for my part I keep looking out for the patches just to make sure that we don't get any more less than well researched "fixes" into the kernel. I figure it pays to spend some time now instead of having to clean up the resulting mess if something slips by.

Guenter
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

maintainer
#4 lore raw
In reply to Geert Uytterhoeven
Quoted 10 lines · Geert Uytterhoeven

To be 100% sure, I tried to find with which kernel config this warning shows up. It doesn't happen for omap1_defconfig with CONFIG_SPI_OMAP_100K, which was the most likely culprit.

It does happen with sparc/sparc64 allmodconfig. However, changing or removing the READ and WRITE definitions in drivers/spi/spi-omap-100k.c doesn't have any influence on the preprocessed source files ("make drivers/spi/spi-omap-100k.i", modulo line number changes), for both omap1 and sparc builds.

Quoted 5 lines

(Nick: I believe the above is what people really want to see)

So I conclude they are really not used, and they can be safely removed.

Right, I'd already done the same analysis myself with looking for uses myself (though I didn't go looking for how to trigger). Nick, please do look at the analysis Geert provided above - it is indeed exactly the sort of thing that people would want to see, just saying what's in the diff isn't enough especially given the well advertised quality problems with your submissions. You really need to explain why the change you're making is a good idea.

I've applied the change.

#5 lore raw
In reply to [email protected]
Quoted 14 lines · On Wed 2014-08-06 14:27:20, [email protected] wrote:

drivers/spi/spi-omap-100k.c line 74

Quoted 9 lines · Nick Krause

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

drivers/spi/spi-omap-100k.c +0 -2
-#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.

Quoted 6 lines

#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?

Signature · 6 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

(Adding Al Viro and linux-fsdevel, dropping Mark Brown and the SPI list, because this is heading off in a different direction now)

Quoted 18 lines · Pavel Machek
Quoted 17 lines · On Wed 2014-08-06 14:27:20, [email protected] wrote:

drivers/spi/spi-omap-100k.c line 74

Quoted 9 lines · Nick Krause

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

drivers/spi/spi-omap-100k.c +0 -2
-#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

Quoted 6 lines
Quoted 3 lines

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.

Now for the mandatory bikeshedding:

What do we want to rename them to? :)

#7 lore raw
Quoted 33 lines · On Wed 2014-08-20 17:12:42, [email protected] wrote:

(Adding Al Viro and linux-fsdevel, dropping Mark Brown and the SPI list, because this is heading off in a different direction now)

Quoted 18 lines · Pavel Machek
Quoted 17 lines · On Wed 2014-08-06 14:27:20, [email protected] wrote:

drivers/spi/spi-omap-100k.c line 74

Quoted 9 lines · Nick Krause

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

drivers/spi/spi-omap-100k.c +0 -2
-#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

Quoted 6 lines
Quoted 3 lines

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:

Quoted 6 lines

[/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)

Quoted 3 lines

Now for the mandatory bikeshedding:

What do we want to rename them to? :)

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

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