Skip to contentSkip to conversation

fix mismatched parentheses

PATCH In review Jemmy Wong 2 participants 3 messages Apr 9, 2025 Nolibc header file

lore
Share & tools
lore

Jemmy Wong

author
#0 lore raw

PATCH 1/1 fix mismatched parentheses

Corrects 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..b57e054cca82 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,

good catch and thanks for your patch!
There are some small formal issues with it, though. Could you fix those and send a v2?

The patch subject should start with "tools/nolibc: ", and could be a bit more specific: "fix mismatched parenthesis in minor()"

(more below)

Quoted 1 line · Jemmy Wong

Corrects an imbalance where opening parentheses exceed closing ones.

Use imperative language: "Correct an ..."

As this is a bugfix, a Fixes tag would be great.
In this case:

Fixes eba6d00d38e7 ("tools/nolibc/types: move makedev to types.h and make it a macro")
Quoted 11 lines
---
 tools/include/nolibc/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/nolibc/types.h +0 -0
index b26a5d0c417c..b57e054cca82 100644

tools/include/nolibc/types.h struct stat { · line 207

Quoted 8 lines
tools/include/nolibc/types.h +1 -1
@@ -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)

Thomas

author
#2 lore raw

Hi Thomas,

Thank you for pointing out these details.

I’m new to the community and really appreciate your advice.

I’ve addressed your feedback and will send a v2 patch in a new email shortly.

Best regards,
Jemmy

Quoted 45 lines · Thomas Weißschuh

Hi Jemmy,

good catch and thanks for your patch!
There are some small formal issues with it, though. Could you fix those and send a v2?

The patch subject should start with "tools/nolibc: ", and could be a bit more specific: "fix mismatched parenthesis in minor()"

(more below)

Quoted 1 line · Jemmy Wong

Corrects an imbalance where opening parentheses exceed closing ones.

Use imperative language: "Correct an ..."

As this is a bugfix, a Fixes tag would be great.
In this case:

Fixes eba6d00d38e7 ("tools/nolibc/types: move makedev to types.h and make it a macro")
Quoted 11 lines

---
tools/include/nolibc/types.h | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
tools/include/nolibc/types.h +0 -0
index b26a5d0c417c..b57e054cca82 100644

tools/include/nolibc/types.h struct stat { · line 207

Quoted 8 lines
tools/include/nolibc/types.h +1 -1
@@ -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)

Thomas