All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
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	[thread overview]
Message-ID: <202112031322.6vHexO2c-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2906 bytes --]

tree:   https://chromium.googlesource.com/chromiumos/third_party/kernel chromeos-5.10
head:   854998d0d92a6bd14eb0e423dc5eccb3cf77e31a
commit: 7707f6aaf45ae60bb48e4621f1ee2bd79a787a7e [23780/24038] CHROMIUM: ALSA: 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=1 build):
        git remote add chrome-os https://chromium.googlesource.com/chromiumos/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=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash sound/pci/hda/ tools/testing/nvdimm/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

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-attribute=format]
     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_addr,
   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 = 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 = 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 = bus;
   910		codec->core.type = 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

                 reply	other threads:[~2021-12-03  5:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202112031322.6vHexO2c-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.