WSL2-Linux-Kernel/arch/x86/platform
Alexander Lobakin c273671ae8 x86/olpc: fix 'logical not is only applied to the left hand side'
commit 3a2ba42cbd upstream.

The bitops compile-time optimization series revealed one more
problem in olpc-xo1-sci.c:send_ebook_state(), resulted in GCC
warnings:

arch/x86/platform/olpc/olpc-xo1-sci.c: In function 'send_ebook_state':
arch/x86/platform/olpc/olpc-xo1-sci.c:83:63: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
   83 |         if (!!test_bit(SW_TABLET_MODE, ebook_switch_idev->sw) == state)
      |                                                               ^~
arch/x86/platform/olpc/olpc-xo1-sci.c:83:13: note: add parentheses around left hand side expression to silence this warning

Despite this code working as intended, this redundant double
negation of boolean value, together with comparing to `char`
with no explicit conversion to bool, makes compilers think
the author made some unintentional logical mistakes here.
Make it the other way around and negate the char instead
to silence the warnings.

Fixes: d2aa37411b ("x86/olpc/xo1/sci: Produce wakeup events for buttons and switches")
Cc: stable@vger.kernel.org # 3.5+
Reported-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: kernel test robot <lkp@intel.com>
Reviewed-and-tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Alexander Lobakin <alexandr.lobakin@intel.com>
Signed-off-by: Yury Norov <yury.norov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-08-17 14:24:18 +02:00
..
atom
ce4100
efi efi/x86: use naked RET on mixed mode call wrapper 2022-07-23 12:54:12 +02:00
geode x86/platform/geode: Convert alix LED to GPIO machine descriptor 2021-01-15 18:55:53 +01:00
intel x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
intel-mid platform-drivers-x86 for v5.12-1 2021-02-22 08:50:01 -08:00
intel-quark x86/platform/intel/quark: Fix incorrect kernel-doc comment syntax in files 2021-04-10 13:59:25 +02:00
iris module: remove never implemented MODULE_SUPPORTED_DEVICE 2021-03-17 13:16:18 -07:00
olpc x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-17 14:24:18 +02:00
pvh x86/PVH: adjust function/data placement 2021-10-05 08:36:17 +02:00
scx200
ts5500
uv A bunch of SGI UV improvements, fixes and cleanups. 2021-04-26 09:34:19 -07:00
Makefile Simple Firmware Interface (SFI) support removal for v5.12-rc1 2021-02-24 10:35:29 -08:00