[PATCH 1/4] configfs: Delete semicolon from macro type_print() definition

Zijun Hu posted 4 patches 10 months, 1 week ago
There is a newer version of this series
[PATCH 1/4] configfs: Delete semicolon from macro type_print() definition
Posted by Zijun Hu 10 months, 1 week ago
From: Zijun Hu <quic_zijuhu@quicinc.com>

Macro type_print() definition ends with semicolon, so will cause
the subsequent macro invocations end with two semicolons.

Fix by deleting the semicolon from the macro definition.

Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
---
 fs/configfs/dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
index 7d10278db30d667d0ef7e1140e54961c5a440c41..0a011bdad98c492227859ff328d61aeed2071e24 100644
--- a/fs/configfs/dir.c
+++ b/fs/configfs/dir.c
@@ -970,7 +970,7 @@ static void configfs_dump_one(struct configfs_dirent *sd, int level)
 {
 	pr_info("%*s\"%s\":\n", level, " ", configfs_get_name(sd));
 
-#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n", level, " ", #_type);
+#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n", level, " ", #_type)
 	type_print(CONFIGFS_ROOT);
 	type_print(CONFIGFS_DIR);
 	type_print(CONFIGFS_ITEM_ATTR);

-- 
2.34.1
Re: [PATCH 1/4] configfs: Delete semicolon from macro type_print() definition
Posted by Breno Leitao 9 months, 4 weeks ago
Hello Zijun,

On Tue, Apr 08, 2025 at 09:26:07PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> Macro type_print() definition ends with semicolon, so will cause
> the subsequent macro invocations end with two semicolons.

where is the type_print() macro invoked today?

I haven't found any reference for it in fs/configfs/dir.c

Thanks
--breno
Re: [PATCH 1/4] configfs: Delete semicolon from macro type_print() definition
Posted by Zijun Hu 9 months, 4 weeks ago
On 2025/4/17 22:38, Breno Leitao wrote:
> Hello Zijun,
> 
> On Tue, Apr 08, 2025 at 09:26:07PM +0800, Zijun Hu wrote:
>> From: Zijun Hu <quic_zijuhu@quicinc.com>
>>
>> Macro type_print() definition ends with semicolon, so will cause
>> the subsequent macro invocations end with two semicolons.
> 
> where is the type_print() macro invoked today?
> 
> I haven't found any reference for it in fs/configfs/dir.c
> 

both its definition and invocations are within

fs/configfs/dir.c:
static void configfs_dump_one(struct configfs_dirent *sd, int level)
{
        pr_info("%*s\"%s\":\n", level, " ", configfs_get_name(sd));

#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n",
level, " ", #_type);
        type_print(CONFIGFS_ROOT);
        type_print(CONFIGFS_DIR);
        type_print(CONFIGFS_ITEM_ATTR);
        type_print(CONFIGFS_ITEM_LINK);
        type_print(CONFIGFS_USET_DIR);
        type_print(CONFIGFS_USET_DEFAULT);
        type_print(CONFIGFS_USET_DROPPING);
#undef type_print
}

configfs_dump_one() is invoked by

> Thanks
> --breno
Re: [PATCH 1/4] configfs: Delete semicolon from macro type_print() definition
Posted by Joel Becker 10 months, 1 week ago
On Tue, Apr 08, 2025 at 09:26:07PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
> 
> Macro type_print() definition ends with semicolon, so will cause
> the subsequent macro invocations end with two semicolons.
> 
> Fix by deleting the semicolon from the macro definition.
> 
> Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>

Reviewed-by: Joel Becker <jlbec@evilplan.org>

> ---
>  fs/configfs/dir.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c
> index 7d10278db30d667d0ef7e1140e54961c5a440c41..0a011bdad98c492227859ff328d61aeed2071e24 100644
> --- a/fs/configfs/dir.c
> +++ b/fs/configfs/dir.c
> @@ -970,7 +970,7 @@ static void configfs_dump_one(struct configfs_dirent *sd, int level)
>  {
>  	pr_info("%*s\"%s\":\n", level, " ", configfs_get_name(sd));
>  
> -#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n", level, " ", #_type);
> +#define type_print(_type) if (sd->s_type & _type) pr_info("%*s %s\n", level, " ", #_type)
>  	type_print(CONFIGFS_ROOT);
>  	type_print(CONFIGFS_DIR);
>  	type_print(CONFIGFS_ITEM_ATTR);
> 
> -- 
> 2.34.1
> 

-- 

"There are only two ways to live your life. One is as though nothing
 is a miracle. The other is as though everything is a miracle."
        - Albert Einstein

			http://www.jlbec.org/
			jlbec@evilplan.org