From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============3406135670552354217==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: [chrome-os:chromeos-5.10 23780/24038] sound/pci/hda/hda_codec.c:900:2: warning: function 'snd_hda_codec_device_init' might be a candidate for 'gnu_printf' format attribute Date: Fri, 03 Dec 2021 13:47:59 +0800 Message-ID: <202112031322.6vHexO2c-lkp@intel.com> List-Id: --===============3406135670552354217== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable tree: https://chromium.googlesource.com/chromiumos/third_party/kernel chr= omeos-5.10 head: 854998d0d92a6bd14eb0e423dc5eccb3cf77e31a commit: 7707f6aaf45ae60bb48e4621f1ee2bd79a787a7e [23780/24038] CHROMIUM: AL= SA: hda: Update and expose snd_hda_codec_device_init() config: x86_64-buildonly-randconfig-r006-20211203 (https://download.01.org/= 0day-ci/archive/20211203/202112031322.6vHexO2c-lkp(a)intel.com/config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce (this is a W=3D1 build): git remote add chrome-os https://chromium.googlesource.com/chromium= os/third_party/kernel git fetch --no-tags chrome-os chromeos-5.10 git checkout 7707f6aaf45ae60bb48e4621f1ee2bd79a787a7e # save the config file to linux build tree mkdir build_dir make W=3D1 O=3Dbuild_dir ARCH=3Dx86_64 SHELL=3D/bin/bash sound/pci/= hda/ tools/testing/nvdimm/ If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All warnings (new ones prefixed by >>): sound/pci/hda/hda_codec.c: In function 'snd_hda_codec_device_init': >> sound/pci/hda/hda_codec.c:900:2: warning: function 'snd_hda_codec_device= _init' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-at= tribute=3Dformat] 900 | vsprintf(name, fmt, vargs); | ^~~~~~~~ vim +900 sound/pci/hda/hda_codec.c 871 = 872 /** 873 * snd_hda_codec_device_init - allocate HDA codec device 874 * @bus: codec's parent bus 875 * @codec_addr: the codec address on the parent bus 876 * @codecp: the pointer to store the generated codec 877 * @fmt: format string for the device's name 878 * 879 * Returns newly allocated codec device or ERR_PTR() on failure. 880 */ 881 struct hda_codec * 882 snd_hda_codec_device_init(struct hda_bus *bus, unsigned int codec_ad= dr, 883 const char *fmt, ...) 884 { 885 va_list vargs; 886 char name[DEV_NAME_LEN]; 887 struct hda_codec *codec; 888 int err; 889 = 890 if (snd_BUG_ON(!bus)) 891 return ERR_PTR(-EINVAL); 892 if (snd_BUG_ON(codec_addr > HDA_MAX_CODEC_ADDRESS)) 893 return ERR_PTR(-EINVAL); 894 = 895 codec =3D kzalloc(sizeof(*codec), GFP_KERNEL); 896 if (!codec) 897 return ERR_PTR(-ENOMEM); 898 = 899 va_start(vargs, fmt); > 900 vsprintf(name, fmt, vargs); 901 va_end(vargs); 902 = 903 err =3D snd_hdac_device_init(&codec->core, &bus->core, name, codec_= addr); 904 if (err < 0) { 905 kfree(codec); 906 return ERR_PTR(err); 907 } 908 = 909 codec->bus =3D bus; 910 codec->core.type =3D HDA_DEV_LEGACY; 911 = 912 return codec; 913 } 914 EXPORT_SYMBOL_GPL(snd_hda_codec_device_init); 915 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============3406135670552354217==--