coresight: Make current W=1 warnings default
PATCH v2 1/1 coresight: Make current W=1 warnings default
Similarly 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.
Although a W=1 currently works for Coresight, because we're not disabling all of the -Wextra warnings that Makefile.extrawarn does, a few struct initialiser warnings need to be fixed, so fix those in the code rather than disabling even more warnings.
---
Changes since V1:
* Fix arm32 build by fixing struct initialiser in coresight-etm3x-core.c
drivers/hwtracing/coresight/Makefile | 20 +++++++++++++++++++ .../hwtracing/coresight/coresight-cti-core.c | 2 +- drivers/hwtracing/coresight/coresight-etb10.c | 2 +- .../coresight/coresight-etm3x-core.c | 2 +- .../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 +- 13 files changed, 33 insertions(+), 13 deletions(-)
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 \
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, 0 }, };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
@@ -2392,7 +2392,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
@@ -351,7 +351,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 }, {}, };
@@ -392,7 +392,7 @@ static const struct amba_id dynamic_funnel_ids[] = { .id = 0x000bb9eb, .mask = 0x000fffff, }, - { 0, 0}, + { 0, 0, 0 }, };MODULE_DEVICE_TABLE (amba, dynamic_funnel_ids);
drivers/hwtracing/coresight/coresight-replicator.c +1 -1
@@ -364,7 +364,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, 0 }, }; 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
@@ -626,7 +626,7 @@ static int 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
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi James,
kernel test robot noticed the following build warnings:
[auto build test WARNING on atorgue-stm32/stm32-next]
[also build test WARNING on soc/for-next linus/master v6.7-rc1 next-20231117] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/James-Clark/coresight-Make-current-W-1-warnings-default/20231116-004818 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next patch link: https://lore.kernel.org/r/20231115162834.355598-1-james.clark%40arm.com patch subject: [PATCH v2] coresight: Make current W=1 warnings default config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231117/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20231117/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/hwtracing/coresight/coresight-tpdm.c:242:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-tpdm.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-funnel.c:395:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-funnel.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-etb10.c:840:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-etb10.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
vim +242 drivers/hwtracing/coresight/coresight-tpdm.c
232
233 /*
234 * Different TPDM has different periph id.
235 * The difference is 0-7 bits' value. So ignore 0-7 bits.
236 */
237 static struct amba_id tpdm_ids[] = {
238 {
239 .id = 0x000f0e00,
240 .mask = 0x000fff00,
241 },
> 242 { 0, 0, 0 }, 243 };
244
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi James,
kernel test robot noticed the following build warnings:
[auto build test WARNING on atorgue-stm32/stm32-next]
[also build test WARNING on linus/master v6.7-rc4 next-20231204] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/James-Clark/coresight-Make-current-W-1-warnings-default/20231116-004818 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next patch link: https://lore.kernel.org/r/20231115162834.355598-1-james.clark%40arm.com patch subject: [PATCH v2] coresight: Make current W=1 warnings default config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231205/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20231205/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/hwtracing/coresight/coresight-etb10.c:840:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-etb10.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-funnel.c:395:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-funnel.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-tpdm.c:242:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-tpdm.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
vim +840 drivers/hwtracing/coresight/coresight-etb10.c
834
835 static const struct amba_id etb_ids[] = {
836 {
837 .id = 0x000bb907,
838 .mask = 0x000fffff,
839 },
> 840 { 0, 0, 0 }, 841 };
842
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 44 lines · kernel test robot
Hi James,
kernel test robot noticed the following build warnings:
[auto build test WARNING on atorgue-stm32/stm32-next]
[also build test WARNING on linus/master v6.7-rc4 next-20231204] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]url: https://github.com/intel-lab-lkp/linux/commits/James-Clark/coresight-Make-current-W-1-warnings-default/20231116-004818 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next patch link: https://lore.kernel.org/r/20231115162834.355598-1-james.clark%40arm.com patch subject: [PATCH v2] coresight: Make current W=1 warnings default config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231205/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20231205/[email protected]/reproduce)If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/sparse warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/hwtracing/coresight/coresight-etb10.c:840:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-etb10.c: note: in included file (throughinclude/linux/mmzone.h,include/linux/gfp.h,include/linux/xarray.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
--Quoted 1 line
Quoted 1 line
drivers/hwtracing/coresight/coresight-funnel.c:395:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-funnel.c: note: in included file (throughinclude/linux/mmzone.h,include/linux/gfp.h,include/linux/slab.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
--Quoted 1 line
Quoted 1 line
drivers/hwtracing/coresight/coresight-tpdm.c:242:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-tpdm.c: note: in included file (throughinclude/linux/mmzone.h,include/linux/gfp.h,include/linux/xarray.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to falsevim +840
drivers/hwtracing/coresight/coresight-etb10.c834 835 static const struct amba_id etb_ids[] = { 836 { 837 .id = 0x000bb907, 838 .mask = 0x000fffff, 839 },
Quoted 4 lines
Quoted 1 line
840 { 0, 0, 0 },
841 }; 842
This should already be fixed in V3 here:
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi James,
kernel test robot noticed the following build warnings:
[auto build test WARNING on atorgue-stm32/stm32-next]
[also build test WARNING on soc/for-next linus/master v6.7-rc4 next-20231208] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/James-Clark/coresight-Make-current-W-1-warnings-default/20231116-004818 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next patch link: https://lore.kernel.org/r/20231115162834.355598-1-james.clark%40arm.com patch subject: [PATCH v2] coresight: Make current W=1 warnings default config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231208/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20231208/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/hwtracing/coresight/coresight-tpdm.c:242:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-tpdm.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-etb10.c:840:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-etb10.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-funnel.c:395:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-funnel.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
vim +242 drivers/hwtracing/coresight/coresight-tpdm.c
232
233 /*
234 * Different TPDM has different periph id.
235 * The difference is 0-7 bits' value. So ignore 0-7 bits.
236 */
237 static struct amba_id tpdm_ids[] = {
238 {
239 .id = 0x000f0e00,
240 .mask = 0x000fff00,
241 },
> 242 { 0, 0, 0 }, 243 };
244
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi James,
kernel test robot noticed the following build warnings:
[auto build test WARNING on atorgue-stm32/stm32-next]
[also build test WARNING on soc/for-next linus/master v6.7-rc5 next-20231214] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/James-Clark/coresight-Make-current-W-1-warnings-default/20231116-004818 base: https://git.kernel.org/pub/scm/linux/kernel/git/atorgue/stm32.git stm32-next patch link: https://lore.kernel.org/r/20231115162834.355598-1-james.clark%40arm.com patch subject: [PATCH v2] coresight: Make current W=1 warnings default config: arm-randconfig-r131-20231117 (https://download.01.org/0day-ci/archive/20231215/[email protected]/config) compiler: arm-linux-gnueabi-gcc (GCC) 13.2.0 reproduce: (https://download.01.org/0day-ci/archive/20231215/[email protected]/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
sparse warnings: (new ones prefixed by >>)
>> drivers/hwtracing/coresight/coresight-tpdm.c:242:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-tpdm.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-etb10.c:840:17: sparse: sparse: Using plain integer as NULL pointer drivers/hwtracing/coresight/coresight-etb10.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/xarray.h, ...): include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false -- >> drivers/hwtracing/coresight/coresight-funnel.c:395:17: sparse: sparse: Using plain integer as NULL pointer
drivers/hwtracing/coresight/coresight-funnel.c: note: in included file (through include/linux/mmzone.h, include/linux/gfp.h, include/linux/slab.h, ...):
include/linux/page-flags.h:242:46: sparse: sparse: self-comparison always evaluates to false
vim +242 drivers/hwtracing/coresight/coresight-tpdm.c
232
233 /*
234 * Different TPDM has different periph id.
235 * The difference is 0-7 bits' value. So ignore 0-7 bits.
236 */
237 static struct amba_id tpdm_ids[] = {
238 {
239 .id = 0x000f0e00,
240 .mask = 0x000fff00,
241 },
> 242 { 0, 0, 0 }, 243 };
244
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki