[linux-next:pending-fixes 483/519] drivers/mtd/nand/raw/r852.c:874:24: warning: variable 'dev' is uninitialized when used here

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git pending-fixes
head:   40cb4fecf2509da231deb989f67bca024e950981
commit: a9b0cb5780b96d0070401be281b532a6a74c19ea [483/519] mtd: rawnand: r852: Move the ECC initialization to ->attach_chip()
config: x86_64-randconfig-r006-20201119 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 3ded927cf80ac519f9f9c4664fef08787f7c537d)
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
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=a9b0cb5780b96d0070401be281b532a6a74c19ea
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next pending-fixes
        git checkout a9b0cb5780b96d0070401be281b532a6a74c19ea
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

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

All warnings (new ones prefixed by >>):

>> drivers/mtd/nand/raw/r852.c:874:24: warning: variable 'dev' is uninitialized when used here [-Wuninitialized]
           nand_controller_init(&dev->controller);
                                 ^~~
   drivers/mtd/nand/raw/r852.c:847:25: note: initialize the variable 'dev' to silence this warning
           struct r852_device *dev;
                                  ^
                                   = NULL
   1 warning generated.

vim +/dev +874 drivers/mtd/nand/raw/r852.c

   842	
   843	static int  r852_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
   844	{
   845		int error;
   846		struct nand_chip *chip;
   847		struct r852_device *dev;
   848	
   849		/* pci initialization */
   850		error = pci_enable_device(pci_dev);
   851	
   852		if (error)
   853			goto error1;
   854	
   855		pci_set_master(pci_dev);
   856	
   857		error = dma_set_mask(&pci_dev->dev, DMA_BIT_MASK(32));
   858		if (error)
   859			goto error2;
   860	
   861		error = pci_request_regions(pci_dev, DRV_NAME);
   862	
   863		if (error)
   864			goto error3;
   865	
   866		error = -ENOMEM;
   867	
   868		/* init nand chip, but register it only on card insert */
   869		chip = kzalloc(sizeof(struct nand_chip), GFP_KERNEL);
   870	
   871		if (!chip)
   872			goto error4;
   873	
 > 874		nand_controller_init(&dev->controller);
   875		dev->controller.ops = &r852_ops;
   876		chip->controller = &dev->controller;
   877	
   878		/* commands */
   879		chip->legacy.cmd_ctrl = r852_cmdctl;
   880		chip->legacy.waitfunc = r852_wait;
   881		chip->legacy.dev_ready = r852_ready;
   882	
   883		/* I/O */
   884		chip->legacy.read_byte = r852_read_byte;
   885		chip->legacy.read_buf = r852_read_buf;
   886		chip->legacy.write_buf = r852_write_buf;
   887	
   888		/* init our device structure */
   889		dev = kzalloc(sizeof(struct r852_device), GFP_KERNEL);
   890	
   891		if (!dev)
   892			goto error5;
   893	
   894		nand_set_controller_data(chip, dev);
   895		dev->chip = chip;
   896		dev->pci_dev = pci_dev;
   897		pci_set_drvdata(pci_dev, dev);
   898	
   899		dev->bounce_buffer = dma_alloc_coherent(&pci_dev->dev, R852_DMA_LEN,
   900			&dev->phys_bounce_buffer, GFP_KERNEL);
   901	
   902		if (!dev->bounce_buffer)
   903			goto error6;
   904	
   905	
   906		error = -ENODEV;
   907		dev->mmio = pci_ioremap_bar(pci_dev, 0);
   908	
   909		if (!dev->mmio)
   910			goto error7;
   911	
   912		error = -ENOMEM;
   913		dev->tmp_buffer = kzalloc(SM_SECTOR_SIZE, GFP_KERNEL);
   914	
   915		if (!dev->tmp_buffer)
   916			goto error8;
   917	
   918		init_completion(&dev->dma_done);
   919	
   920		dev->card_workqueue = create_freezable_workqueue(DRV_NAME);
   921	
   922		if (!dev->card_workqueue)
   923			goto error9;
   924	
   925		INIT_DELAYED_WORK(&dev->card_detect_work, r852_card_detect_work);
   926	
   927		/* shutdown everything - precation */
   928		r852_engine_disable(dev);
   929		r852_disable_irqs(dev);
   930	
   931		r852_dma_test(dev);
   932	
   933		dev->irq = pci_dev->irq;
   934		spin_lock_init(&dev->irqlock);
   935	
   936		dev->card_detected = 0;
   937		r852_card_update_present(dev);
   938	
   939		/*register irq handler*/
   940		error = -ENODEV;
   941		if (request_irq(pci_dev->irq, &r852_irq, IRQF_SHARED,
   942				  DRV_NAME, dev))
   943			goto error10;
   944	
   945		/* kick initial present test */
   946		queue_delayed_work(dev->card_workqueue,
   947			&dev->card_detect_work, 0);
   948	
   949	
   950		pr_notice("driver loaded successfully\n");
   951		return 0;
   952	
   953	error10:
   954		destroy_workqueue(dev->card_workqueue);
   955	error9:
   956		kfree(dev->tmp_buffer);
   957	error8:
   958		pci_iounmap(pci_dev, dev->mmio);
   959	error7:
   960		dma_free_coherent(&pci_dev->dev, R852_DMA_LEN, dev->bounce_buffer,
   961				  dev->phys_bounce_buffer);
   962	error6:
   963		kfree(dev);
   964	error5:
   965		kfree(chip);
   966	error4:
   967		pci_release_regions(pci_dev);
   968	error3:
   969	error2:
   970		pci_disable_device(pci_dev);
   971	error1:
   972		return error;
   973	}
   974	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux