All of lore.kernel.org
 help / color / mirror / Atom feed
* compile warning on master
       [not found] <CFA1367A.A6C68%andreas.dilger@intel.com>
@ 2014-05-20 23:14 ` Andreas Dilger
  2014-05-26  6:55   ` [PATCH] debugfs: fix two warning messages when compiling with LLVM (Re: compile warning on master) Zheng Liu
  0 siblings, 1 reply; 4+ messages in thread
From: Andreas Dilger @ 2014-05-20 23:14 UTC (permalink / raw)
  To: Zheng Liu; +Cc: Ext4 Developers List

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]


When compiling with LLVM, it generates the following warning in
debugfs::do_lsdel():

367 debugfs/lsdel.c:155 col 23: warning: '&&' within '||'
[-Wlogical-op-parentheses]
368:                if (lsd.free_blocks && !lsd.bad_blocks ||
369:                    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ~~
370 debugfs/lsdel.c:155 col 23: note: place parentheses around the '&&'
expression to silence this warning
371:                if (lsd.free_blocks && !lsd.bad_blocks ||
372:                                    ^
373:                    (                                 )


Unfortunately, even looking at this code and the patch that changed it,
I can't figure out what the correct parenthesis is for it.

Zheng, could you please send a patch to fix this?

Cheers, Andreas






[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* [PATCH] debugfs: fix two warning messages when compiling with LLVM (Re: compile warning on master)
  2014-05-20 23:14 ` compile warning on master Andreas Dilger
@ 2014-05-26  6:55   ` Zheng Liu
  2014-05-27 16:56     ` Lukáš Czerner
  0 siblings, 1 reply; 4+ messages in thread
From: Zheng Liu @ 2014-05-26  6:55 UTC (permalink / raw)
  To: Andreas Dilger; +Cc: Zheng Liu, Ext4 Developers List

On Tue, May 20, 2014 at 05:14:34PM -0600, Andreas Dilger wrote:
> 
> When compiling with LLVM, it generates the following warning in
> debugfs::do_lsdel():
> 
> 367 debugfs/lsdel.c:155 col 23: warning: '&&' within '||'
> [-Wlogical-op-parentheses]
> 368:                if (lsd.free_blocks && !lsd.bad_blocks ||
> 369:                    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ~~
> 370 debugfs/lsdel.c:155 col 23: note: place parentheses around the '&&'
> expression to silence this warning
> 371:                if (lsd.free_blocks && !lsd.bad_blocks ||
> 372:                                    ^
> 373:                    (                                 )
> 
> 
> Unfortunately, even looking at this code and the patch that changed it,
> I can't figure out what the correct parenthesis is for it.
> 
> Zheng, could you please send a patch to fix this?

Thanks for reporting this.  Could you please try the following patch?

Regards,
                                                - Zheng

Subject: [PATCH] debugfs: fix two warning messages when compiling with LLVM

From: Zheng Liu <wenqing.lz@taobao.com>

This commit fixes two warning messages when compiling with LLVM.

Cc: "Theodore Ts'o" <tytso@mit.edu>
Cc: Andreas Dilger <adilger@dilger.ca>
Reported-by: Andreas Dilger <adilger@dilger.ca>
Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
---
 debugfs/lsdel.c          |    2 +-
 lib/ext2fs/inline_data.c |    3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/debugfs/lsdel.c b/debugfs/lsdel.c
index 5276014..a7c30b3 100644
--- a/debugfs/lsdel.c
+++ b/debugfs/lsdel.c
@@ -152,7 +152,7 @@ void do_lsdel(int argc, char **argv)
 				goto next;
 			}
 		}
-		if (lsd.free_blocks && !lsd.bad_blocks ||
+		if ((lsd.free_blocks && !lsd.bad_blocks) ||
 		    inode.i_flags & EXT4_INLINE_DATA_FL) {
 			if (num_delarray >= max_delarray) {
 				max_delarray += 50;
diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
index 7a81da0..f318b41 100644
--- a/lib/ext2fs/inline_data.c
+++ b/lib/ext2fs/inline_data.c
@@ -280,10 +280,9 @@ static errcode_t ext2fs_inline_data_convert_dir(ext2_filsys fs, ext2_ino_t ino,
 	struct ext2_dir_entry *dir, *dir2;
 	struct ext2_dir_entry_tail *t;
 	errcode_t retval;
-	unsigned int offset;
+	unsigned int offset, rec_len;
 	int csum_size = 0;
 	int filetype = 0;
-	int rec_len;
 
 	if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
 				       EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
-- 
1.7.9.7


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

* Re: [PATCH] debugfs: fix two warning messages when compiling with LLVM (Re: compile warning on master)
  2014-05-26  6:55   ` [PATCH] debugfs: fix two warning messages when compiling with LLVM (Re: compile warning on master) Zheng Liu
@ 2014-05-27 16:56     ` Lukáš Czerner
  2014-05-27 17:21       ` Theodore Ts'o
  0 siblings, 1 reply; 4+ messages in thread
From: Lukáš Czerner @ 2014-05-27 16:56 UTC (permalink / raw)
  To: Zheng Liu; +Cc: Andreas Dilger, Zheng Liu, Ext4 Developers List

On Mon, 26 May 2014, Zheng Liu wrote:

> Date: Mon, 26 May 2014 14:55:08 +0800
> From: Zheng Liu <gnehzuil.liu@gmail.com>
> To: Andreas Dilger <adilger@dilger.ca>
> Cc: Zheng Liu <wenqing.lz@taobao.com>,
>     Ext4 Developers List <linux-ext4@vger.kernel.org>
> Subject: [PATCH] debugfs: fix two warning messages when compiling with LLVM
>     (Re: compile warning on master)
> 
> On Tue, May 20, 2014 at 05:14:34PM -0600, Andreas Dilger wrote:
> > 
> > When compiling with LLVM, it generates the following warning in
> > debugfs::do_lsdel():
> > 
> > 367 debugfs/lsdel.c:155 col 23: warning: '&&' within '||'
> > [-Wlogical-op-parentheses]
> > 368:                if (lsd.free_blocks && !lsd.bad_blocks ||
> > 369:                    ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ ~~
> > 370 debugfs/lsdel.c:155 col 23: note: place parentheses around the '&&'
> > expression to silence this warning
> > 371:                if (lsd.free_blocks && !lsd.bad_blocks ||
> > 372:                                    ^
> > 373:                    (                                 )
> > 
> > 
> > Unfortunately, even looking at this code and the patch that changed it,
> > I can't figure out what the correct parenthesis is for it.
> > 
> > Zheng, could you please send a patch to fix this?
> 
> Thanks for reporting this.  Could you please try the following patch?
> 
> Regards,
>                                                 - Zheng
> 
> Subject: [PATCH] debugfs: fix two warning messages when compiling with LLVM
> 
> From: Zheng Liu <wenqing.lz@taobao.com>
> 
> This commit fixes two warning messages when compiling with LLVM.

make sense. Thanks!

Reviewed-by: Lukas Czerner <lczerner@redhat.com>


> 
> Cc: "Theodore Ts'o" <tytso@mit.edu>
> Cc: Andreas Dilger <adilger@dilger.ca>
> Reported-by: Andreas Dilger <adilger@dilger.ca>
> Signed-off-by: Zheng Liu <wenqing.lz@taobao.com>
> ---
>  debugfs/lsdel.c          |    2 +-
>  lib/ext2fs/inline_data.c |    3 +--
>  2 files changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/debugfs/lsdel.c b/debugfs/lsdel.c
> index 5276014..a7c30b3 100644
> --- a/debugfs/lsdel.c
> +++ b/debugfs/lsdel.c
> @@ -152,7 +152,7 @@ void do_lsdel(int argc, char **argv)
>  				goto next;
>  			}
>  		}
> -		if (lsd.free_blocks && !lsd.bad_blocks ||
> +		if ((lsd.free_blocks && !lsd.bad_blocks) ||
>  		    inode.i_flags & EXT4_INLINE_DATA_FL) {
>  			if (num_delarray >= max_delarray) {
>  				max_delarray += 50;
> diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
> index 7a81da0..f318b41 100644
> --- a/lib/ext2fs/inline_data.c
> +++ b/lib/ext2fs/inline_data.c
> @@ -280,10 +280,9 @@ static errcode_t ext2fs_inline_data_convert_dir(ext2_filsys fs, ext2_ino_t ino,
>  	struct ext2_dir_entry *dir, *dir2;
>  	struct ext2_dir_entry_tail *t;
>  	errcode_t retval;
> -	unsigned int offset;
> +	unsigned int offset, rec_len;
>  	int csum_size = 0;
>  	int filetype = 0;
> -	int rec_len;
>  
>  	if (EXT2_HAS_RO_COMPAT_FEATURE(fs->super,
>  				       EXT4_FEATURE_RO_COMPAT_METADATA_CSUM))
> 

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

* Re: [PATCH] debugfs: fix two warning messages when compiling with LLVM (Re: compile warning on master)
  2014-05-27 16:56     ` Lukáš Czerner
@ 2014-05-27 17:21       ` Theodore Ts'o
  0 siblings, 0 replies; 4+ messages in thread
From: Theodore Ts'o @ 2014-05-27 17:21 UTC (permalink / raw)
  To: Lukáš Czerner
  Cc: Zheng Liu, Andreas Dilger, Zheng Liu, Ext4 Developers List

On Tue, May 27, 2014 at 06:56:33PM +0200, Lukáš Czerner wrote:
> > Subject: [PATCH] debugfs: fix two warning messages when compiling with LLVM
> > 
> > From: Zheng Liu <wenqing.lz@taobao.com>
> > 
> > This commit fixes two warning messages when compiling with LLVM.
> 
> make sense. Thanks!
> 
> Reviewed-by: Lukas Czerner <lczerner@redhat.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2014-05-27 17:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CFA1367A.A6C68%andreas.dilger@intel.com>
2014-05-20 23:14 ` compile warning on master Andreas Dilger
2014-05-26  6:55   ` [PATCH] debugfs: fix two warning messages when compiling with LLVM (Re: compile warning on master) Zheng Liu
2014-05-27 16:56     ` Lukáš Czerner
2014-05-27 17:21       ` Theodore Ts'o

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.