From: kernel test robot <yujie.liu@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: <llvm@lists.linux.dev>, <kbuild-all@lists.01.org>,
"Linux Kernel Mailing List" <linux-kernel@vger.kernel.org>
Subject: sound/pci/cmipci.c:3235:2: warning: Value stored to 'cm' is never read [clang-analyzer-deadcode.DeadStores]
Date: Fri, 12 Nov 2021 16:27:20 +0800 [thread overview]
Message-ID: <cc6383a2-cafb-ffe7-0b4f-27a310a1005c@intel.com> (raw)
In-Reply-To: <202111081332.kGZhai5n-lkp@intel.com>
[-- Attachment #1: Type: text/plain, Size: 4832 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 6b75d88fa81b122cce37ebf17428a849ccd3d0f1
commit: 87e082ad84a7e1f022be168396ff1cb93a80c557 ALSA: cmipci: Allocate resources with device-managed APIs
date: 4 months ago
config: i386-randconfig-c001-20211012 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=87e082ad84a7e1f022be168396ff1cb93a80c557
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 87e082ad84a7e1f022be168396ff1cb93a80c557
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=i386 clang-analyzer
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
clang-analyzer warnings: (new ones prefixed by >>)
>> sound/pci/cmipci.c:3235:2: warning: Value stored to 'cm' is never read [clang-analyzer-deadcode.DeadStores]
cm = card->private_data;
^ ~~~~~~~~~~~~~~~~~~
vim +/cm +3235 sound/pci/cmipci.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 3215
e23e7a14362072 Bill Pemberton 2012-12-06 3216 static int snd_cmipci_probe(struct pci_dev *pci,
^1da177e4c3f41 Linus Torvalds 2005-04-16 3217 const struct pci_device_id *pci_id)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3218 {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3219 static int dev;
2cbdb686dd8df8 Takashi Iwai 2005-11-17 3220 struct snd_card *card;
2cbdb686dd8df8 Takashi Iwai 2005-11-17 3221 struct cmipci *cm;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3222 int err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3223
^1da177e4c3f41 Linus Torvalds 2005-04-16 3224 if (dev >= SNDRV_CARDS)
^1da177e4c3f41 Linus Torvalds 2005-04-16 3225 return -ENODEV;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3226 if (! enable[dev]) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3227 dev++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3228 return -ENOENT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3229 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3230
87e082ad84a7e1 Takashi Iwai 2021-07-15 3231 err = snd_devm_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE,
87e082ad84a7e1 Takashi Iwai 2021-07-15 3232 sizeof(*cm), &card);
e58de7baf7de11 Takashi Iwai 2008-12-28 3233 if (err < 0)
e58de7baf7de11 Takashi Iwai 2008-12-28 3234 return err;
87e082ad84a7e1 Takashi Iwai 2021-07-15 @3235 cm = card->private_data;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3236
^1da177e4c3f41 Linus Torvalds 2005-04-16 3237 switch (pci->device) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 3238 case PCI_DEVICE_ID_CMEDIA_CM8738:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3239 case PCI_DEVICE_ID_CMEDIA_CM8738B:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3240 strcpy(card->driver, "CMI8738");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3241 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3242 case PCI_DEVICE_ID_CMEDIA_CM8338A:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3243 case PCI_DEVICE_ID_CMEDIA_CM8338B:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3244 strcpy(card->driver, "CMI8338");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3245 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3246 default:
^1da177e4c3f41 Linus Torvalds 2005-04-16 3247 strcpy(card->driver, "CMIPCI");
^1da177e4c3f41 Linus Torvalds 2005-04-16 3248 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3249 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3250
87e082ad84a7e1 Takashi Iwai 2021-07-15 3251 err = snd_cmipci_create(card, pci, dev);
e17a85eccfa0b7 Markus Elfring 2017-08-22 3252 if (err < 0)
87e082ad84a7e1 Takashi Iwai 2021-07-15 3253 return err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3254
e17a85eccfa0b7 Markus Elfring 2017-08-22 3255 err = snd_card_register(card);
e17a85eccfa0b7 Markus Elfring 2017-08-22 3256 if (err < 0)
87e082ad84a7e1 Takashi Iwai 2021-07-15 3257 return err;
e17a85eccfa0b7 Markus Elfring 2017-08-22 3258
^1da177e4c3f41 Linus Torvalds 2005-04-16 3259 pci_set_drvdata(pci, card);
^1da177e4c3f41 Linus Torvalds 2005-04-16 3260 dev++;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3261 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 3262 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 3263
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 38165 bytes --]
parent reply other threads:[~2021-11-12 8:27 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <202111081332.kGZhai5n-lkp@intel.com>]
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=cc6383a2-cafb-ffe7-0b4f-27a310a1005c@intel.com \
--to=yujie.liu@intel.com \
--cc=kbuild-all@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=tiwai@suse.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®