kernel_optimize_test/drivers/soc
Dan Carpenter 8e81ff6d51 soc: aspeed: fix a ternary sign expansion bug
[ Upstream commit 5ffa828534036348fa90fb3079ccc0972d202c4a ]

The intent here was to return negative error codes but it actually
returns positive values.  The problem is that type promotion with
ternary operations is quite complicated.

"ret" is an int.  "copied" is a u32.  And the snoop_file_read() function
returns long.  What happens is that "ret" is cast to u32 and becomes
positive then it's cast to long and it's still positive.

Fix this by removing the ternary so that "ret" is type promoted directly
to long.

Fixes: 3772e5da44 ("drivers/misc: Aspeed LPC snoop output using misc chardev")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Patrick Venture <venture@google.com>
Link: https://lore.kernel.org/r/YIE90PSXsMTa2Y8n@mwanda
Link: https://lore.kernel.org/r/20210423000919.1249474-1-joel@jms.id.au'
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-05-14 09:50:21 +02:00
..
actions
amlogic
aspeed soc: aspeed: fix a ternary sign expansion bug 2021-05-14 09:50:21 +02:00
atmel
bcm
dove
fsl soc/fsl: qbman: fix conflicting alignment attributes 2021-04-14 08:42:09 +02:00
gemini
imx ARM: imx: fix imx8m dependencies 2021-02-03 23:28:45 +01:00
ixp4xx
kendryte
lantiq
mediatek
qcom soc: qcom: mdt_loader: Detect truncated read of segments 2021-05-14 09:50:16 +02:00
renesas
rockchip
samsung soc: samsung: exynos-asv: handle reading revision register error 2021-03-04 11:38:32 +01:00
sifive
sunxi
tegra soc/tegra: regulators: Fix locking up when voltage-spread is out of range 2021-05-14 09:49:58 +02:00
ti soc: ti: omap-prm: Fix occasional abort on reset deassert for dra7 iva 2021-03-30 14:31:56 +02:00
ux500
versatile
xilinx
zte
Kconfig
Makefile