linux-stable/drivers/isdn
Nathan Chancellor 321c40dce5 mISDN: Fix type of switch control variable in ctrl_teimanager
[ Upstream commit aeb5e02aca ]

Clang warns (trimmed for brevity):

drivers/isdn/mISDN/tei.c:1193:7: warning: overflow converting case value
to switch condition type (2147764552 to 18446744071562348872) [-Wswitch]
        case IMHOLD_L1:
             ^
drivers/isdn/mISDN/tei.c:1187:7: warning: overflow converting case value
to switch condition type (2147764550 to 18446744071562348870) [-Wswitch]
        case IMCLEAR_L2:
             ^
2 warnings generated.

The root cause is that the _IOC macro can generate really large numbers,
which don't find into type int. My research into how GCC and Clang are
handling this at a low level didn't prove fruitful and surveying the
kernel tree shows that aside from here and a few places in the scsi
subsystem, everything that uses _IOC is at least of type 'unsigned int'.
Make that change here because as nothing in this function cares about
the signedness of the variable and it removes ambiguity, which is never
good when dealing with compilers.

While we're here, remove the unnecessary local variable ret (just return
-EINVAL and 0 directly).

Link: https://github.com/ClangBuiltLinux/linux/issues/67
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2019-12-01 09:16:55 +01:00
..
capi net: use skb_queue_empty_lockless() in poll() handlers 2019-11-10 11:27:48 +01:00
divert vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
gigaset isdn: bas_gigaset: use usb_fill_int_urb() properly 2019-05-16 19:41:31 +02:00
hardware isdn: hfcsusb: Fix mISDN driver crash caused by transfer buffer on the stack 2019-08-29 08:28:35 +02:00
hisax isdn: hisax: hfc_pci: Fix a possible concurrency use-after-free bug in HFCPCI_l1hw() 2019-02-12 19:47:18 +01:00
hysdn isdn: mark expected switch fall-throughs 2018-07-04 22:17:32 +09:00
i4l isdn: i4l: isdn_tty: Fix some concurrency double-free bugs 2019-02-27 10:08:55 +01:00
isdnloop isdnloop: Convert timers to use timer_setup() 2017-10-18 12:40:25 +01:00
mISDN mISDN: Fix type of switch control variable in ctrl_teimanager 2019-12-01 09:16:55 +01:00
Kconfig
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00