* [PATCH] mtd: onenand: fix parameter list build warning
@ 2018-09-03 19:32 Randy Dunlap
2018-09-04 21:34 ` Miquel Raynal
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2018-09-03 19:32 UTC (permalink / raw)
To: LKML
Cc: Geert Uytterhoeven, Kyungmin Park, linux-mtd, David Woodhouse,
Brian Norris, Boris Brezillon, Marek Vasut, Richard Weinberger,
Adrian Bunk, Adrian Bunk
From: Randy Dunlap <rdunlap@infradead.org>
Fix build warning in <linux/mtd/onenand.h> by adding a "stub" struct
for mtd_oob_ops:
include/linux/mtd/onenand.h: warning: 'struct mtd_oob_ops' declared inside parameter list [enabled by default]
include/linux/mtd/onenand.h: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
Fixes: 607d1cb10426 ("[MTD] [OneNAND] proper onenand_bbt_read_oob() prototype")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: linux-mtd@lists.infradead.org
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Brian Norris <computersforpeace@gmail.com>
Cc: Boris Brezillon <boris.brezillon@bootlin.com>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Adrian Bunk <bunk@kernel.org>
Cc: Adrian Bunk <bunk@debian.org>
---
include/linux/mtd/onenand.h | 1 +
1 file changed, 1 insertion(+)
--- lnx-419-rc2.orig/include/linux/mtd/onenand.h
+++ lnx-419-rc2/include/linux/mtd/onenand.h
@@ -221,6 +221,7 @@ struct onenand_manufacturers {
char *name;
};
+struct mtd_oob_ops;
int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
struct mtd_oob_ops *ops);
unsigned onenand_block(struct onenand_chip *this, loff_t addr);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: onenand: fix parameter list build warning
2018-09-03 19:32 [PATCH] mtd: onenand: fix parameter list build warning Randy Dunlap
@ 2018-09-04 21:34 ` Miquel Raynal
2018-09-04 21:49 ` Randy Dunlap
0 siblings, 1 reply; 4+ messages in thread
From: Miquel Raynal @ 2018-09-04 21:34 UTC (permalink / raw)
To: Randy Dunlap
Cc: LKML, Adrian Bunk, Marek Vasut, Richard Weinberger, Adrian Bunk,
Boris Brezillon, Kyungmin Park, linux-mtd, Geert Uytterhoeven,
Brian Norris, David Woodhouse
Hi Randy,
Randy Dunlap <rdunlap@infradead.org> wrote on Mon, 3 Sep 2018 12:32:04
-0700:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Fix build warning in <linux/mtd/onenand.h> by adding a "stub" struct
> for mtd_oob_ops:
>
> include/linux/mtd/onenand.h: warning: 'struct mtd_oob_ops' declared inside parameter list [enabled by default]
> include/linux/mtd/onenand.h: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
>
> Fixes: 607d1cb10426 ("[MTD] [OneNAND] proper onenand_bbt_read_oob() prototype")
>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> Cc: linux-mtd@lists.infradead.org
> Cc: David Woodhouse <dwmw2@infradead.org>
> Cc: Brian Norris <computersforpeace@gmail.com>
> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> Cc: Marek Vasut <marek.vasut@gmail.com>
> Cc: Richard Weinberger <richard@nod.at>
> Cc: Adrian Bunk <bunk@kernel.org>
> Cc: Adrian Bunk <bunk@debian.org>
> ---
> include/linux/mtd/onenand.h | 1 +
> 1 file changed, 1 insertion(+)
>
> --- lnx-419-rc2.orig/include/linux/mtd/onenand.h
> +++ lnx-419-rc2/include/linux/mtd/onenand.h
> @@ -221,6 +221,7 @@ struct onenand_manufacturers {
> char *name;
> };
>
> +struct mtd_oob_ops;
> int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
> struct mtd_oob_ops *ops);
> unsigned onenand_block(struct onenand_chip *this, loff_t addr);
That's indeed a working solution, but there are a lot of other
structures in this file that come (like mtd_oob_ops) from
linux/mtd/mtd.h so I wonder if it would not make more sense to include
this header here?
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: onenand: fix parameter list build warning
2018-09-04 21:34 ` Miquel Raynal
@ 2018-09-04 21:49 ` Randy Dunlap
2018-09-05 8:00 ` Miquel Raynal
0 siblings, 1 reply; 4+ messages in thread
From: Randy Dunlap @ 2018-09-04 21:49 UTC (permalink / raw)
To: Miquel Raynal
Cc: LKML, Adrian Bunk, Marek Vasut, Richard Weinberger, Adrian Bunk,
Boris Brezillon, Kyungmin Park, linux-mtd, Geert Uytterhoeven,
Brian Norris, David Woodhouse
On 09/04/2018 02:34 PM, Miquel Raynal wrote:
> Hi Randy,
>
> Randy Dunlap <rdunlap@infradead.org> wrote on Mon, 3 Sep 2018 12:32:04
> -0700:
>
>> From: Randy Dunlap <rdunlap@infradead.org>
>>
>> Fix build warning in <linux/mtd/onenand.h> by adding a "stub" struct
>> for mtd_oob_ops:
>>
>> include/linux/mtd/onenand.h: warning: 'struct mtd_oob_ops' declared inside parameter list [enabled by default]
>> include/linux/mtd/onenand.h: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
>>
>> Fixes: 607d1cb10426 ("[MTD] [OneNAND] proper onenand_bbt_read_oob() prototype")
>>
>> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Kyungmin Park <kyungmin.park@samsung.com>
>> Cc: linux-mtd@lists.infradead.org
>> Cc: David Woodhouse <dwmw2@infradead.org>
>> Cc: Brian Norris <computersforpeace@gmail.com>
>> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
>> Cc: Marek Vasut <marek.vasut@gmail.com>
>> Cc: Richard Weinberger <richard@nod.at>
>> Cc: Adrian Bunk <bunk@kernel.org>
>> Cc: Adrian Bunk <bunk@debian.org>
>> ---
>> include/linux/mtd/onenand.h | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> --- lnx-419-rc2.orig/include/linux/mtd/onenand.h
>> +++ lnx-419-rc2/include/linux/mtd/onenand.h
>> @@ -221,6 +221,7 @@ struct onenand_manufacturers {
>> char *name;
>> };
>>
>> +struct mtd_oob_ops;
>> int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
>> struct mtd_oob_ops *ops);
>> unsigned onenand_block(struct onenand_chip *this, loff_t addr);
>
> That's indeed a working solution, but there are a lot of other
> structures in this file that come (like mtd_oob_ops) from
> linux/mtd/mtd.h so I wonder if it would not make more sense to include
> this header here?
>
> Thanks,
> Miquèl
Hi,
Have you see this from Linus?
https://lore.kernel.org/lkml/CA+55aFzMBptQt-QHMR0MM9MA3=1rxcf8ca5qHxrf4Mm0ZobE_A@mail.gmail.com/
thanks,
--
~Randy
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mtd: onenand: fix parameter list build warning
2018-09-04 21:49 ` Randy Dunlap
@ 2018-09-05 8:00 ` Miquel Raynal
0 siblings, 0 replies; 4+ messages in thread
From: Miquel Raynal @ 2018-09-05 8:00 UTC (permalink / raw)
To: Randy Dunlap
Cc: LKML, Adrian Bunk, Marek Vasut, Richard Weinberger, Adrian Bunk,
Boris Brezillon, Kyungmin Park, linux-mtd, Geert Uytterhoeven,
Brian Norris, David Woodhouse
Hi Randy,
Randy Dunlap <rdunlap@infradead.org> wrote on Tue, 4 Sep 2018 14:49:00
-0700:
> On 09/04/2018 02:34 PM, Miquel Raynal wrote:
> > Hi Randy,
> >
> > Randy Dunlap <rdunlap@infradead.org> wrote on Mon, 3 Sep 2018 12:32:04
> > -0700:
> >
> >> From: Randy Dunlap <rdunlap@infradead.org>
> >>
> >> Fix build warning in <linux/mtd/onenand.h> by adding a "stub" struct
> >> for mtd_oob_ops:
> >>
> >> include/linux/mtd/onenand.h: warning: 'struct mtd_oob_ops' declared inside parameter list [enabled by default]
> >> include/linux/mtd/onenand.h: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default]
> >>
> >> Fixes: 607d1cb10426 ("[MTD] [OneNAND] proper onenand_bbt_read_oob() prototype")
> >>
> >> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> >> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> >> Cc: Kyungmin Park <kyungmin.park@samsung.com>
> >> Cc: linux-mtd@lists.infradead.org
> >> Cc: David Woodhouse <dwmw2@infradead.org>
> >> Cc: Brian Norris <computersforpeace@gmail.com>
> >> Cc: Boris Brezillon <boris.brezillon@bootlin.com>
> >> Cc: Marek Vasut <marek.vasut@gmail.com>
> >> Cc: Richard Weinberger <richard@nod.at>
> >> Cc: Adrian Bunk <bunk@kernel.org>
> >> Cc: Adrian Bunk <bunk@debian.org>
> >> ---
> >> include/linux/mtd/onenand.h | 1 +
> >> 1 file changed, 1 insertion(+)
> >>
> >> --- lnx-419-rc2.orig/include/linux/mtd/onenand.h
> >> +++ lnx-419-rc2/include/linux/mtd/onenand.h
> >> @@ -221,6 +221,7 @@ struct onenand_manufacturers {
> >> char *name;
> >> };
> >>
> >> +struct mtd_oob_ops;
> >> int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from,
> >> struct mtd_oob_ops *ops);
> >> unsigned onenand_block(struct onenand_chip *this, loff_t addr);
> >
> > That's indeed a working solution, but there are a lot of other
> > structures in this file that come (like mtd_oob_ops) from
> > linux/mtd/mtd.h so I wonder if it would not make more sense to include
> > this header here?
> >
> > Thanks,
> > Miquèl
>
>
> Hi,
> Have you see this from Linus?
>
> https://lore.kernel.org/lkml/CA+55aFzMBptQt-QHMR0MM9MA3=1rxcf8ca5qHxrf4Mm0ZobE_A@mail.gmail.com/
I did not know this position, thanks for sharing.
However, I don't think we fall under the same situation here.
On a purely theoretical point of view, onenand is a type of MTD device,
and almost all the core structures it uses are from linux/mtd/mtd.h so
for me it seems an error not to include it.
After looking more closely at the code, the following files include
onenand.h:
$ ~/linux [master]$ git grep -l onenand.h
arch/arm/mach-mmp/ttc_dkb.c
arch/arm/mach-pxa/saar.c
arch/arm/mach-pxa/vpac270.c
arch/arm/plat-samsung/devs.c
arch/sh/boards/mach-kfr2r09/setup.c
drivers/mtd/nand/onenand/generic.c
drivers/mtd/nand/onenand/omap2.c
drivers/mtd/nand/onenand/onenand_base.c
drivers/mtd/nand/onenand/onenand_bbt.c
drivers/mtd/nand/onenand/samsung.c
include/linux/mtd/onenand.h
And the following files also already include mtd.h (before including onenand.h):
$ ~/linux [master]$ git grep -l onenand.h|xargs grep mtd.h
arch/arm/mach-mmp/ttc_dkb.c:#include <linux/mtd/mtd.h>
arch/arm/mach-pxa/saar.c:#include <linux/mtd/mtd.h>
arch/arm/mach-pxa/vpac270.c:#include <linux/mtd/mtd.h>
arch/arm/plat-samsung/devs.c:#include <linux/mtd/mtd.h>
drivers/mtd/nand/onenand/generic.c:#include <linux/mtd/mtd.h>
drivers/mtd/nand/onenand/omap2.c:#include <linux/mtd/mtd.h>
drivers/mtd/nand/onenand/onenand_base.c:#include <linux/mtd/mtd.h>
drivers/mtd/nand/onenand/onenand_bbt.c:#include <linux/mtd/mtd.h>
drivers/mtd/nand/onenand/samsung.c:#include <linux/mtd/mtd.h>
The only file not already including directly mtd.h is:
arch/sh/boards/mach-kfr2r09/setup.c
So I suppose your issue comes from this file?
However, mtd.h is included by physmap.h, itself included by
mach-kfr2r09/setup.c after onenand.h; so all this files would be
recompiled anyway when touching mtd.h.
From what I have seen, mach-kfr2r09/setup.c has no reason to include
onenand.h, so I would rather prefer to remove the inclusion.
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-05 8:00 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-03 19:32 [PATCH] mtd: onenand: fix parameter list build warning Randy Dunlap
2018-09-04 21:34 ` Miquel Raynal
2018-09-04 21:49 ` Randy Dunlap
2018-09-05 8:00 ` Miquel Raynal
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.