sound/pci/cmipci.c:3235:2: warning: Value stored to 'cm' is never read [clang-analyzer-deadcode.DeadStores]
From: kernel test robot
Date: Fri Nov 12 2021 - 03:27:40 EST
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@xxxxxxxxx>
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@xxxxxxxxxxxxAttachment:
.config.gz
Description: application/gzip