android_kernel_xiaomi_sm7250/drivers/isdn/mISDN
Nathan Chancellor 321c40dce5 mISDN: Fix type of switch control variable in ctrl_teimanager
[ Upstream commit aeb5e02aca91522733eb1db595ac607d30c87767 ]

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
..
clock.c
core.c
core.h
dsp_audio.c
dsp_biquad.h
dsp_blowfish.c
dsp_cmx.c networking: introduce and use skb_put_data() 2017-06-16 11:48:37 -04:00
dsp_core.c mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
dsp_dtmf.c
dsp_ecdis.h
dsp_hwec.c mISDN: Remove VLAs 2018-04-12 21:46:10 -04:00
dsp_hwec.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
dsp_pipeline.c
dsp_tones.c mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
dsp.h mISDN: Convert timers to use timer_setup() 2017-10-18 12:39:39 +01:00
fsm.c treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
fsm.h mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
hwchannel.c
Kconfig
l1oip_codec.c
l1oip_core.c mISDN: Remove VLAs 2018-04-12 21:46:10 -04:00
l1oip.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
layer1.c mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
layer1.h
layer2.c mISDN: Fix null pointer dereference at mISDN_FsmNew 2017-08-11 14:56:23 -07:00
layer2.h
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
socket.c mISDN: enforce CAP_NET_RAW for raw sockets 2019-10-05 13:09:31 +02:00
stack.c isdn: mark expected switch fall-throughs 2018-07-04 22:17:32 +09:00
tei.c mISDN: Fix type of switch control variable in ctrl_teimanager 2019-12-01 09:16:55 +01:00
timerdev.c mISDN: fix a race in dev_expire_timer() 2019-02-23 09:07:27 +01:00