coresight: Make current W=1 warnings default
v3 cover coresight: Make current W=1 warnings default
Changes since v2:
* Split code and Makefile changes
* Add a fix for a comment warning in etm3x
* Add some sparse checker fixes in coresight-cfg-afdo.c
* Fix the 0 instead of NULL warnings reported by kernel test robot
James Clark (4):
coresight: Fix uninitialized struct warnings
coresight: etm3x: Fix build warning
coresight: Fix undeclared variable warnings from sparse checker
coresight: Make current W=1 warnings default
drivers/hwtracing/coresight/Makefile | 20 +++++++++++++++++++ .../hwtracing/coresight/coresight-cfg-afdo.c | 1 + .../hwtracing/coresight/coresight-cti-core.c | 2 +- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- .../coresight/coresight-etm3x-core.c | 4 ++-- .../coresight/coresight-etm4x-core.c | 2 +- .../hwtracing/coresight/coresight-funnel.c | 4 ++-- .../coresight/coresight-replicator.c | 2 +- drivers/hwtracing/coresight/coresight-stm.c | 2 +- .../hwtracing/coresight/coresight-tmc-core.c | 2 +- drivers/hwtracing/coresight/coresight-tpda.c | 2 +- drivers/hwtracing/coresight/coresight-tpdm.c | 2 +- drivers/hwtracing/coresight/coresight-tpiu.c | 2 +- drivers/hwtracing/coresight/ultrasoc-smb.c | 2 +- 14 files changed, 35 insertions(+), 14 deletions(-)
Signature · 1 line
2.34.1
PATCH v3 1/4 coresight: Fix uninitialized struct warnings
These warnings would be hit with the following W=1 build change so initialize all structs properly.
--- drivers/hwtracing/coresight/coresight-cti-core.c | 2 +- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- drivers/hwtracing/coresight/coresight-etm3x-core.c | 2 +- drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +- drivers/hwtracing/coresight/coresight-funnel.c | 4 ++-- drivers/hwtracing/coresight/coresight-replicator.c | 2 +- drivers/hwtracing/coresight/coresight-stm.c | 2 +- drivers/hwtracing/coresight/coresight-tmc-core.c | 2 +- drivers/hwtracing/coresight/coresight-tpda.c | 2 +- drivers/hwtracing/coresight/coresight-tpdm.c | 2 +- drivers/hwtracing/coresight/coresight-tpiu.c | 2 +- drivers/hwtracing/coresight/ultrasoc-smb.c | 2 +- 12 files changed, 13 insertions(+), 13 deletions(-)
drivers/hwtracing/coresight/coresight-cti-core.c +1 -1
@@ -974,7 +974,7 @@ static const struct amba_id cti_ids[] = {CS_AMBA_ID (0x000bb9aa ),/* CTI - C-A73 */ CS_AMBA_UCI_ID (0x000bb9da , uci_id_cti),/* CTI - C-A35 */ CS_AMBA_UCI_ID (0x000bb9ed , uci_id_cti),/* Coresight CTI (SoC 600) */ - { 0, 0}, + { 0, 0, NULL }, };MODULE_DEVICE_TABLE (amba, cti_ids);
drivers/hwtracing/coresight/coresight-etb10.c +1 -1
@@ -837,7 +837,7 @@ static const struct amba_id etb_ids[] = { .id = 0x000bb907, .mask = 0x000fffff, }, - { 0, 0}, + { 0, 0, NULL }, };MODULE_DEVICE_TABLE (amba, etb_ids);
drivers/hwtracing/coresight/coresight-etm3x-core.c +1 -1
@@ -1003,7 +1003,7 @@ static const struct amba_id etm_ids[] = {CS_AMBA_ID_DATA (0x000bb95f ,"PTM 1.1" ),/* PTM 1.1 Qualcomm */ CS_AMBA_ID_DATA (0x000b006f ,"PTM 1.1" ), - { 0, 0}, + { 0, 0, NULL}, };MODULE_DEVICE_TABLE (amba, etm_ids);
drivers/hwtracing/coresight/coresight-etm4x-core.c +1 -1
@@ -2390,7 +2390,7 @@ static const struct of_device_id etm4_sysreg_match[] = {#ifdef CONFIG_ACPI static const struct acpi_device_id etm4x_acpi_ids[] = { - {"ARMHC500" ,0 },/* ARM CoreSight ETM4x */ + {"ARMHC500" ,0 ,0 ,0 },/* ARM CoreSight ETM4x */ {} };MODULE_DEVICE_TABLE (acpi, etm4x_acpi_ids);
drivers/hwtracing/coresight/coresight-funnel.c +2 -2
@@ -350,7 +350,7 @@ MODULE_DEVICE_TABLE(of, static_funnel_match);#ifdef CONFIG_ACPI static const struct acpi_device_id static_funnel_ids[] = { - {"ARMHC9FE" ,0 }, + {"ARMHC9FE" ,0 ,0 ,0 }, {}, };
@@ -391,7 +391,7 @@ static const struct amba_id dynamic_funnel_ids[] = { .id = 0x000bb9eb, .mask = 0x000fffff, }, - { 0, 0}, + { 0, 0, NULL }, };MODULE_DEVICE_TABLE (amba, dynamic_funnel_ids);
drivers/hwtracing/coresight/coresight-replicator.c +1 -1
@@ -363,7 +363,7 @@ MODULE_DEVICE_TABLE(of, static_replicator_match);#ifdef CONFIG_ACPI static const struct acpi_device_id static_replicator_acpi_ids[] = { - {"ARMHC985" ,0 },/* ARM CoreSight Static Replicator */ + {"ARMHC985" ,0 ,0 ,0 },/* ARM CoreSight Static Replicator */ {} };
drivers/hwtracing/coresight/coresight-stm.c +1 -1
@@ -950,7 +950,7 @@ static const struct dev_pm_ops stm_dev_pm_ops = {static const struct amba_id stm_ids[] = {CS_AMBA_ID_DATA (0x000bb962 ,"STM32" ),CS_AMBA_ID_DATA (0x000bb963 ,"STM500" ), - {0 ,0 }, + {0 ,0 ,NULL }, };MODULE_DEVICE_TABLE (amba, stm_ids);
drivers/hwtracing/coresight/coresight-tmc-core.c +1 -1
@@ -594,7 +594,7 @@ static const struct amba_id tmc_ids[] = {CS_AMBA_ID (0x000bb9e9 ),/* Coresight SoC 600 TMC-ETF */ CS_AMBA_ID (0x000bb9ea ), - { 0, 0}, + { 0, 0, NULL }, };MODULE_DEVICE_TABLE (amba, tmc_ids);
drivers/hwtracing/coresight/coresight-tpda.c +1 -1
@@ -300,7 +300,7 @@ static struct amba_id tpda_ids[] = { .id = 0x000f0f00, .mask = 0x000fff00, }, - { 0, 0}, + { 0, 0, NULL }, }; static struct amba_driver tpda_driver = {
drivers/hwtracing/coresight/coresight-tpdm.c +1 -1
@@ -933,7 +933,7 @@ static struct amba_id tpdm_ids[] = { .id = 0x000f0e00, .mask = 0x000fff00, }, - { 0, 0}, + { 0, 0, NULL }, }; static struct amba_driver tpdm_driver = {
drivers/hwtracing/coresight/coresight-tpiu.c +1 -1
@@ -218,7 +218,7 @@ static const struct amba_id tpiu_ids[] = { .id = 0x000bb9e7, .mask = 0x000fffff, }, - { 0, 0}, + { 0, 0, NULL }, };MODULE_DEVICE_TABLE (amba, tpiu_ids);
drivers/hwtracing/coresight/ultrasoc-smb.c +1 -1
@@ -586,7 +586,7 @@ static void smb_remove(struct platform_device *pdev)#ifdef CONFIG_ACPI static const struct acpi_device_id ultrasoc_smb_acpi_match[] = { - {"HISI03A1" ,0 }, + {"HISI03A1" ,0 ,0 ,0 }, {} };MODULE_DEVICE_TABLE (acpi, ultrasoc_smb_acpi_match);
Signature · 1 line
2.34.1
PATCH v3 2/4 coresight: etm3x: Fix build warning
In reply to James ClarkThe missing * in the comment block causes the following warning, so fix it:
hwtracing/coresight/coresight-etm3x-core.c:118: warning: bad line:
--- drivers/hwtracing/coresight/coresight-etm3x-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm3x-core.c +1 -1
@@ -115,7 +115,7 @@ static void etm_clr_pwrup(struct etm_drvdata *drvdata)* * Basically the same as @coresight_timeout except for the register access * method where we have to account for CP14 configurations. - +* * Return: 0 as soon as the bit has taken the desired state or -EAGAIN if * TIMEOUT_US has elapsed, which ever happens first. */
Signature · 1 line
2.34.1
PATCH v3 3/4 coresight: Fix undeclared variable warnings from sparse checker
In reply to James ClarkIncluding the header with the declarations fixes the following warning with a C=1 build:
coresight-cfg-afdo.c:102:27: warning: symbol 'strobe_etm4x' was not declared. Should it be static? coresight-cfg-afdo.c:141:26: warning: symbol 'afdo_etm4x' was not declared. Should it be static?
--- drivers/hwtracing/coresight/coresight-cfg-afdo.c | 1 + 1 file changed, 1 insertion(+)
drivers/hwtracing/coresight/coresight-cfg-afdo.c +1 -0
@@ -9,6 +9,7 @@/* ETMv4 includes and features */ #if IS_ENABLED (CONFIG_CORESIGHT_SOURCE_ETM4X )#include "coresight-etm4x-cfg.h" +#include "coresight-cfg-preload.h" /* preload configurations and features */
Signature · 1 line
2.34.1
PATCH v3 4/4 coresight: Make current W=1 warnings default
In reply to James ClarkSimilarly to drivers/gpu/drm/amd/amdgpu/Makefile and fs/btrfs/Makefile, copy the current set of W=1 warnings from Makefile.extrawarn to the coresight makefile to make them default. Unfortunately there is no easy way to do this without copying.
In addition to the default set of warnings, add -Wno-sign-compare to disable that warning. That's because Makefile.extrawarn does some extra steps to disable some -Wextra warnings unless W=2 or W=3 are used. That's the only one that's needed for Coresight, so disable it.
--- drivers/hwtracing/coresight/Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+)
drivers/hwtracing/coresight/Makefile +20 -0
@@ -2,6 +2,26 @@ # # Makefile for CoreSight drivers. # + +# Current W=1 warnings +subdir-ccflags-y += -Wextra -Wunused -Wno-unused-parameter +subdir-ccflags-y += -Wmissing-declarations +subdir-ccflags-y += -Wmissing-format-attribute +subdir-ccflags-y += -Wmissing-prototypes +subdir-ccflags-y += -Wold-style-definition +subdir-ccflags-y += -Wmissing-include-dirs +subdir-ccflags-y += -Wno-sign-compare +condflags := \ + $(call cc-option, -Wrestrict) \ + $(call cc-option, -Wunused-but-set-variable) \ + $(call cc-option, -Wunused-const-variable) \ + $(call cc-option, -Wpacked-not-aligned) \ + $(call cc-option, -Wformat-overflow) \ + $(call cc-option, -Wformat-truncation) \ + $(call cc-option, -Wstringop-overflow) \ + $(call cc-option, -Wstringop-truncation) +subdir-ccflags-y += $(condflags) + obj-$(CONFIG_CORESIGHT) += coresight.o coresight-y := coresight-core.o coresight-etm-perf.o coresight-platform.o \ coresight-sysfs.o coresight-syscfg.o coresight-config.o \
Signature · 1 line
2.34.1
Suzuki K Poulose
maintainerQuoted 7 lines · James Clark
Changes since v2:
* Split code and
Makefilechanges
* Add a fix for a comment warning in etm3x
* Add some sparse checker fixes incoresight-cfg-afdo.c
* Fix the 0 instead of NULL warnings reported by kernel test robot
Quoted 5 lines
James Clark (4):
coresight: Fix uninitialized struct warnings
coresight: etm3x: Fix build warning
coresight: Fix undeclared variable warnings from sparse checker
coresight: Make current W=1 warnings default
Apologies for the delay, this is now in my queue for next.
git://git.kernel.org/pub/scm/linux/kernel/git/coresight/linux.git for-next/queue
Suzuki
Suzuki K Poulose
maintainerQuoted 8 lines · James Clark
Changes since v2:
* Split code and
Makefilechanges
* Add a fix for a comment warning in etm3x
* Add some sparse checker fixes incoresight-cfg-afdo.c
* Fix the 0 instead of NULL warnings reported by kernel test robot[...]
Now moved to coresight next branch, thanks!
[1/4] coresight: Fix uninitialized struct warnings
https://git.kernel.org/coresight/c/8a519235c3c3 [2/4] coresight: etm3x: Fix build warning https://git.kernel.org/coresight/c/54daf07e6332 [3/4] coresight: Fix undeclared variable warnings from sparse checker https://git.kernel.org/coresight/c/a7195f3f9383 [4/4] coresight: Make current W=1 warnings default https://git.kernel.org/coresight/c/d999c7dd5279
Best regards,
Signature · 1 line
Suzuki K Poulose <[email protected]>