linux-next: build warning after merge of the qcom tree
Subsystems (3)
Hi all,
After merging the qcom tree, today's linux-next build (x86_64 allmodconfig) produced this warning:
drivers/soc/qcom/socinfo.c: In function 'socinfo_debugfs_init':drivers/soc/qcom/socinfo.c:323:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_x32("raw_device_number", 0400, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcom_socinfo->dbg_root,
~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.raw_device_num);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:326:2: note: here
case SOCINFO_VERSION(0, 11):
^~~~drivers/soc/qcom/socinfo.c:331:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_u32("foundry_id", 0400, qcom_socinfo->dbg_root, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.foundry_id);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:333:2: note: here
case SOCINFO_VERSION(0, 8):
^~~~drivers/soc/qcom/socinfo.c:231:2: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_file(__stringify(name), 0400, \
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcom_socinfo->dbg_root, \
~~~~~~~~~~~~~~~~~~~~~~~~~~~
info, &qcom_ ##name## _ops)
~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:336:3: note: in expansion of macro 'DEBUGFS_ADD'
DEBUGFS_ADD(info, pmic_die_rev);
^~~~~~~~~~~drivers/soc/qcom/socinfo.c:337:2: note: here
case SOCINFO_VERSION(0, 6):
^~~~drivers/soc/qcom/socinfo.c:341:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_u32("hardware_platform_subtype", 0400, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcom_socinfo->dbg_root,
~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.hw_plat_subtype);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:344:2: note: here
case SOCINFO_VERSION(0, 5):
^~~~drivers/soc/qcom/socinfo.c:348:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_u32("accessory_chip", 0400, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcom_socinfo->dbg_root,
~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.accessory_chip);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:351:2: note: here
case SOCINFO_VERSION(0, 4):
^~~~drivers/soc/qcom/socinfo.c:354:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_u32("platform_version", 0400, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcom_socinfo->dbg_root,
~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.plat_ver);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:357:2: note: here
case SOCINFO_VERSION(0, 3):
^~~~drivers/soc/qcom/socinfo.c:360:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_u32("hardware_platform", 0400, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
qcom_socinfo->dbg_root,
~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.hw_plat);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:363:2: note: here
case SOCINFO_VERSION(0, 2):
^~~~drivers/soc/qcom/socinfo.c:366:3: warning: this statement may fall through [-Wimplicit-fallthrough=]
debugfs_create_u32("raw_version", 0400, qcom_socinfo->dbg_root, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
&qcom_socinfo->info.raw_ver);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~drivers/soc/qcom/socinfo.c:368:2: note: here
case SOCINFO_VERSION(0, 1):
^~~~
Introduced by commit
9c84c1e78634 ("soc: qcom: socinfo: Expose custom attributes")
Signature · 2 lines
Cheers, Stephen Rothwell
PATCH 1/1 soc: qcom: socinfo: Annotate switch cases with fall through
Introduce fall through annotations in the switch statements of socinfo_debugfs_init() to silence compiler warnings.
--- drivers/soc/qcom/socinfo.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/soc/qcom/socinfo.c +11 -0
@@ -323,17 +323,23 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_x32 ("raw_device_number" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ): +/* Fall through */ case SOCINFO_VERSION (0 ,10 ): +/* Fall through */ case SOCINFO_VERSION (0 ,9 ): qcom_socinfo->info.foundry_id =__le32_to_cpu (info->foundry_id);debugfs_create_u32 ("foundry_id" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.foundry_id); +/* Fall through */ case SOCINFO_VERSION (0 ,8 ): +/* Fall through */ case SOCINFO_VERSION (0 ,7 ):DEBUGFS_ADD (info, pmic_model);DEBUGFS_ADD (info, pmic_die_rev); +/* Fall through */ case SOCINFO_VERSION (0 ,6 ): qcom_socinfo->info.hw_plat_subtype =__le32_to_cpu (info->hw_plat_subtype);
@@ -341,6 +347,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("hardware_platform_subtype" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat_subtype); +/* Fall through */ case SOCINFO_VERSION (0 ,5 ): qcom_socinfo->info.accessory_chip =__le32_to_cpu (info->accessory_chip);
@@ -348,23 +355,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("accessory_chip" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.accessory_chip); +/* Fall through */ case SOCINFO_VERSION (0 ,4 ): qcom_socinfo->info.plat_ver =__le32_to_cpu (info->plat_ver);debugfs_create_u32 ("platform_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.plat_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,3 ): qcom_socinfo->info.hw_plat =__le32_to_cpu (info->hw_plat);debugfs_create_u32 ("hardware_platform" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat); +/* Fall through */ case SOCINFO_VERSION (0 ,2 ): qcom_socinfo->info.raw_ver =__le32_to_cpu (info->raw_ver);debugfs_create_u32 ("raw_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,1 ):DEBUGFS_ADD (info, build_id);break ;
Signature · 1 line
2.18.0
Re: [PATCH] soc: qcom: socinfo: Annotate switch cases with fall through
Hi,
Quoted 3 lines · Bjorn Andersson
Introduce fall through annotations in the switch statements of
socinfo_debugfs_init()to silence compiler warnings.
This is enough to silence all the warnings:
drivers/soc/qcom/socinfo.c +8 -0
@@ -323,6 +323,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_x32 ("raw_device_number" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ):case SOCINFO_VERSION (0 ,10 ):case SOCINFO_VERSION (0 ,9 ):
@@ -330,10 +331,12 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("foundry_id" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.foundry_id); +/* Fall through */ case SOCINFO_VERSION (0 ,8 ):case SOCINFO_VERSION (0 ,7 ):DEBUGFS_ADD (info, pmic_model);DEBUGFS_ADD (info, pmic_die_rev); +/* Fall through */ case SOCINFO_VERSION (0 ,6 ): qcom_socinfo->info.hw_plat_subtype =__le32_to_cpu (info->hw_plat_subtype);
@@ -341,6 +344,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("hardware_platform_subtype" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat_subtype); +/* Fall through */ case SOCINFO_VERSION (0 ,5 ): qcom_socinfo->info.accessory_chip =__le32_to_cpu (info->accessory_chip);
@@ -348,23 +352,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("accessory_chip" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.accessory_chip); +/* Fall through */ case SOCINFO_VERSION (0 ,4 ): qcom_socinfo->info.plat_ver =__le32_to_cpu (info->plat_ver);debugfs_create_u32 ("platform_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.plat_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,3 ): qcom_socinfo->info.hw_plat =__le32_to_cpu (info->hw_plat);debugfs_create_u32 ("hardware_platform" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat); +/* Fall through */ case SOCINFO_VERSION (0 ,2 ): qcom_socinfo->info.raw_ver =__le32_to_cpu (info->raw_ver);debugfs_create_u32 ("raw_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,1 ):DEBUGFS_ADD (info, build_id);break ;
--
Gustavo
Quoted 72 lines
Fixes 9c84c1e78634 ("soc: qcom: socinfo: Expose custom attributes")Reported-by Stephen Rothwell <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>--- drivers/soc/qcom/socinfo.c | 11 +++++++++++ 1 file changed, 11 insertions(+)drivers/soc/qcom/socinfo.c +11
-0@@ -323,17 +323,23 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_x32 ("raw_device_number" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ): +/* Fall through */ case SOCINFO_VERSION (0 ,10 ): +/* Fall through */ case SOCINFO_VERSION (0 ,9 ): qcom_socinfo->info.foundry_id =__le32_to_cpu (info->foundry_id);debugfs_create_u32 ("foundry_id" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.foundry_id); +/* Fall through */ case SOCINFO_VERSION (0 ,8 ): +/* Fall through */ case SOCINFO_VERSION (0 ,7 ):DEBUGFS_ADD (info, pmic_model);DEBUGFS_ADD (info, pmic_die_rev); +/* Fall through */ case SOCINFO_VERSION (0 ,6 ): qcom_socinfo->info.hw_plat_subtype =__le32_to_cpu (info->hw_plat_subtype);@@ -341,6 +347,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("hardware_platform_subtype" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat_subtype); +/* Fall through */ case SOCINFO_VERSION (0 ,5 ): qcom_socinfo->info.accessory_chip =__le32_to_cpu (info->accessory_chip);@@ -348,23 +355,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("accessory_chip" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.accessory_chip); +/* Fall through */ case SOCINFO_VERSION (0 ,4 ): qcom_socinfo->info.plat_ver =__le32_to_cpu (info->plat_ver);debugfs_create_u32 ("platform_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.plat_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,3 ): qcom_socinfo->info.hw_plat =__le32_to_cpu (info->hw_plat);debugfs_create_u32 ("hardware_platform" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat); +/* Fall through */ case SOCINFO_VERSION (0 ,2 ): qcom_socinfo->info.raw_ver =__le32_to_cpu (info->raw_ver);debugfs_create_u32 ("raw_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,1 ):DEBUGFS_ADD (info, build_id);break ;
Re: [PATCH] soc: qcom: socinfo: Annotate switch cases with fall through
In reply to Bjorn AnderssonHi Bjorn,
drivers/soc/qcom/socinfo.c static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, · line 331
Quoted 9 lines · On Tue, 6 Aug 2019 18:24:57 -0700 Bjorn Andersson…
drivers/soc/qcom/socinfo.c +3
-0qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ): +/* Fall through */ case SOCINFO_VERSION (0 ,10 ): +/* Fall through */ case SOCINFO_VERSION (0 ,9 ):
I don't think you need the comment between consecutive "case"s - just where there is actual code.
Signature · 2 lines
Cheers, Stephen Rothwell
Re: [PATCH] soc: qcom: socinfo: Annotate switch cases with fall through
Quoted 4 lines · Stephen Rothwell
Hi Bjorn,
Quoted 1 line · On Tue, 6 Aug 2019 18:24:57 -0700 Bjorn Andersson…
Quoted 12 lines
drivers/soc/qcom/socinfo.c static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo, · line 331
Quoted 8 lines
drivers/soc/qcom/socinfo.c +3
-0qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ): +/* Fall through */ case SOCINFO_VERSION (0 ,10 ): +/* Fall through */ case SOCINFO_VERSION (0 ,9 ):I don't think you need the comment between consecutive "case"s - just where there is actual code.
You're right, will respin the patch.
Thanks,
Bjorn
PATCH v2 1/1 soc: qcom: socinfo: Annotate switch cases with fall through
In reply to Stephen RothwellIntroduce fall through annotations in the switch statements of socinfo_debugfs_init() to silence compiler warnings.
--- drivers/soc/qcom/socinfo.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/soc/qcom/socinfo.c +8 -0
@@ -323,6 +323,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_x32 ("raw_device_number" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ):case SOCINFO_VERSION (0 ,10 ):case SOCINFO_VERSION (0 ,9 ):
@@ -330,10 +331,12 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("foundry_id" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.foundry_id); +/* Fall through */ case SOCINFO_VERSION (0 ,8 ):case SOCINFO_VERSION (0 ,7 ):DEBUGFS_ADD (info, pmic_model);DEBUGFS_ADD (info, pmic_die_rev); +/* Fall through */ case SOCINFO_VERSION (0 ,6 ): qcom_socinfo->info.hw_plat_subtype =__le32_to_cpu (info->hw_plat_subtype);
@@ -341,6 +344,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("hardware_platform_subtype" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat_subtype); +/* Fall through */ case SOCINFO_VERSION (0 ,5 ): qcom_socinfo->info.accessory_chip =__le32_to_cpu (info->accessory_chip);
@@ -348,23 +352,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("accessory_chip" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.accessory_chip); +/* Fall through */ case SOCINFO_VERSION (0 ,4 ): qcom_socinfo->info.plat_ver =__le32_to_cpu (info->plat_ver);debugfs_create_u32 ("platform_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.plat_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,3 ): qcom_socinfo->info.hw_plat =__le32_to_cpu (info->hw_plat);debugfs_create_u32 ("hardware_platform" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat); +/* Fall through */ case SOCINFO_VERSION (0 ,2 ): qcom_socinfo->info.raw_ver =__le32_to_cpu (info->raw_ver);debugfs_create_u32 ("raw_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,1 ):DEBUGFS_ADD (info, build_id);break ;
Signature · 1 line
2.18.0
Re: [PATCH v2] soc: qcom: socinfo: Annotate switch cases with fall through
Quoted 3 lines · Bjorn Andersson
Introduce fall through annotations in the switch statements of
socinfo_debugfs_init()to silence compiler warnings.
Oops, I missed this. Thanks for fixing it!
Quoted 3 lines
Fixes 9c84c1e78634 ("soc: qcom: socinfo: Expose custom attributes")Reported-by Stephen Rothwell <[email protected]>Signed-off-by Bjorn Andersson <[email protected]>
Quoted 68 lines
--- drivers/soc/qcom/socinfo.c | 8 ++++++++ 1 file changed, 8 insertions(+)drivers/soc/qcom/socinfo.c +8
-1@@ -323,6 +323,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_x32 ("raw_device_number" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_device_num); +/* Fall through */ case SOCINFO_VERSION (0 ,11 ):case SOCINFO_VERSION (0 ,10 ):case SOCINFO_VERSION (0 ,9 ):@@ -330,10 +331,12 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("foundry_id" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.foundry_id); +/* Fall through */ case SOCINFO_VERSION (0 ,8 ):case SOCINFO_VERSION (0 ,7 ):DEBUGFS_ADD (info, pmic_model);DEBUGFS_ADD (info, pmic_die_rev); +/* Fall through */ case SOCINFO_VERSION (0 ,6 ): qcom_socinfo->info.hw_plat_subtype =__le32_to_cpu (info->hw_plat_subtype);@@ -341,6 +344,7 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("hardware_platform_subtype" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat_subtype); +/* Fall through */ case SOCINFO_VERSION (0 ,5 ): qcom_socinfo->info.accessory_chip =__le32_to_cpu (info->accessory_chip);@@ -348,23 +352,27 @@ static void socinfo_debugfs_init(struct qcom_socinfo *qcom_socinfo,debugfs_create_u32 ("accessory_chip" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.accessory_chip); +/* Fall through */ case SOCINFO_VERSION (0 ,4 ): qcom_socinfo->info.plat_ver =__le32_to_cpu (info->plat_ver);debugfs_create_u32 ("platform_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.plat_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,3 ): qcom_socinfo->info.hw_plat =__le32_to_cpu (info->hw_plat);debugfs_create_u32 ("hardware_platform" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.hw_plat); +/* Fall through */ case SOCINFO_VERSION (0 ,2 ): qcom_socinfo->info.raw_ver =__le32_to_cpu (info->raw_ver);debugfs_create_u32 ("raw_version" ,0400 , qcom_socinfo->dbg_root, &qcom_socinfo->info.raw_ver); +/* Fall through */ case SOCINFO_VERSION (0 ,1 ):DEBUGFS_ADD (info, build_id);break ; --2.18.0