2022-10-22 15:40:15

by kernel test robot

[permalink] [raw]
Subject: drivers/net/ethernet/renesas/rswitch.c:355:71: warning: left shift count >= width of type

tree: https://github.com/intel-lab-lkp/linux/commits/Yoshihiro-Shimoda/net-phy-marvell10g-Add-host-speed-setting-by-an-ethernet-driver/20221020-091402
head: 54882d9015d6bc070075b3ab4eab5cf4d75cf56e
commit: 77bfe15a20a8c80e2150e86970e1157acfca24f8 net: ethernet: renesas: Add Ethernet Switch driver
date: 3 days ago
config: parisc64-allyesconfig
compiler: hppa-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/77bfe15a20a8c80e2150e86970e1157acfca24f8
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Yoshihiro-Shimoda/net-phy-marvell10g-Add-host-speed-setting-by-an-ethernet-driver/20221020-091402
git checkout 77bfe15a20a8c80e2150e86970e1157acfca24f8
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/media/platform/chips-media/ drivers/net/ethernet/renesas/ drivers/staging/vt6655/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

drivers/net/ethernet/renesas/rswitch.c: In function 'rswitch_ext_desc_get_dptr':
>> drivers/net/ethernet/renesas/rswitch.c:355:71: warning: left shift count >= width of type [-Wshift-count-overflow]
355 | return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
| ^~
drivers/net/ethernet/renesas/rswitch.c: In function 'rswitch_ext_ts_desc_get_dptr':
drivers/net/ethernet/renesas/rswitch.c:367:71: warning: left shift count >= width of type [-Wshift-count-overflow]
367 | return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
| ^~


vim +355 drivers/net/ethernet/renesas/rswitch.c

352
353 static dma_addr_t rswitch_ext_desc_get_dptr(struct rswitch_ext_desc *desc)
354 {
> 355 return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
356 }
357

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (2.42 kB)
config (322.16 kB)
Download all attachments

2022-10-26 06:33:17

by Randy Dunlap

[permalink] [raw]
Subject: Re: drivers/net/ethernet/renesas/rswitch.c:355:71: warning: left shift count >= width of type

Hi k.t.r.,

On 10/22/22 08:23, kernel test robot wrote:
> tree: https://github.com/intel-lab-lkp/linux/commits/Yoshihiro-Shimoda/net-phy-marvell10g-Add-host-speed-setting-by-an-ethernet-driver/20221020-091402
> head: 54882d9015d6bc070075b3ab4eab5cf4d75cf56e
> commit: 77bfe15a20a8c80e2150e86970e1157acfca24f8 net: ethernet: renesas: Add Ethernet Switch driver
> date: 3 days ago
> config: parisc64-allyesconfig

The attached .config file does not contain "CONFIG_64BIT".
How did you generate it?

(more below)


> compiler: hppa-linux-gcc (GCC) 12.1.0
> reproduce (this is a W=1 build):
> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # https://github.com/intel-lab-lkp/linux/commit/77bfe15a20a8c80e2150e86970e1157acfca24f8
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Yoshihiro-Shimoda/net-phy-marvell10g-Add-host-speed-setting-by-an-ethernet-driver/20221020-091402
> git checkout 77bfe15a20a8c80e2150e86970e1157acfca24f8
> # save the config file
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/media/platform/chips-media/ drivers/net/ethernet/renesas/ drivers/staging/vt6655/

For 64BIT parisc builds, it would be better to use
ARCH=parisc64

See 805ce8614958: parisc: Allow CONFIG_64BIT with ARCH=parisc
and 3dcfb729b5f4: parisc: Make CONFIG_64BIT available for ARCH=parisc64 only

To use only ARCH=parisc, you must ensure that both PA8X00=y and 64BIT=y in the .config file.


> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <[email protected]>
>
> All warnings (new ones prefixed by >>):
>
> drivers/net/ethernet/renesas/rswitch.c: In function 'rswitch_ext_desc_get_dptr':
>>> drivers/net/ethernet/renesas/rswitch.c:355:71: warning: left shift count >= width of type [-Wshift-count-overflow]
> 355 | return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
> | ^~
> drivers/net/ethernet/renesas/rswitch.c: In function 'rswitch_ext_ts_desc_get_dptr':
> drivers/net/ethernet/renesas/rswitch.c:367:71: warning: left shift count >= width of type [-Wshift-count-overflow]
> 367 | return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
> | ^~
>
>
> vim +355 drivers/net/ethernet/renesas/rswitch.c
>
> 352
> 353 static dma_addr_t rswitch_ext_desc_get_dptr(struct rswitch_ext_desc *desc)
> 354 {
> > 355 return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
> 356 }
> 357
>

--
~Randy

2022-10-26 08:38:44

by Chen, Rong A

[permalink] [raw]
Subject: Re: [kbuild-all] Re: drivers/net/ethernet/renesas/rswitch.c:355:71: warning: left shift count >= width of type



On 10/26/2022 1:49 PM, Randy Dunlap wrote:
> Hi k.t.r.,
>
> On 10/22/22 08:23, kernel test robot wrote:
>> tree: https://github.com/intel-lab-lkp/linux/commits/Yoshihiro-Shimoda/net-phy-marvell10g-Add-host-speed-setting-by-an-ethernet-driver/20221020-091402
>> head: 54882d9015d6bc070075b3ab4eab5cf4d75cf56e
>> commit: 77bfe15a20a8c80e2150e86970e1157acfca24f8 net: ethernet: renesas: Add Ethernet Switch driver
>> date: 3 days ago
>> config: parisc64-allyesconfig
>
> The attached .config file does not contain "CONFIG_64BIT".
> How did you generate it?

Hi Randy,

Thanks for your reply, the config name is wrong,
it should be parisc-allyesconfig (we use `make ARCH=parisc allyesconfig`
to generate).

>
> (more below)
>
>
>> compiler: hppa-linux-gcc (GCC) 12.1.0
>> reproduce (this is a W=1 build):
>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # https://github.com/intel-lab-lkp/linux/commit/77bfe15a20a8c80e2150e86970e1157acfca24f8
>> git remote add linux-review https://github.com/intel-lab-lkp/linux
>> git fetch --no-tags linux-review Yoshihiro-Shimoda/net-phy-marvell10g-Add-host-speed-setting-by-an-ethernet-driver/20221020-091402
>> git checkout 77bfe15a20a8c80e2150e86970e1157acfca24f8
>> # save the config file
>> mkdir build_dir && cp config build_dir/.config
>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/media/platform/chips-media/ drivers/net/ethernet/renesas/ drivers/staging/vt6655/
>
> For 64BIT parisc builds, it would be better to use
> ARCH=parisc64
>
> See 805ce8614958: parisc: Allow CONFIG_64BIT with ARCH=parisc
> and 3dcfb729b5f4: parisc: Make CONFIG_64BIT available for ARCH=parisc64 only
>
> To use only ARCH=parisc, you must ensure that both PA8X00=y and 64BIT=y in the .config file.

We'll take a look to use ARCH=parsic64 instead of ARCH=parsic.

Best Regards,
Rong Chen

>
>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <[email protected]>
>>
>> All warnings (new ones prefixed by >>):
>>
>> drivers/net/ethernet/renesas/rswitch.c: In function 'rswitch_ext_desc_get_dptr':
>>>> drivers/net/ethernet/renesas/rswitch.c:355:71: warning: left shift count >= width of type [-Wshift-count-overflow]
>> 355 | return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
>> | ^~
>> drivers/net/ethernet/renesas/rswitch.c: In function 'rswitch_ext_ts_desc_get_dptr':
>> drivers/net/ethernet/renesas/rswitch.c:367:71: warning: left shift count >= width of type [-Wshift-count-overflow]
>> 367 | return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
>> | ^~
>>
>>
>> vim +355 drivers/net/ethernet/renesas/rswitch.c
>>
>> 352
>> 353 static dma_addr_t rswitch_ext_desc_get_dptr(struct rswitch_ext_desc *desc)
>> 354 {
>> > 355 return __le32_to_cpu(desc->dptrl) | (dma_addr_t)(desc->dptrh) << 32;
>> 356 }
>> 357
>>
>