Skip to contentSkip to conversation

acpi: apei-base: fix sparse warnings

PATCH New Garrit Franke 2 participants 3 messages Jun 10, 2020 – Jun 21, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 acpi: apei-base: fix sparse warnings

Hi all,

first off, I must admit that this is my first kernel patch, so I would love to receive any feedback. I thought that a good way to get started is to check for minor warnings in drivers, so I went ahead and fixed two of them:

"drivers/acpi/apei/apei-base.c:290:23: warning: symbol 'apei_resources_all' was not declared. Should it be static?"

"drivers/acpi/apei/apei-base.c:451:5: warning: symbol 'arch_apei_filter_addr' was not declared. Should it be static?"

Thanks for your time,
Garrit

---
 drivers/acpi/apei/apei-base.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/apei/apei-base.c +3 -2
index e358d0046..321318dcb 100644
@@ -287,7 +287,7 @@ struct apei_res {
 };
 
 /* Collect all resources requested, to avoid conflict */
-struct apei_resources apei_resources_all = {
+static struct apei_resources apei_resources_all = {
 	.iomem = LIST_HEAD_INIT(apei_resources_all.iomem),
 	.ioport = LIST_HEAD_INIT(apei_resources_all.ioport),
 };
@@ -448,8 +448,9 @@ static int apei_get_nvs_resources(struct apei_resources *resources)
 	return acpi_nvs_for_each_region(apei_get_res_callback, resources);
 }
 
-int (*arch_apei_filter_addr)(int (*func)(__u64 start, __u64 size,
+static int (*arch_apei_filter_addr)(int (*func)(__u64 start, __u64 size,
 				     void *data), void *data);
+
 static int apei_get_arch_resources(struct apei_resources *resources)
 
 {
Signature · 1 line
2.25.1
#1 lore raw
Thank you for the patch! Yet something to improve:

Hi Garrit,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[also build test ERROR on v5.7]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system. BTW, we also suggest to use '--base' option to specify the base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Garrit-Franke/acpi-apei-base-fix-sparse-warnings/20200611-003136
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>, old ones prefixed by <<):

ld: arch/x86/pci/mmconfig-shared.o: in function `pci_mmcfg_early_init':
mmconfig-shared.c:(.init.text+0x608): undefined reference to `arch_apei_filter_addr'

>> ld: mmconfig-shared.c:(.init.text+0x614): undefined reference to `arch_apei_filter_addr'

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

#2 lore raw
In reply to Garrit Franke
Thank you for the patch! Yet something to improve:

Hi Garrit,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on pm/linux-next]
[If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Garrit-Franke/acpi-apei-base-fix-sparse-warnings/20200611-003136
base:   https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git linux-next
config: x86_64-randconfig-a012-20200621 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate

All errors (new ones prefixed by >>):

ld: arch/x86/pci/mmconfig-shared.o: in function `pci_mmcfg_early_init':

>> arch/x86/pci/mmconfig-shared.c:671: undefined reference to `arch_apei_filter_addr'
>> ld: arch/x86/pci/mmconfig-shared.c:671: undefined reference to `arch_apei_filter_addr'
>> ld: arch/x86/pci/mmconfig-shared.c:671: undefined reference to `arch_apei_filter_addr'

vim +671 arch/x86/pci/mmconfig-shared.c

574a59414083df Jiang Liu  2012-06-22  661  
bb63b4219976d4 Yinghai Lu 2008-02-28  662  void __init pci_mmcfg_early_init(void)
05c58b8ac77639 Yinghai Lu 2008-02-15  663  {
574a59414083df Jiang Liu  2012-06-22  664  	if (pci_probe & PCI_PROBE_MMCONF) {
574a59414083df Jiang Liu  2012-06-22  665  		if (pci_mmcfg_check_hostbridge())
574a59414083df Jiang Liu  2012-06-22  666  			known_bridge = 1;
574a59414083df Jiang Liu  2012-06-22  667  		else
574a59414083df Jiang Liu  2012-06-22  668  			acpi_sfi_table_parse(ACPI_SIG_MCFG, pci_parse_mcfg);
bb63b4219976d4 Yinghai Lu 2008-02-28  669  		__pci_mmcfg_init(1);
d91525eb8ee6a6 Chen, Gong 2014-12-10  670  
d91525eb8ee6a6 Chen, Gong 2014-12-10 @671  		set_apei_filter();
05c58b8ac77639 Yinghai Lu 2008-02-15  672  	}
574a59414083df Jiang Liu  2012-06-22  673  }

05c58b8ac77639 Yinghai Lu 2008-02-15 674

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org