Hi Ognjen, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on platform-drivers-x86/for-next] [also build test WARNING on v4.15-rc4 next-20171222] [cannot apply to pm/linux-next] [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Ognjen-Galic/battery-Add-the-battery-hooking-API/20171223-144855 base: git://git.infradead.org/users/dvhart/linux-platform-drivers-x86.git for-next config: i386-randconfig-x007-201751 (attached as .config) compiler: gcc-7 (Debian 7.2.0-12) 7.2.1 20171025 reproduce: # save the attached .config to linux build tree make ARCH=i386 All warnings (new ones prefixed by >>): In file included from include/linux/kernel.h:10:0, from drivers//acpi/battery.c:24: drivers//acpi/battery.c: In function 'acpi_battery_exit': include/linux/compiler.h:58:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] if (__builtin_constant_p(!!(cond)) ? !!(cond) : \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ >> drivers//acpi/battery.c:1532:2: note: in expansion of macro 'if' if (battery_driver_registered) ^~ drivers//acpi/battery.c:1534:3: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' battery_hook_exit(); ^~~~~~~~~~~~~~~~~ In file included from include/linux/kernel.h:10:0, from drivers//acpi/battery.c:24: drivers//acpi/battery.c: At top level: include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'strcpy' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:422:2: note: in expansion of macro 'if' if (p_size == (size_t)-1 && q_size == (size_t)-1) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:412:2: note: in expansion of macro 'if' if (p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'kmemdup' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:410:2: note: in expansion of macro 'if' if (__builtin_constant_p(size) && p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:401:2: note: in expansion of macro 'if' if (p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memchr_inv' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:399:2: note: in expansion of macro 'if' if (__builtin_constant_p(size) && p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memchr' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:390:2: note: in expansion of macro 'if' if (p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memchr' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:388:2: note: in expansion of macro 'if' if (__builtin_constant_p(size) && p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:380:2: note: in expansion of macro 'if' if (p_size < size || q_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:377:3: note: in expansion of macro 'if' if (q_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static ______f = { \ ^ include/linux/compiler.h:56:23: note: in expansion of macro '__trace_if' #define if(cond, ...) __trace_if( (cond , ## __VA_ARGS__) ) ^~~~~~~~~~ include/linux/string.h:375:3: note: in expansion of macro 'if' if (p_size < size) ^~ include/linux/compiler.h:64:4: warning: '______f' is static but declared in inline function 'memcmp' which is not static ______f = { \ vim +/if +1532 drivers//acpi/battery.c ^1da177e Linus Torvalds 2005-04-16 1528 4be44fcd Len Brown 2005-08-05 1529 static void __exit acpi_battery_exit(void) ^1da177e Linus Torvalds 2005-04-16 1530 { 5dfa0c73 Chris Wilson 2016-05-19 1531 async_synchronize_cookie(async_cookie + 1); bc39fbcf Hans de Goede 2017-04-19 @1532 if (battery_driver_registered) ^1da177e Linus Torvalds 2005-04-16 1533 acpi_bus_unregister_driver(&acpi_battery_driver); 19380b8e Ognjen Galic 2017-12-20 1534 battery_hook_exit(); 3a670cc7 Lan Tianyu 2014-05-04 1535 #ifdef CONFIG_ACPI_PROCFS_POWER bc39fbcf Hans de Goede 2017-04-19 1536 if (acpi_battery_dir) 3a670cc7 Lan Tianyu 2014-05-04 1537 acpi_unlock_battery_dir(acpi_battery_dir); 3a670cc7 Lan Tianyu 2014-05-04 1538 #endif ^1da177e Linus Torvalds 2005-04-16 1539 } ^1da177e Linus Torvalds 2005-04-16 1540 :::::: The code at line 1532 was first introduced by commit :::::: bc39fbcf9c782970263bdc5b428e4a755db16efb ACPI / battery: Fix acpi_battery_exit on acpi_battery_init_async errors :::::: TO: Hans de Goede :::::: CC: Rafael J. Wysocki --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation