aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb/cdns3/cdns3-trace.c
diff options
context:
space:
mode:
authorAlexander Lobakin <[email protected]>2022-07-15 17:15:36 +0200
committerYury Norov <[email protected]>2022-07-15 08:30:16 -0700
commit3a2ba42cbd0b669ce3837ba400905f93dd06c79f (patch)
tree609e8d5ae2278e9623ee43c7ffe9b4e08cd7657f /drivers/usb/cdns3/cdns3-trace.c
parentf0dd891dd5a1d6dc6c9d486333aac4f433f17d17 (diff)
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: d2aa37411b8e ("x86/olpc/xo1/sci: Produce wakeup events for buttons and switches") Cc: [email protected] # 3.5+ Reported-by: Guenter Roeck <[email protected]> Reported-by: kernel test robot <[email protected]> Reviewed-and-tested-by: Guenter Roeck <[email protected]> Signed-off-by: Alexander Lobakin <[email protected]> Signed-off-by: Yury Norov <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-trace.c')
0 files changed, 0 insertions, 0 deletions