Skip to contentSkip to conversation

fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS

PATCH In review Krzysztof Wilczyński 4 participants 6 messages Sep 6, 2020 – Sep 18, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 fs: Remove duplicated flag O_NDELAY occurring twice in VALID_OPEN_FLAGS

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 |

---
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(-)
include/linux/fcntl.h +1 -1
index 7bcdcf4f6ab2..921e750843e6 100644
@@ -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)
 
Signature · 1 line
2.28.0
Reviewed-by on v3 1/1
#1 lore raw
Quoted 7 lines · Krzysztof Wilczyński

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.

Quoted 8 lines

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 on v3 1/1
#2 lore raw
In reply to Krzysztof Wilczyński
Quoted 7 lines · Krzysztof Wilczyński

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.

Quoted 6 lines

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 |

Signature · 1 line
Jens Axboe
#3 lore raw
In reply to Krzysztof Wilczyński

[+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

maintainer
#4 lore raw
Quoted 4 lines · Krzysztof Wilczyński

[+CC Andrew]

Hello,

Quoted 8 lines

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.

#5 lore raw

Hello Al,

On 20-09-17 00:28:08, Al Viro wrote:
[...]

Quoted 1 line

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

Thank you!

Krzysztof