android_kernel_motorola_sm6225/drivers/platform
Michał Kępień 502ab004e6 platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an int
UNSUPPORTED_CMD was previously 0x80000000 (int), but commit 819cddae7c
("platform/x86: fujitsu-laptop: Clean up constants") changed it into an
unsigned long due to BIT() being used to define it.  As call_fext_func()
returns an int, 0x80000000 would get type promoted when compared to an
unsigned long, which on a 64-bit system would cause it to become
0xffffffff80000000 due to sign extension.  This causes one logical
condition in fujitsu-laptop to always be true and another one to always
be false on 64-bit systems.  Fix this by reverting UNSUPPORTED_CMD back
to an int.

This patch fixes the following smatch warnings:

drivers/platform/x86/fujitsu-laptop.c:763 acpi_fujitsu_laptop_leds_register() warn: always true condition '(call_fext_func(device, ((1 << (12)) | (1 << (0))), 2, (1 << (16)), 0) != (1 << (31))) => (s32min-s32max != 2147483648)'
drivers/platform/x86/fujitsu-laptop.c:816 acpi_fujitsu_laptop_add() warn: impossible condition '(priv->flags_supported == (1 << (31))) => (0-2147483647,18446744071562067968-u64max == 2147483648)'

Fixes: 819cddae7c ("platform/x86: fujitsu-laptop: Clean up constants")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
2018-03-21 16:28:14 -07:00
..
chrome vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
goldfish vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
mellanox platform/mellanox: mlxreg-hotplug: Fix uninitialized variable 2018-02-08 17:43:37 -08:00
mips MIPS: Loongson-3: Support 4 packages in CPU Hwmon driver 2017-06-29 02:42:22 +02:00
olpc platform/olpc: Make ec explicitly non-modular 2016-08-28 22:31:52 -07:00
x86 platform/x86: fujitsu-laptop: Revert UNSUPPORTED_CMD back to an int 2018-03-21 16:28:14 -07:00
Kconfig platform/x86: Move Mellanox platform hotplug driver to platform/mellanox 2018-01-31 10:36:48 -08:00
Makefile platform/x86: Move Mellanox platform hotplug driver to platform/mellanox 2018-01-31 10:36:48 -08:00