linux-stable/arch/x86/platform/olpc
Alexander Lobakin 3a2ba42cbd x86/olpc: fix 'logical not is only applied to the left hand side'
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>
2022-07-15 08:30:16 -07:00
..
Makefile
olpc-xo1-pm.c x86: olpc-xo1-pm: Remove invocation of MFD's .enable()/.disable() call-backs 2019-11-11 08:45:03 +00:00
olpc-xo1-rtc.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
olpc-xo1-sci.c x86/olpc: fix 'logical not is only applied to the left hand side' 2022-07-15 08:30:16 -07:00
olpc-xo15-sci.c x86: Fix various typos in comments, take #2 2021-03-21 23:50:28 +01:00
olpc.c x86/platform/olpc: Correct ifdef symbol to intended CONFIG_OLPC_XO15_SCI 2021-10-06 18:46:06 +02:00
olpc_dt.c x86: Fix various typos in comments, take #2 2021-03-21 23:50:28 +01:00
olpc_ofw.c mm: reorder includes after introduction of linux/pgtable.h 2020-06-09 09:39:13 -07:00
xo1-wakeup.S x86: Prepare asm files for straight-line-speculation 2021-12-08 12:25:37 +01:00