Skip to contentSkip to conversation

ocfs2: one more warning fix in ocfs2_file_aio_write()

PATCH New Coly Li 2 participants 3 messages Mar 25, 2010 OCFS2

lore
Share & tools
lore

Coly Li

author
#0 lore raw

PATCH 1/1 ocfs2: one more warning fix in ocfs2_file_aio_write()

This patch fixes another compiling warning in ocfs2_file_aio_write() like this,
fs/ocfs2/file.c: In function ?ocfs2_file_aio_write?:
fs/ocfs2/file.c:2026: warning: suggest parentheses around ?&&? within ?||?

---
 fs/ocfs2/file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/file.c +2 -2
index 17947dc..c4638fd 100644
@@ -2021,8 +2021,8 @@ out_dio:
 		if (ret < 0)
 			written = ret;
 
-		if (!ret && (old_size != i_size_read(inode) ||
-		    old_clusters != OCFS2_I(inode)->ip_clusters ||
+		if ((!ret) && ((old_size != i_size_read(inode)) ||
+		    (old_clusters != OCFS2_I(inode)->ip_clusters) ||
 		    has_refcount)) {
 			ret = jbd2_journal_force_commit(osb->journal->j_journal);
 			if (ret < 0)
Signature · 2 lines
Coly Li
SuSE Labs
#1 lore raw

PATCH 1/1 ocfs2: one more warning fix in ocfs2_file_aio_write()

Quoted 14 lines · Coly Li

This patch fixes another compiling warning in ocfs2_file_aio_write() like this,
fs/ocfs2/file.c: In function ?ocfs2_file_aio_write?:
fs/ocfs2/file.c:2026: warning: suggest parentheses around ?&&? within ?||?

---
 fs/ocfs2/file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/file.c +0 -0
index 17947dc..c4638fd 100644

fs/ocfs2/file.c out_dio: · line 2024

Quoted 6 lines
fs/ocfs2/file.c +1 -2
@@ -2021,8 +2021,8 @@ out_dio:
 		if (ret < 0)
 			written = ret;
 
-		if (!ret && (old_size != i_size_read(inode) ||
-		    old_clusters != OCFS2_I(inode)->ip_clusters ||
+		if ((!ret) && ((old_size != i_size_read(inode)) ||

You don't need to wrap the !ret. It's unary.

Joel

Signature · 9 lines
Life's Little Instruction Book #510

	"Count your blessings."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
author
#2 lore raw

PATCH 1/1 ocfs2: one more warning fix in ocfs2_file_aio_write()

On 2010?03?26? 04:45, Joel Becker Wrote:

Quoted 18 lines · Coly Li
Quoted 17 lines

This patch fixes another compiling warning in ocfs2_file_aio_write() like this,
fs/ocfs2/file.c: In function ?ocfs2_file_aio_write?:
fs/ocfs2/file.c:2026: warning: suggest parentheses around ?&&? within ?||?

---
 fs/ocfs2/file.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
fs/ocfs2/file.c +0 -0
index 17947dc..c4638fd 100644
@@ -2021,8 +2021,8 @@ out_dio:
 		if (ret < 0)
 			written = ret;
 
Quoted 6 lines

fs/ocfs2/file.c out_dio: · line 2024

Quoted 3 lines
fs/ocfs2/file.c +1 -2
-		if (!ret && (old_size != i_size_read(inode) ||
-		    old_clusters != OCFS2_I(inode)->ip_clusters ||
+		if ((!ret) && ((old_size != i_size_read(inode)) ||

You don't need to wrap the !ret. It's unary.

Just posted another update, and Cc to you.
Thanks for the review :-)

Signature · 2 lines
Coly Li
SuSE Labs