linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
@ 2020-09-06 22:39 Krzysztof Wilczyński
  2020-09-06 23:07 ` Matthew Wilcox
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-06 22:39 UTC (permalink / raw)
  To: Jeff Layton
  Cc: J. Bruce Fields, Al Viro, Matthew Wilcox, linux-fsdevel, Jens Axboe

The O_NDELAY flag occurs twice in the VALID_OPEN_FLAGS definition, this
change removes the duplicate.  There is no change to the functionality.

Note, that the flags O_NONBLOCK and O_NDELAY are not duplicates, as
values of these flags are platform dependent, and on platforms like
Sparc O_NONBLOCK and O_NDELAY are not the same.

This has been done that way to maintain the ABI compatibility with
Solaris since the Sparc port was first introduced.

This change resolves the following Coccinelle warning:

  include/linux/fcntl.h:11:13-21: duplicated argument to & or |

Signed-off-by: Krzysztof Wilczyński <kw@linux.com>
---
Changes in v3:
  Drop whitespace changes.  Thank you Jens!

Changes in v2:
  Update commit message and subject line wording as per review feedback.

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 7bcdcf4f6ab2..921e750843e6 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -8,7 +8,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.28.0


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

* Re: [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
  2020-09-06 22:39 [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS Krzysztof Wilczyński
@ 2020-09-06 23:07 ` Matthew Wilcox
  2020-09-07 16:46 ` Jens Axboe
  2020-09-16 19:35 ` Krzysztof Wilczyński
  2 siblings, 0 replies; 6+ messages in thread
From: Matthew Wilcox @ 2020-09-06 23:07 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Jeff Layton, J. Bruce Fields, Al Viro, linux-fsdevel, Jens Axboe

On Sun, Sep 06, 2020 at 10:39:49PM +0000, Krzysztof Wilczyński wrote:
> The O_NDELAY flag occurs twice in the VALID_OPEN_FLAGS definition, this
> change removes the duplicate.  There is no change to the functionality.
> 
> Note, that the flags O_NONBLOCK and O_NDELAY are not duplicates, as
> values of these flags are platform dependent, and on platforms like
> Sparc O_NONBLOCK and O_NDELAY are not the same.
> 
> This has been done that way to maintain the ABI compatibility with
> Solaris since the Sparc port was first introduced.
> 
> This change resolves the following Coccinelle warning:
> 
>   include/linux/fcntl.h:11:13-21: duplicated argument to & or |
> 
> Signed-off-by: Krzysztof Wilczyński <kw@linux.com>

Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org>

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

* Re: [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
  2020-09-06 22:39 [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS Krzysztof Wilczyński
  2020-09-06 23:07 ` Matthew Wilcox
@ 2020-09-07 16:46 ` Jens Axboe
  2020-09-16 19:35 ` Krzysztof Wilczyński
  2 siblings, 0 replies; 6+ messages in thread
From: Jens Axboe @ 2020-09-07 16:46 UTC (permalink / raw)
  To: Krzysztof Wilczyński, Jeff Layton
  Cc: J. Bruce Fields, Al Viro, Matthew Wilcox, linux-fsdevel

On 9/6/20 4:39 PM, Krzysztof Wilczyński wrote:
> The O_NDELAY flag occurs twice in the VALID_OPEN_FLAGS definition, this
> change removes the duplicate.  There is no change to the functionality.
> 
> Note, that the flags O_NONBLOCK and O_NDELAY are not duplicates, as
> values of these flags are platform dependent, and on platforms like
> Sparc O_NONBLOCK and O_NDELAY are not the same.
> 
> This has been done that way to maintain the ABI compatibility with
> Solaris since the Sparc port was first introduced.
> 
> This change resolves the following Coccinelle warning:
> 
>   include/linux/fcntl.h:11:13-21: duplicated argument to & or |

Reviewed-by: Jens Axboe <axboe@kernel.dk>

-- 
Jens Axboe


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

* Re: [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
  2020-09-06 22:39 [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS Krzysztof Wilczyński
  2020-09-06 23:07 ` Matthew Wilcox
  2020-09-07 16:46 ` Jens Axboe
@ 2020-09-16 19:35 ` Krzysztof Wilczyński
  2020-09-16 23:28   ` Al Viro
  2 siblings, 1 reply; 6+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-16 19:35 UTC (permalink / raw)
  To: Jeff Layton
  Cc: J. Bruce Fields, Al Viro, Matthew Wilcox, linux-fsdevel,
	Jens Axboe, Andrew Morton

[+CC Andrew]

Hello,

Thank you Matthew and Jens for review!

Andrew, do you think this trivial patch is something that could be
included?

I run Coccinelle on a regular basis as part of my build and test process
when working and this warning shows up there all the time.  I thought,
it would be nice to put it to rest.

Thank you in advance!

Krzysztof

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

* Re: [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
  2020-09-16 19:35 ` Krzysztof Wilczyński
@ 2020-09-16 23:28   ` Al Viro
  2020-09-18 16:16     ` Krzysztof Wilczyński
  0 siblings, 1 reply; 6+ messages in thread
From: Al Viro @ 2020-09-16 23:28 UTC (permalink / raw)
  To: Krzysztof Wilczyński
  Cc: Jeff Layton, J. Bruce Fields, Matthew Wilcox, linux-fsdevel,
	Jens Axboe, Andrew Morton

On Wed, Sep 16, 2020 at 09:35:00PM +0200, Krzysztof Wilczyński wrote:
> [+CC Andrew]
> 
> Hello,
> 
> Thank you Matthew and Jens for review!
> 
> Andrew, do you think this trivial patch is something that could be
> included?
> 
> I run Coccinelle on a regular basis as part of my build and test process
> when working and this warning shows up there all the time.  I thought,
> it would be nice to put it to rest.

In #work.misc, will be in -next shortly.

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

* Re: [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS
  2020-09-16 23:28   ` Al Viro
@ 2020-09-18 16:16     ` Krzysztof Wilczyński
  0 siblings, 0 replies; 6+ messages in thread
From: Krzysztof Wilczyński @ 2020-09-18 16:16 UTC (permalink / raw)
  To: Al Viro
  Cc: Jeff Layton, J. Bruce Fields, Matthew Wilcox, linux-fsdevel,
	Jens Axboe, Andrew Morton

Hello Al,

On 20-09-17 00:28:08, Al Viro wrote:
[...]
> In #work.misc, will be in -next shortly.

Thank you!

Krzysztof

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

end of thread, other threads:[~2020-09-18 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-06 22:39 [PATCH v3] fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS Krzysztof Wilczyński
2020-09-06 23:07 ` Matthew Wilcox
2020-09-07 16:46 ` Jens Axboe
2020-09-16 19:35 ` Krzysztof Wilczyński
2020-09-16 23:28   ` Al Viro
2020-09-18 16:16     ` Krzysztof Wilczyński

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