2020-03-13 09:55:17

by Stephen Rothwell

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

Hi all,

After merging the net-next tree, today's linux-next build (powerpc
allyesconfig) produced this warning:

In file included from include/linux/byteorder/big_endian.h:5,
from arch/powerpc/include/uapi/asm/byteorder.h:14,
from include/asm-generic/bitops/le.h:6,
from arch/powerpc/include/asm/bitops.h:250,
from include/linux/bitops.h:29,
from include/linux/kernel.h:12,
from include/linux/list.h:9,
from include/linux/module.h:12,
from drivers/net/usb/cdc_ncm.c:41:
drivers/net/usb/cdc_ncm.c: In function 'cdc_ncm_ndp32':
include/uapi/linux/byteorder/big_endian.h:33:26: warning: conversion from 'unsigned int' to '__le16' {aka 'short unsigned int'} changes value from '402653184' to '0' [-Woverflow]
33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
| ^
include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
88 | #define cpu_to_le32 __cpu_to_le32
| ^~~~~~~~~~~~~
drivers/net/usb/cdc_ncm.c:1175:19: note: in expansion of macro 'cpu_to_le32'
1175 | ndp32->wLength = cpu_to_le32(sizeof(struct usb_cdc_ncm_ndp32) + sizeof(struct usb_cdc_ncm_dpe32));
| ^~~~~~~~~~~

Introduced by commit

0fa81b304a79 ("cdc_ncm: Implement the 32-bit version of NCM Transfer Block")

--
Cheers,
Stephen Rothwell


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

Subject: Re: linux-next: build warning after merge of the net-next tree

Hi,

This is my patch, sorry for this warning.

The fix is to change cpu_to_le32 to cpu_to_le16 in line 1175:
ndp32->wLength = cpu_to_le16(sizeof(struct usb_cdc_ncm_ndp32) +
sizeof(struct usb_cdc_ncm_dpe32));

The full patch is attached

Best,
Alexander Bersenev

пт, 13 мар. 2020 г. в 14:54, Stephen Rothwell <[email protected]>:
>
> Hi all,
>
> After merging the net-next tree, today's linux-next build (powerpc
> allyesconfig) produced this warning:
>
> In file included from include/linux/byteorder/big_endian.h:5,
> from arch/powerpc/include/uapi/asm/byteorder.h:14,
> from include/asm-generic/bitops/le.h:6,
> from arch/powerpc/include/asm/bitops.h:250,
> from include/linux/bitops.h:29,
> from include/linux/kernel.h:12,
> from include/linux/list.h:9,
> from include/linux/module.h:12,
> from drivers/net/usb/cdc_ncm.c:41:
> drivers/net/usb/cdc_ncm.c: In function 'cdc_ncm_ndp32':
> include/uapi/linux/byteorder/big_endian.h:33:26: warning: conversion from 'unsigned int' to '__le16' {aka 'short unsigned int'} changes value from '402653184' to '0' [-Woverflow]
> 33 | #define __cpu_to_le32(x) ((__force __le32)__swab32((x)))
> | ^
> include/linux/byteorder/generic.h:88:21: note: in expansion of macro '__cpu_to_le32'
> 88 | #define cpu_to_le32 __cpu_to_le32
> | ^~~~~~~~~~~~~
> drivers/net/usb/cdc_ncm.c:1175:19: note: in expansion of macro 'cpu_to_le32'
> 1175 | ndp32->wLength = cpu_to_le32(sizeof(struct usb_cdc_ncm_ndp32) + sizeof(struct usb_cdc_ncm_dpe32));
> | ^~~~~~~~~~~
>
> Introduced by commit
>
> 0fa81b304a79 ("cdc_ncm: Implement the 32-bit version of NCM Transfer Block")
>
> --
> Cheers,
> Stephen Rothwell


Attachments:
0001-cdc_ncm-Implement-the-32-bit-version-of-NCM-Transfer.patch (24.73 kB)

2020-03-13 18:22:59

by David Miller

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


Please submit this formally, inline and not as an attachment, to netdev.
Otherwise patchwork will not pick it up and it will thus not get tracked
properly.

Thank you.

Subject: Re: linux-next: build warning after merge of the net-next tree

Ok, done.

Best,
Alexander Bersenev

пт, 13 мар. 2020 г. в 23:21, David Miller <[email protected]>:
>
>
> Please submit this formally, inline and not as an attachment, to netdev.
> Otherwise patchwork will not pick it up and it will thus not get tracked
> properly.
>
> Thank you.