linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [djwong-xfs:mount-api-crash 91/104] fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true'
       [not found] ` <20191030033925.GA14630@ubuntu-m2-xlarge-x86>
@ 2019-10-30 15:45   ` Darrick J. Wong
  2019-10-30 15:48     ` Nathan Chancellor
  2019-10-31  0:06     ` Ian Kent
  0 siblings, 2 replies; 3+ messages in thread
From: Darrick J. Wong @ 2019-10-30 15:45 UTC (permalink / raw)
  To: Nathan Chancellor, Ian Kent
  Cc: kbuild, Nick Desaulniers, clang-built-linux, kbuild test robot, xfs

On Tue, Oct 29, 2019 at 08:39:25PM -0700, Nathan Chancellor wrote:
> On Tue, Oct 29, 2019 at 02:45:40PM +0800, kbuild test robot wrote:
> > CC: kbuild-all@lists.01.org
> > CC: "Darrick J. Wong" <darrick.wong@oracle.com>
> > TO: Ian Kent <raven@themaw.net>
> > CC: "Darrick J. Wong" <darrick.wong@oracle.com>
> > CC: Christoph Hellwig <hch@lst.de>

FYI, It's customary to cc the patch author [and the xfs list]...

> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git mount-api-crash
> > head:   e35c37b1b9987c8d87d91dbeca6c24aade2a3390
> > commit: a5a36409da3a608c815b38b0ff2eb5bcfc1adec6 [91/104] xfs: use super s_id instead of struct xfs_mount
> > config: x86_64-rhel-7.6 (attached as .config)
> > compiler: clang version 10.0.0 (git://gitmirror/llvm_project 7cd595df96d5929488063d8ff5cc3b5d800386da)
> > reproduce:
> >         git checkout a5a36409da3a608c815b38b0ff2eb5bcfc1adec6
> >         # save the attached .config to linux build tree
> >         make ARCH=x86_64 
> > 
> > If you fix the issue, kindly add following tag
> > Reported-by: kbuild test robot <lkp@intel.com>
> > 
> > All warnings (new ones prefixed by >>):
> > 
> > >> fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true' [-Wpointer-bool-conversion]
> >            if (mp && mp->m_super && mp->m_super->s_id) {
> >                                  ~~ ~~~~~~~~~~~~~^~~~

...so, Ian, I guess this isn't necessary ^^^^^^^^^^^^^^^^
because it's a char array, not a pointer. :)

Good catch!

--D

> >    1 warning generated.
> > 
> > vim +23 fs/xfs/xfs_message.c
> > 
> >     13	
> >     14	/*
> >     15	 * XFS logging functions
> >     16	 */
> >     17	static void
> >     18	__xfs_printk(
> >     19		const char		*level,
> >     20		const struct xfs_mount	*mp,
> >     21		struct va_format	*vaf)
> >     22	{
> >   > 23		if (mp && mp->m_super && mp->m_super->s_id) {
> >     24			printk("%sXFS (%s): %pV\n", level, mp->m_super->s_id, vaf);
> >     25			return;
> >     26		}
> >     27		printk("%sXFS: %pV\n", level, vaf);
> >     28	}
> >     29	
> > 
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> > 
> 
> Hi Darrick,
> 
> The 0day team has been doing clang builds for us and we've been
> forwarding the valid warnings along to developers. This appeared after
> the commit listed above. That check should be unnecessary, perhaps you
> meant to check for something else? Thanks for looking into this.
> 
> Cheers,
> Nathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [djwong-xfs:mount-api-crash 91/104] fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true'
  2019-10-30 15:45   ` [djwong-xfs:mount-api-crash 91/104] fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true' Darrick J. Wong
@ 2019-10-30 15:48     ` Nathan Chancellor
  2019-10-31  0:06     ` Ian Kent
  1 sibling, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2019-10-30 15:48 UTC (permalink / raw)
  To: Darrick J. Wong
  Cc: Ian Kent, kbuild, Nick Desaulniers, clang-built-linux,
	kbuild test robot, xfs

On Wed, Oct 30, 2019 at 08:45:43AM -0700, Darrick J. Wong wrote:
> On Tue, Oct 29, 2019 at 08:39:25PM -0700, Nathan Chancellor wrote:
> > On Tue, Oct 29, 2019 at 02:45:40PM +0800, kbuild test robot wrote:
> > > CC: kbuild-all@lists.01.org
> > > CC: "Darrick J. Wong" <darrick.wong@oracle.com>
> > > TO: Ian Kent <raven@themaw.net>
> > > CC: "Darrick J. Wong" <darrick.wong@oracle.com>
> > > CC: Christoph Hellwig <hch@lst.de>
> 
> FYI, It's customary to cc the patch author [and the xfs list]...

Ugh sorry, was in a rush last night and not paying attention :( will be
better next time and thanks for adding the right people!

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [djwong-xfs:mount-api-crash 91/104] fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true'
  2019-10-30 15:45   ` [djwong-xfs:mount-api-crash 91/104] fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true' Darrick J. Wong
  2019-10-30 15:48     ` Nathan Chancellor
@ 2019-10-31  0:06     ` Ian Kent
  1 sibling, 0 replies; 3+ messages in thread
From: Ian Kent @ 2019-10-31  0:06 UTC (permalink / raw)
  To: Darrick J. Wong, Nathan Chancellor
  Cc: kbuild, Nick Desaulniers, clang-built-linux, kbuild test robot, xfs

On Wed, 2019-10-30 at 08:45 -0700, Darrick J. Wong wrote:
> On Tue, Oct 29, 2019 at 08:39:25PM -0700, Nathan Chancellor wrote:
> > On Tue, Oct 29, 2019 at 02:45:40PM +0800, kbuild test robot wrote:
> > > CC: kbuild-all@lists.01.org
> > > CC: "Darrick J. Wong" <darrick.wong@oracle.com>
> > > TO: Ian Kent <raven@themaw.net>
> > > CC: "Darrick J. Wong" <darrick.wong@oracle.com>
> > > CC: Christoph Hellwig <hch@lst.de>
> 
> FYI, It's customary to cc the patch author [and the xfs list]...
> 
> > > tree:   
> > > https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
> > > mount-api-crash
> > > head:   e35c37b1b9987c8d87d91dbeca6c24aade2a3390
> > > commit: a5a36409da3a608c815b38b0ff2eb5bcfc1adec6 [91/104] xfs:
> > > use super s_id instead of struct xfs_mount
> > > config: x86_64-rhel-7.6 (attached as .config)
> > > compiler: clang version 10.0.0 (git://gitmirror/llvm_project
> > > 7cd595df96d5929488063d8ff5cc3b5d800386da)
> > > reproduce:
> > >         git checkout a5a36409da3a608c815b38b0ff2eb5bcfc1adec6
> > >         # save the attached .config to linux build tree
> > >         make ARCH=x86_64 
> > > 
> > > If you fix the issue, kindly add following tag
> > > Reported-by: kbuild test robot <lkp@intel.com>
> > > 
> > > All warnings (new ones prefixed by >>):
> > > 
> > > > > fs/xfs/xfs_message.c:23:40: warning: address of array 'mp-
> > > > > >m_super->s_id' will always evaluate to 'true' [-Wpointer-
> > > > > bool-conversion]
> > >            if (mp && mp->m_super && mp->m_super->s_id) {
> > >                                  ~~ ~~~~~~~~~~~~~^~~~
> 
> ...so, Ian, I guess this isn't necessary ^^^^^^^^^^^^^^^^
> because it's a char array, not a pointer. :)
> 
> Good catch!

Indeed, better now than later, ;)

> 
> --D
> 
> > >    1 warning generated.
> > > 
> > > vim +23 fs/xfs/xfs_message.c
> > > 
> > >     13	
> > >     14	/*
> > >     15	 * XFS logging functions
> > >     16	 */
> > >     17	static void
> > >     18	__xfs_printk(
> > >     19		const char		*level,
> > >     20		const struct xfs_mount	*mp,
> > >     21		struct va_format	*vaf)
> > >     22	{
> > >   > 23		if (mp && mp->m_super && mp->m_super->s_id) {
> > >     24			printk("%sXFS (%s): %pV\n", level, mp-
> > > >m_super->s_id, vaf);
> > >     25			return;
> > >     26		}
> > >     27		printk("%sXFS: %pV\n", level, vaf);
> > >     28	}
> > >     29	
> > > 
> > > ---
> > > 0-DAY kernel test infrastructure                Open Source
> > > Technology Center
> > > https://lists.01.org/pipermail/kbuild-all                   Intel
> > > Corporation
> > > 
> > 
> > Hi Darrick,
> > 
> > The 0day team has been doing clang builds for us and we've been
> > forwarding the valid warnings along to developers. This appeared
> > after
> > the commit listed above. That check should be unnecessary, perhaps
> > you
> > meant to check for something else? Thanks for looking into this.
> > 
> > Cheers,
> > Nathan


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-31  0:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201910291437.fsxNAnIM%lkp@intel.com>
     [not found] ` <20191030033925.GA14630@ubuntu-m2-xlarge-x86>
2019-10-30 15:45   ` [djwong-xfs:mount-api-crash 91/104] fs/xfs/xfs_message.c:23:40: warning: address of array 'mp->m_super->s_id' will always evaluate to 'true' Darrick J. Wong
2019-10-30 15:48     ` Nathan Chancellor
2019-10-31  0:06     ` Ian Kent

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).