lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Sun, 7 Nov 2021 03:22:24 +0800
From:   kernel test robot <lkp@...el.com>
To:     Fabio Estevam <festevam@...il.com>
Cc:     llvm@...ts.linux.dev, kbuild-all@...ts.01.org,
        linux-kernel@...r.kernel.org,
        Wolfram Sang <wsa-dev@...g-engineering.com>
Subject: drivers/i2c/busses/i2c-mxs.c:802:18: warning: cast to smaller
 integer type 'enum mxs_i2c_devtype' from 'const void *'

Hi Fabio,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   fe91c4725aeed35023ba4f7a1e1adfebb6878c23
commit: c32abd8b569144b20c9c9b6dd7232828c612452f i2c: mxs: Remove unneeded platform_device_id
date:   11 months ago
config: arm64-randconfig-r024-20210927 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c32abd8b569144b20c9c9b6dd7232828c612452f
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout c32abd8b569144b20c9c9b6dd7232828c612452f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=arm64 

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

All warnings (new ones prefixed by >>):

>> drivers/i2c/busses/i2c-mxs.c:802:18: warning: cast to smaller integer type 'enum mxs_i2c_devtype' from 'const void *' [-Wvoid-pointer-to-enum-cast]
           i2c->dev_type = (enum mxs_i2c_devtype)of_device_get_match_data(&pdev->dev);
                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +802 drivers/i2c/busses/i2c-mxs.c

   790	
   791	static int mxs_i2c_probe(struct platform_device *pdev)
   792	{
   793		struct device *dev = &pdev->dev;
   794		struct mxs_i2c_dev *i2c;
   795		struct i2c_adapter *adap;
   796		int err, irq;
   797	
   798		i2c = devm_kzalloc(dev, sizeof(*i2c), GFP_KERNEL);
   799		if (!i2c)
   800			return -ENOMEM;
   801	
 > 802		i2c->dev_type = (enum mxs_i2c_devtype)of_device_get_match_data(&pdev->dev);
   803	
   804		i2c->regs = devm_platform_ioremap_resource(pdev, 0);
   805		if (IS_ERR(i2c->regs))
   806			return PTR_ERR(i2c->regs);
   807	
   808		irq = platform_get_irq(pdev, 0);
   809		if (irq < 0)
   810			return irq;
   811	
   812		err = devm_request_irq(dev, irq, mxs_i2c_isr, 0, dev_name(dev), i2c);
   813		if (err)
   814			return err;
   815	
   816		i2c->dev = dev;
   817	
   818		init_completion(&i2c->cmd_complete);
   819	
   820		if (dev->of_node) {
   821			err = mxs_i2c_get_ofdata(i2c);
   822			if (err)
   823				return err;
   824		}
   825	
   826		/* Setup the DMA */
   827		i2c->dmach = dma_request_chan(dev, "rx-tx");
   828		if (IS_ERR(i2c->dmach)) {
   829			dev_err(dev, "Failed to request dma\n");
   830			return PTR_ERR(i2c->dmach);
   831		}
   832	
   833		platform_set_drvdata(pdev, i2c);
   834	
   835		/* Do reset to enforce correct startup after pinmuxing */
   836		err = mxs_i2c_reset(i2c);
   837		if (err)
   838			return err;
   839	
   840		adap = &i2c->adapter;
   841		strlcpy(adap->name, "MXS I2C adapter", sizeof(adap->name));
   842		adap->owner = THIS_MODULE;
   843		adap->algo = &mxs_i2c_algo;
   844		adap->quirks = &mxs_i2c_quirks;
   845		adap->dev.parent = dev;
   846		adap->nr = pdev->id;
   847		adap->dev.of_node = pdev->dev.of_node;
   848		i2c_set_adapdata(adap, i2c);
   849		err = i2c_add_numbered_adapter(adap);
   850		if (err) {
   851			writel(MXS_I2C_CTRL0_SFTRST,
   852					i2c->regs + MXS_I2C_CTRL0_SET);
   853			return err;
   854		}
   855	
   856		return 0;
   857	}
   858	

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

Download attachment ".config.gz" of type "application/gzip" (45504 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ