linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: drop duplicated bit in bitmask
@ 2018-07-19 19:53 Nicholas Mc Guire
  2018-07-20 15:14 ` Christoph Hellwig
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Mc Guire @ 2018-07-19 19:53 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jeff Layton, J. Bruce Fields, linux-fsdevel, linux-kernel,
	Nicholas Mc Guire

The definition of VALID_OPEN_FLAGS contains O_NDELAY two times which
is unnecessary. The duplication has no actual effect so this is just
a minor code cleanup and fixes a coccinelle warning.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem found by coccicheck: doublebitand.cocci
message: ./include/linux/fcntl.h:10:13-21: duplicated argument to & or |

Patch was compile tested with: x86_64_defconfig (built fs/open.c and
fs/fcntl.c)
with some sparse warnings in both cases - not related to the proposed
change though

Patch is against 4.18-rc5 (localversion-next is next-20180719)

 include/linux/fcntl.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 27dc7a6..72df1b8 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -7,7 +7,7 @@
 /* list of all valid flags for the open/openat flags argument: */
 #define VALID_OPEN_FLAGS \
 	(O_RDONLY | O_WRONLY | O_RDWR | O_CREAT | O_EXCL | O_NOCTTY | O_TRUNC | \
-	 O_APPEND | O_NDELAY | O_NONBLOCK | O_NDELAY | __O_SYNC | O_DSYNC | \
+	 O_APPEND | O_NDELAY | O_NONBLOCK | __O_SYNC | O_DSYNC | \
 	 FASYNC	| O_DIRECT | O_LARGEFILE | O_DIRECTORY | O_NOFOLLOW | \
 	 O_NOATIME | O_CLOEXEC | O_PATH | __O_TMPFILE)
 
-- 
2.1.4


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

* Re: [PATCH] fs: drop duplicated bit in bitmask
  2018-07-19 19:53 [PATCH] fs: drop duplicated bit in bitmask Nicholas Mc Guire
@ 2018-07-20 15:14 ` Christoph Hellwig
  0 siblings, 0 replies; 2+ messages in thread
From: Christoph Hellwig @ 2018-07-20 15:14 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Christoph Hellwig, Jeff Layton, J. Bruce Fields, linux-fsdevel,
	linux-kernel

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

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

end of thread, other threads:[~2018-07-20 15:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-19 19:53 [PATCH] fs: drop duplicated bit in bitmask Nicholas Mc Guire
2018-07-20 15:14 ` Christoph Hellwig

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).