public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <natechancellor@gmail.com>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: lkp@intel.com, kbuild-all@01.org,
	Andrew Morton <akpm@linux-foundation.org>,
	Arnd Bergmann <arnd@arndb.de>,
	paul.burton@mips.com, christophe.leroy@c-s.fr, shorne@gmail.com,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Kees Cook <keescook@chromium.org>, Ingo Molnar <mingo@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	rdunlap@infradead.org, bp@suse.de, neilb@suse.com,
	LKML <linux-kernel@vger.kernel.org>,
	Andrey Ryabinin <aryabinin@virtuozzo.com>,
	dwmw@amazon.co.uk, sandipan@linux.vnet.ibm.com,
	linux@rasmusvillemoes.dk, Paul Lawrence <paullawrence@google.com>,
	Andrey Konovalov <andreyknvl@google.com>,
	Will Deacon <will.deacon@arm.com>,
	ghackmann@android.com, stable@vger.kernel.org,
	Greg Hackmann <ghackmann@google.com>,
	Matthias Kaehlcke <mka@chromium.org>,
	Josh Poimboeuf <jpoimboe@redhat.com>, Wei Wang <wvw@google.com>,
	avagin@openvz.org
Subject: Re: [PATCH v2 2/2] kernel.h: Disable -Wreturn-stack-address for _THIS_IP_
Date: Tue, 31 Jul 2018 10:02:56 -0700	[thread overview]
Message-ID: <20180731170256.GA23359@flashbox> (raw)
In-Reply-To: <CAKwvOd=rwib91mnXs=PCP460hkCWTE5anNFgvRPBrbagetCbzw@mail.gmail.com>

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 <lkp@intel.com> 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 <emmanuel.grumbach@intel.com>
> > :::::: CC: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
> >
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 
> 
> 
> -- 
> Thanks,
> ~Nick Desaulniers

  parent reply	other threads:[~2018-07-31 17:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-30 21:34 [PATCH v2 0/2] CLANG_VERSION and __diag macros Nick Desaulniers
2018-07-30 21:34 ` [PATCH v2 1/2] compiler-clang.h: Add " Nick Desaulniers
2018-07-30 23:25   ` Nathan Chancellor
2018-08-31 21:50   ` Nick Desaulniers
2018-08-31 22:16     ` Miguel Ojeda
2018-07-30 21:34 ` [PATCH v2 2/2] kernel.h: Disable -Wreturn-stack-address for _THIS_IP_ Nick Desaulniers
2018-07-30 23:25   ` Nathan Chancellor
2018-07-31 10:27   ` kbuild test robot
2018-07-31 16:48     ` Nick Desaulniers
2018-07-31 17:02       ` Kees Cook
2018-07-31 17:09         ` Nick Desaulniers
2018-07-31 18:58         ` Nick Desaulniers
2018-07-31 21:10           ` Nick Desaulniers
2018-07-31 17:02       ` Nathan Chancellor [this message]
2018-07-31 13:53   ` kbuild test robot
2018-07-31 16:55     ` Nick Desaulniers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180731170256.GA23359@flashbox \
    --to=natechancellor@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@google.com \
    --cc=arnd@arndb.de \
    --cc=aryabinin@virtuozzo.com \
    --cc=avagin@openvz.org \
    --cc=bp@suse.de \
    --cc=christophe.leroy@c-s.fr \
    --cc=dwmw@amazon.co.uk \
    --cc=ghackmann@android.com \
    --cc=ghackmann@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jpoimboe@redhat.com \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=lkp@intel.com \
    --cc=mingo@kernel.org \
    --cc=mka@chromium.org \
    --cc=ndesaulniers@google.com \
    --cc=neilb@suse.com \
    --cc=paul.burton@mips.com \
    --cc=paullawrence@google.com \
    --cc=rdunlap@infradead.org \
    --cc=sandipan@linux.vnet.ibm.com \
    --cc=shorne@gmail.com \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    --cc=wvw@google.com \
    --cc=yamada.masahiro@socionext.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox