Skip to contentSkip to conversation

tools/nolibc/types.h: fix mismatched parenthesis in minor()

PATCH Superseded Jemmy Wong 3 participants 4 messages Apr 9, 2025 – Apr 10, 2025 Nolibc header file

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Jemmy Wong

author
#0 lore raw

PATCH v2 1/1 tools/nolibc/types.h: fix mismatched parenthesis in minor()

Fix an imbalance where opening parentheses exceed closing ones.

---
 tools/include/nolibc/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/nolibc/types.h +1 -1
index b26a5d0c417c..32d0929c633b 100644
@@ -201,7 +201,7 @@ struct stat {
 /* WARNING, it only deals with the 4096 first majors and 256 first minors */
 #define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))
 #define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
-#define minor(dev) ((unsigned int)(((dev) & 0xff))
+#define minor(dev) ((unsigned int)((dev) & 0xff))
 
 #ifndef offsetof
 #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD)
Signature · 1 line
2.43.0
#1 lore raw

Hi Jemmy,

Quoted 1 line · Jemmy Wong

Fix an imbalance where opening parentheses exceed closing ones.

Thanks! The patch looks good and I will pick it up soonish.

One note: When sending new revisions of patches, please always include a changelog of all differences in the new revision.
I can also recommend the b4 tool for taking care of many workflow tasks.

https://b4.docs.kernel.org/en/latest/

Quoted 21 lines
---
 tools/include/nolibc/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/nolibc/types.h +1 -1
index b26a5d0c417c..32d0929c633b 100644
@@ -201,7 +201,7 @@ struct stat {
 /* WARNING, it only deals with the 4096 first majors and 256 first minors */
 #define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))
 #define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
-#define minor(dev) ((unsigned int)(((dev) & 0xff))
+#define minor(dev) ((unsigned int)((dev) & 0xff))
 
 #ifndef offsetof
 #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD)
Signature · 1 line
2.43.0
#3 lore raw
In reply to Jemmy Wong

Hi Jemmy,

I fear this needs another revision.
Your name/email of the mail sender is not identical to the one in the Signed-off-by line.
Also the Fixes tag from the v1 feedback is missing.
Now that Willy gave you an Ack, that should also be in your trailers block.
The correct order is:

Fixes:
Signed-off-by:
Acked-by:

Please resend a v3.

Thomas

Quoted 23 lines · Jemmy Wong

Fix an imbalance where opening parentheses exceed closing ones.

---
 tools/include/nolibc/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/nolibc/types.h +1 -1
index b26a5d0c417c..32d0929c633b 100644
@@ -201,7 +201,7 @@ struct stat {
 /* WARNING, it only deals with the 4096 first majors and 256 first minors */
 #define makedev(major, minor) ((dev_t)((((major) & 0xfff) << 8) | ((minor) & 0xff)))
 #define major(dev) ((unsigned int)(((dev) >> 8) & 0xfff))
-#define minor(dev) ((unsigned int)(((dev) & 0xff))
+#define minor(dev) ((unsigned int)((dev) & 0xff))
 
 #ifndef offsetof
 #define offsetof(TYPE, FIELD) ((size_t) &((TYPE *)0)->FIELD)
Signature · 1 line
2.43.0