linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Allison Collins <allison.henderson@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>, linux-xfs@vger.kernel.org
Subject: Re: [PATCH v3 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add
Date: Mon, 27 Jul 2020 15:20:13 -0700	[thread overview]
Message-ID: <15d8413e-8e50-f1dd-e5cf-c2fb16f47645@oracle.com> (raw)
In-Reply-To: <4144b860-1cae-3f68-9ea8-0fa159783047@sandeen.net>



On 7/27/20 2:58 PM, Eric Sandeen wrote:
> On 7/27/20 1:06 PM, Allison Collins wrote:
>> Fix compiler warning warning: variable 'error' set but not used in
>> xfs_attr_shortform_add. error is used only in an ASSERT so only declare
>> error when DEBUG is set.
>>
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Allison Collins <allison.henderson@oracle.com>
>> ---
>>   fs/xfs/libxfs/xfs_attr_leaf.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> same problem...
> 
> you've made the existence of "error" conditional on DEBUG, but
> then you unconditionally assign to it in the function:
> 
> 	error = xfs_attr_sf_findname(args, &sfe, NULL);
>          ASSERT(error != -EEXIST);
> 
> so this won't build.
Hmm, should I add some error handling back in then?  Maybe just
	if (error == -EEXIST)
		return;

Right after the ASSERT?  I think that makes all the compiler configs 
correct then?

Allison
> 
> -Eric
> 
>> diff --git a/fs/xfs/libxfs/xfs_attr_leaf.c b/fs/xfs/libxfs/xfs_attr_leaf.c
>> index ad7b351..db985b8 100644
>> --- a/fs/xfs/libxfs/xfs_attr_leaf.c
>> +++ b/fs/xfs/libxfs/xfs_attr_leaf.c
>> @@ -715,7 +715,10 @@ xfs_attr_shortform_add(
>>   {
>>   	struct xfs_attr_shortform	*sf;
>>   	struct xfs_attr_sf_entry	*sfe;
>> -	int				offset, size, error;
>> +	int				offset, size;
>> +#if DEBUG
>> +	int				error;
>> +#endif
>>   	struct xfs_mount		*mp;
>>   	struct xfs_inode		*dp;
>>   	struct xfs_ifork		*ifp;
>>

      reply	other threads:[~2020-07-27 22:20 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-27 20:06 [PATCH v3 0/2] xfs: Fix compiler warnings Allison Collins
2020-07-27 20:06 ` [PATCH v3 1/2] xfs: Fix compiler warning in xfs_attr_node_removename_setup Allison Collins
2020-07-27 20:06 ` [PATCH v3 2/2] xfs: Fix compiler warning in xfs_attr_shortform_add Allison Collins
2020-07-27 21:58   ` Eric Sandeen
2020-07-27 22:20     ` Allison Collins [this message]

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=15d8413e-8e50-f1dd-e5cf-c2fb16f47645@oracle.com \
    --to=allison.henderson@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@sandeen.net \
    /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;
as well as URLs for NNTP newsgroup(s).