From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f68.google.com ([209.85.221.68]:41376 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732252AbeGaSoO (ORCPT ); Tue, 31 Jul 2018 14:44:14 -0400 Date: Tue, 31 Jul 2018 10:02:56 -0700 From: Nathan Chancellor To: Nick Desaulniers Cc: lkp@intel.com, kbuild-all@01.org, Andrew Morton , Arnd Bergmann , paul.burton@mips.com, christophe.leroy@c-s.fr, shorne@gmail.com, Masahiro Yamada , Kees Cook , Ingo Molnar , Greg KH , Thomas Gleixner , rdunlap@infradead.org, bp@suse.de, neilb@suse.com, LKML , Andrey Ryabinin , dwmw@amazon.co.uk, sandipan@linux.vnet.ibm.com, linux@rasmusvillemoes.dk, Paul Lawrence , Andrey Konovalov , Will Deacon , ghackmann@android.com, stable@vger.kernel.org, Greg Hackmann , Matthias Kaehlcke , Josh Poimboeuf , Wei Wang , avagin@openvz.org Subject: Re: [PATCH v2 2/2] kernel.h: Disable -Wreturn-stack-address for _THIS_IP_ Message-ID: <20180731170256.GA23359@flashbox> References: <20180730213412.242849-3-ndesaulniers@google.com> <201807311827.UpeCrGPC%fengguang.wu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: stable-owner@vger.kernel.org List-ID: On Tue, Jul 31, 2018 at 09:48:57AM -0700, Nick Desaulniers wrote: > Does anyone understand this error? The code looks just fine to me, > and the source file doesn't conflict with any of the macros I've added > (certainly not in any way that could cause an indentation error as > reported here). Unfortunately, I've been trying to work through it this morning and I can't understand it either. lock_map_acquire_read's defintion does include _THIS_IP_ and adding curly braces to the if statement fixes it but that doesn't explain why it's happening. Maybe this is a GCC bug/issue? Cheers, Nathan > On Tue, Jul 31, 2018 at 3:27 AM kbuild test robot wrote: > > > > Hi Nick, > > > > Thank you for the patch! Perhaps something to improve: > > > > [auto build test WARNING on linus/master] > > [also build test WARNING on v4.18-rc7 next-20180727] > > [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/Nick-Desaulniers/compiler-clang-h-Add-CLANG_VERSION-and-__diag-macros/20180731-161932 > > config: x86_64-fedora-25 (attached as .config) > > compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 > > reproduce: > > # save the attached .config to linux build tree > > make ARCH=x86_64 > > > > All warnings (new ones prefixed by >>): > > > > drivers/net//wireless/intel/iwlwifi/iwl-trans.c: In function 'iwl_trans_send_cmd': > > >> drivers/net//wireless/intel/iwlwifi/iwl-trans.c:137:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation] > > if (!(cmd->flags & CMD_ASYNC)) > > ^~ > > drivers/net//wireless/intel/iwlwifi/iwl-trans.c:138:1: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if' > > lock_map_acquire_read(&trans->sync_cmd_lockdep_map); > > ^ ~ > > > > vim +/if +137 drivers/net//wireless/intel/iwlwifi/iwl-trans.c > > > > 92fe8343 Emmanuel Grumbach 2015-12-01 116 > > 92fe8343 Emmanuel Grumbach 2015-12-01 117 int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd) > > 92fe8343 Emmanuel Grumbach 2015-12-01 118 { > > 92fe8343 Emmanuel Grumbach 2015-12-01 119 int ret; > > 92fe8343 Emmanuel Grumbach 2015-12-01 120 > > 92fe8343 Emmanuel Grumbach 2015-12-01 121 if (unlikely(!(cmd->flags & CMD_SEND_IN_RFKILL) && > > 326477e4 Johannes Berg 2017-04-25 122 test_bit(STATUS_RFKILL_OPMODE, &trans->status))) > > 92fe8343 Emmanuel Grumbach 2015-12-01 123 return -ERFKILL; > > 92fe8343 Emmanuel Grumbach 2015-12-01 124 > > 92fe8343 Emmanuel Grumbach 2015-12-01 125 if (unlikely(test_bit(STATUS_FW_ERROR, &trans->status))) > > 92fe8343 Emmanuel Grumbach 2015-12-01 126 return -EIO; > > 92fe8343 Emmanuel Grumbach 2015-12-01 127 > > 92fe8343 Emmanuel Grumbach 2015-12-01 128 if (unlikely(trans->state != IWL_TRANS_FW_ALIVE)) { > > 92fe8343 Emmanuel Grumbach 2015-12-01 129 IWL_ERR(trans, "%s bad state = %d\n", __func__, trans->state); > > 92fe8343 Emmanuel Grumbach 2015-12-01 130 return -EIO; > > 92fe8343 Emmanuel Grumbach 2015-12-01 131 } > > 92fe8343 Emmanuel Grumbach 2015-12-01 132 > > 92fe8343 Emmanuel Grumbach 2015-12-01 133 if (WARN_ON((cmd->flags & CMD_WANT_ASYNC_CALLBACK) && > > 92fe8343 Emmanuel Grumbach 2015-12-01 134 !(cmd->flags & CMD_ASYNC))) > > 92fe8343 Emmanuel Grumbach 2015-12-01 135 return -EINVAL; > > 92fe8343 Emmanuel Grumbach 2015-12-01 136 > > 92fe8343 Emmanuel Grumbach 2015-12-01 @137 if (!(cmd->flags & CMD_ASYNC)) > > 92fe8343 Emmanuel Grumbach 2015-12-01 138 lock_map_acquire_read(&trans->sync_cmd_lockdep_map); > > 92fe8343 Emmanuel Grumbach 2015-12-01 139 > > 5b88792c Sara Sharon 2016-08-15 140 if (trans->wide_cmd_header && !iwl_cmd_groupid(cmd->id)) > > 5b88792c Sara Sharon 2016-08-15 141 cmd->id = DEF_ID(cmd->id); > > 5b88792c Sara Sharon 2016-08-15 142 > > 92fe8343 Emmanuel Grumbach 2015-12-01 143 ret = trans->ops->send_cmd(trans, cmd); > > 92fe8343 Emmanuel Grumbach 2015-12-01 144 > > 92fe8343 Emmanuel Grumbach 2015-12-01 145 if (!(cmd->flags & CMD_ASYNC)) > > 92fe8343 Emmanuel Grumbach 2015-12-01 146 lock_map_release(&trans->sync_cmd_lockdep_map); > > 92fe8343 Emmanuel Grumbach 2015-12-01 147 > > 0ec971fd Johannes Berg 2017-04-10 148 if (WARN_ON((cmd->flags & CMD_WANT_SKB) && !ret && !cmd->resp_pkt)) > > 0ec971fd Johannes Berg 2017-04-10 149 return -EIO; > > 0ec971fd Johannes Berg 2017-04-10 150 > > 92fe8343 Emmanuel Grumbach 2015-12-01 151 return ret; > > 92fe8343 Emmanuel Grumbach 2015-12-01 152 } > > 92fe8343 Emmanuel Grumbach 2015-12-01 153 IWL_EXPORT_SYMBOL(iwl_trans_send_cmd); > > 39bdb17e Sharon Dvir 2015-10-15 154 > > > > :::::: The code at line 137 was first introduced by commit > > :::::: 92fe83430b899b786c837e5b716a328220d47ae5 iwlwifi: uninline iwl_trans_send_cmd > > > > :::::: TO: Emmanuel Grumbach > > :::::: CC: Emmanuel Grumbach > > > > --- > > 0-DAY kernel test infrastructure Open Source Technology Center > > https://lists.01.org/pipermail/kbuild-all Intel Corporation > > > > -- > Thanks, > ~Nick Desaulniers