[PATCH] fix mismatched parentheses

Jemmy Wong posted 1 patch 10 months ago
tools/include/nolibc/types.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] fix mismatched parentheses
Posted by Jemmy Wong 10 months ago
Corrects an imbalance where opening parentheses exceed closing ones.

Signed-off-by: Jemmy Wong <Jemmywong512@gmail.com>

---
 tools/include/nolibc/types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
index b26a5d0c417c..b57e054cca82 100644
--- a/tools/include/nolibc/types.h
+++ b/tools/include/nolibc/types.h
@@ -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)
-- 
2.43.0
Re: [PATCH] fix mismatched parentheses
Posted by Thomas Weißschuh 10 months ago
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)

On 2025-04-10 02:19:34+0800, Jemmy Wong wrote:
> 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")

> Signed-off-by: Jemmy Wong <Jemmywong512@gmail.com>
> 
> ---
>  tools/include/nolibc/types.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
> index b26a5d0c417c..b57e054cca82 100644
> --- a/tools/include/nolibc/types.h
> +++ b/tools/include/nolibc/types.h
> @@ -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
Re: [PATCH] fix mismatched parentheses
Posted by Jemmy Wong 10 months ago
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

> On Apr 10, 2025, at 2:30 AM, Thomas Weißschuh <linux@weissschuh.net> wrote:
> 
> 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)
> 
> On 2025-04-10 02:19:34+0800, Jemmy Wong wrote:
>> 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")
> 
>> Signed-off-by: Jemmy Wong <Jemmywong512@gmail.com>
>> 
>> ---
>> tools/include/nolibc/types.h | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/tools/include/nolibc/types.h b/tools/include/nolibc/types.h
>> index b26a5d0c417c..b57e054cca82 100644
>> --- a/tools/include/nolibc/types.h
>> +++ b/tools/include/nolibc/types.h
>> @@ -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