sound/ac97/bus.c:465:1: sparse: sparse: symbol 'dev_attr_vendor_id' was not declared. Should it be static?

From: kernel test robot
Date: Mon Jul 24 2023 - 21:48:19 EST


Hi Arnd,

First bad commit (maybe != root cause):

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0b5547c51827e053cc754db47d3ec3e6c2c451d2
commit: 5eab9265759e2fb042aa452931c3d06ab7ab8dae ASoC: PXA: make SND_PXA2XX_SOC_AC97 user-selectable
date: 6 months ago
config: nios2-randconfig-r072-20230723 (https://download.01.org/0day-ci/archive/20230725/202307250936.Zx4eAszV-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230725/202307250936.Zx4eAszV-lkp@xxxxxxxxx/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 <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307250936.Zx4eAszV-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> sound/ac97/bus.c:465:1: sparse: sparse: symbol 'dev_attr_vendor_id' was not declared. Should it be static?

vim +/dev_attr_vendor_id +465 sound/ac97/bus.c

74426fbff66eea Robert Jarzmik 2017-09-02 457
74426fbff66eea Robert Jarzmik 2017-09-02 458 static ssize_t vendor_id_show(struct device *dev,
74426fbff66eea Robert Jarzmik 2017-09-02 459 struct device_attribute *attr, char *buf)
74426fbff66eea Robert Jarzmik 2017-09-02 460 {
74426fbff66eea Robert Jarzmik 2017-09-02 461 struct ac97_codec_device *codec = to_ac97_device(dev);
74426fbff66eea Robert Jarzmik 2017-09-02 462
7450320ec7ab11 Takashi Iwai 2022-08-01 463 return sysfs_emit(buf, "%08x", codec->vendor_id);
74426fbff66eea Robert Jarzmik 2017-09-02 464 }
74426fbff66eea Robert Jarzmik 2017-09-02 @465 DEVICE_ATTR_RO(vendor_id);
74426fbff66eea Robert Jarzmik 2017-09-02 466

:::::: The code at line 465 was first introduced by commit
:::::: 74426fbff66eea8e8d1f42c8238c268d1e63a832 ALSA: ac97: add an ac97 bus

:::::: TO: Robert Jarzmik <robert.jarzmik@xxxxxxx>
:::::: CC: Mark Brown <broonie@xxxxxxxxxx>

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki