2020-11-20 00:42:11

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warning after merge of the nand tree

Hi all,

After merging the nand tree, today's linux-next build (x86_64
allmodconfig) produced this warning:

drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_read':
drivers/mtd/maps/physmap-bt1-rom.c:39:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
39 | shift = (unsigned int)src & 0x3;
| ^
drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_copy_from':
drivers/mtd/maps/physmap-bt1-rom.c:78:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
78 | shift = (unsigned int)src & 0x3;
| ^

Introduced by commit

69a75a1a47d8 ("mtd: physmap: physmap-bt1-rom: Fix __iomem addrspace removal warning")

--
Cheers,
Stephen Rothwell


Attachments:
(No filename) (499.00 B)
OpenPGP digital signature

2020-11-20 11:27:21

by Miquel Raynal

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nand tree

Hi Serge,

Stephen Rothwell <[email protected]> wrote on Fri, 20 Nov 2020
11:39:29 +1100:

> Hi all,
>
> After merging the nand tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_read':
> drivers/mtd/maps/physmap-bt1-rom.c:39:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 39 | shift = (unsigned int)src & 0x3;
> | ^
> drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_copy_from':
> drivers/mtd/maps/physmap-bt1-rom.c:78:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> 78 | shift = (unsigned int)src & 0x3;
> | ^
>
> Introduced by commit
>
> 69a75a1a47d8 ("mtd: physmap: physmap-bt1-rom: Fix __iomem addrspace removal warning")
>

Too bad :/ I'll drop this patch for now, let's look for another
solution...

Thanks,
Miquèl

2020-11-20 12:03:33

by Boris Brezillon

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nand tree

On Fri, 20 Nov 2020 12:23:59 +0100
Miquel Raynal <[email protected]> wrote:

> Hi Serge,
>
> Stephen Rothwell <[email protected]> wrote on Fri, 20 Nov 2020
> 11:39:29 +1100:
>
> > Hi all,
> >
> > After merging the nand tree, today's linux-next build (x86_64
> > allmodconfig) produced this warning:
> >
> > drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_read':
> > drivers/mtd/maps/physmap-bt1-rom.c:39:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > 39 | shift = (unsigned int)src & 0x3;
> > | ^
> > drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_copy_from':
> > drivers/mtd/maps/physmap-bt1-rom.c:78:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > 78 | shift = (unsigned int)src & 0x3;
> > | ^
> >
> > Introduced by commit
> >
> > 69a75a1a47d8 ("mtd: physmap: physmap-bt1-rom: Fix __iomem addrspace removal warning")
> >
>
> Too bad :/ I'll drop this patch for now, let's look for another
> solution...

uintptr_t cast?

2020-11-20 13:01:20

by Serge Semin

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nand tree

Hello Miquel, Boris

On Fri, Nov 20, 2020 at 01:01:23PM +0100, Boris Brezillon wrote:
> On Fri, 20 Nov 2020 12:23:59 +0100
> Miquel Raynal <[email protected]> wrote:
>
> > Hi Serge,
> >
> > Stephen Rothwell <[email protected]> wrote on Fri, 20 Nov 2020
> > 11:39:29 +1100:
> >
> > > Hi all,
> > >
> > > After merging the nand tree, today's linux-next build (x86_64
> > > allmodconfig) produced this warning:
> > >
> > > drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_read':
> > > drivers/mtd/maps/physmap-bt1-rom.c:39:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > > 39 | shift = (unsigned int)src & 0x3;
> > > | ^
> > > drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_copy_from':
> > > drivers/mtd/maps/physmap-bt1-rom.c:78:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > > 78 | shift = (unsigned int)src & 0x3;
> > > | ^
> > >
> > > Introduced by commit
> > >
> > > 69a75a1a47d8 ("mtd: physmap: physmap-bt1-rom: Fix __iomem addrspace removal warning")
> > >
> >

> > Too bad :/ I'll drop this patch for now, let's look for another
> > solution...

that'd be great. I've forgotten that my arch is 32-bit and the
compiler just did print a warning for it.(

>
> uintptr_t cast?

Yep, most likely that will be the best option in this case to make
sparse happy and not to cause the warning above.

I'll send v2 patch shortly.

-Sergey

2020-11-20 13:04:04

by Serge Semin

[permalink] [raw]
Subject: Re: linux-next: build warning after merge of the nand tree

On Fri, Nov 20, 2020 at 01:01:23PM +0100, Boris Brezillon wrote:
> On Fri, 20 Nov 2020 12:23:59 +0100
> Miquel Raynal <[email protected]> wrote:
>
> > Hi Serge,
> >
> > Stephen Rothwell <[email protected]> wrote on Fri, 20 Nov 2020
> > 11:39:29 +1100:
> >
> > > Hi all,
> > >
> > > After merging the nand tree, today's linux-next build (x86_64
> > > allmodconfig) produced this warning:
> > >
> > > drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_read':
> > > drivers/mtd/maps/physmap-bt1-rom.c:39:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > > 39 | shift = (unsigned int)src & 0x3;
> > > | ^
> > > drivers/mtd/maps/physmap-bt1-rom.c: In function 'bt1_rom_map_copy_from':
> > > drivers/mtd/maps/physmap-bt1-rom.c:78:10: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > > 78 | shift = (unsigned int)src & 0x3;
> > > | ^
> > >
> > > Introduced by commit
> > >
> > > 69a75a1a47d8 ("mtd: physmap: physmap-bt1-rom: Fix __iomem addrspace removal warning")
> > >
> >
> > Too bad :/ I'll drop this patch for now, let's look for another
> > solution...
>
> uintptr_t cast?

unsigned long shall also work here...

-Sergey