2018-03-01 00:27:37

by Stephen Rothwell

[permalink] [raw]
Subject: linux-next: build warnings after merge of the block tree

Hi Jens,

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

In file included from drivers/misc/cardreader/rts5209.c:24:0:
include/linux/rtsx_pci.h:40:0: warning: "SG_END" redefined
#define SG_END 0x02

In file included from include/linux/dmapool.h:14:0,
from include/linux/pci.h:1311,
from include/linux/rtsx_pci.h:26,
from drivers/misc/cardreader/rts5209.c:24:
include/linux/scatterlist.h:69:0: note: this is the location of the previous definition
#define SG_END 0x02UL

In file included from drivers/staging/rts5208/rtsx.h:180:0,
from drivers/staging/rts5208/rtsx.c:28:
drivers/staging/rts5208/rtsx_chip.h:343:0: warning: "SG_END" redefined
#define SG_END 0x02

In file included from include/linux/blkdev.h:28:0,
from drivers/staging/rts5208/rtsx.c:23:
include/linux/scatterlist.h:69:0: note: this is the location of the previous definition
#define SG_END 0x02UL


and many more the same.

Introduced by commit

723fbf563a6a ("lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB encodings")

--
Cheers,
Stephen Rothwell


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

2018-03-01 04:03:22

by Anshuman Khandual

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

On 03/01/2018 05:56 AM, Stephen Rothwell wrote:
> Hi Jens,
>
> After merging the block tree, today's linux-next build (x86_64
> allmodconfig) produced these warning:
>
> In file included from drivers/misc/cardreader/rts5209.c:24:0:
> include/linux/rtsx_pci.h:40:0: warning: "SG_END" redefined
> #define SG_END 0x02
>
> In file included from include/linux/dmapool.h:14:0,
> from include/linux/pci.h:1311,
> from include/linux/rtsx_pci.h:26,
> from drivers/misc/cardreader/rts5209.c:24:
> include/linux/scatterlist.h:69:0: note: this is the location of the previous definition
> #define SG_END 0x02UL
>
> In file included from drivers/staging/rts5208/rtsx.h:180:0,
> from drivers/staging/rts5208/rtsx.c:28:
> drivers/staging/rts5208/rtsx_chip.h:343:0: warning: "SG_END" redefined
> #define SG_END 0x02
>
> In file included from include/linux/blkdev.h:28:0,
> from drivers/staging/rts5208/rtsx.c:23:
> include/linux/scatterlist.h:69:0: note: this is the location of the previous definition
> #define SG_END 0x02UL
>
>
> and many more the same.
>
> Introduced by commit
>
> 723fbf563a6a ("lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB encodings")

IIRC this was already detected and hence sent a new version changing
this to SG_LAST.

https://patchwork.kernel.org/patch/10227897/



2018-03-01 15:42:47

by Jens Axboe

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

On 2/28/18 9:02 PM, Anshuman Khandual wrote:
> On 03/01/2018 05:56 AM, Stephen Rothwell wrote:
>> Hi Jens,
>>
>> After merging the block tree, today's linux-next build (x86_64
>> allmodconfig) produced these warning:
>>
>> In file included from drivers/misc/cardreader/rts5209.c:24:0:
>> include/linux/rtsx_pci.h:40:0: warning: "SG_END" redefined
>> #define SG_END 0x02
>>
>> In file included from include/linux/dmapool.h:14:0,
>> from include/linux/pci.h:1311,
>> from include/linux/rtsx_pci.h:26,
>> from drivers/misc/cardreader/rts5209.c:24:
>> include/linux/scatterlist.h:69:0: note: this is the location of the previous definition
>> #define SG_END 0x02UL
>>
>> In file included from drivers/staging/rts5208/rtsx.h:180:0,
>> from drivers/staging/rts5208/rtsx.c:28:
>> drivers/staging/rts5208/rtsx_chip.h:343:0: warning: "SG_END" redefined
>> #define SG_END 0x02
>>
>> In file included from include/linux/blkdev.h:28:0,
>> from drivers/staging/rts5208/rtsx.c:23:
>> include/linux/scatterlist.h:69:0: note: this is the location of the previous definition
>> #define SG_END 0x02UL
>>
>>
>> and many more the same.
>>
>> Introduced by commit
>>
>> 723fbf563a6a ("lib/scatterlist: Add SG_CHAIN and SG_END macros for LSB encodings")
>
> IIRC this was already detected and hence sent a new version changing
> this to SG_LAST.
>
> https://patchwork.kernel.org/patch/10227897/

The right fix is for drivers to not use defines that end up conflicting
with the global namespace. Should have been fixed up earlier, but I
have applied the patches from Arnd to rectify that.

--
Jens Axboe