mirror of
https://github.com/torvalds/linux.git
synced 2024-12-25 12:21:37 +00:00
a39644b235
gcc produces a harmless warning about a recently introduced
signed integer overflow:
drivers/net/wireless/rsi/rsi_91x_hal.c: In function 'rsi_prepare_mgmt_desc':
include/uapi/linux/swab.h:13:15: error: integer overflow in expression [-Werror=overflow]
(((__u16)(x) & (__u16)0x00ffU) << 8) | \
~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
include/uapi/linux/swab.h:104:2: note: in expansion of macro '___constant_swab16'
___constant_swab16(x) : \
^~~~~~~~~~~~~~~~~~
include/uapi/linux/byteorder/big_endian.h:34:43: note: in expansion of macro '__swab16'
#define __cpu_to_le16(x) ((__force __le16)__swab16((x)))
^~~~~~~~
include/linux/byteorder/generic.h:89:21: note: in expansion of macro '__cpu_to_le16'
#define cpu_to_le16 __cpu_to_le16
^~~~~~~~~~~~~
drivers/net/wireless/rsi/rsi_91x_hal.c:136:3: note: in expansion of macro 'cpu_to_le16'
cpu_to_le16((tx_params->vap_id << RSI_DESC_VAP_ID_OFST) &
^~~~~~~~~~~
The problem is that the 'mask' value is a signed integer that gets
turned into a negative number when truncated to 16 bits. Making it
an unsigned constant avoids this.
Fixes:
|
||
---|---|---|
.. | ||
Kconfig | ||
Makefile | ||
rsi_91x_core.c | ||
rsi_91x_debugfs.c | ||
rsi_91x_hal.c | ||
rsi_91x_mac80211.c | ||
rsi_91x_main.c | ||
rsi_91x_mgmt.c | ||
rsi_91x_ps.c | ||
rsi_91x_sdio_ops.c | ||
rsi_91x_sdio.c | ||
rsi_91x_usb_ops.c | ||
rsi_91x_usb.c | ||
rsi_boot_params.h | ||
rsi_common.h | ||
rsi_debugfs.h | ||
rsi_hal.h | ||
rsi_main.h | ||
rsi_mgmt.h | ||
rsi_ps.h | ||
rsi_sdio.h | ||
rsi_usb.h |