]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
platform/x86: acer-wmi: refactor function has_cap
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 6 Aug 2018 20:38:32 +0000 (15:38 -0500)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 15 Aug 2018 10:17:48 +0000 (13:17 +0300)
Refactor function has_cap in order to avoid returning integer
values, when instead it should return booleans.

This code was detected with the help of Coccinelle.

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: "Lee, Chun-Yi" <jlee@suse.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/acer-wmi.c

index 8952173dd380b6e650c6d54dd6498660286f0a27..3294bb2b37fce25ec664bfc55d46a4ba5c481526 100644 (file)
@@ -672,10 +672,7 @@ static void __init find_quirks(void)
 
 static bool has_cap(u32 cap)
 {
-       if ((interface->capability & cap) != 0)
-               return 1;
-
-       return 0;
+       return interface->capability & cap;
 }
 
 /*