linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* drivers/i2c/busses/i2c-mxs.c:802:18: warning: cast to smaller integer type 'enum mxs_i2c_devtype' from 'const void *'
@ 2021-11-06 19:22 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-11-06 19:22 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: llvm, kbuild-all, linux-kernel, Wolfram Sang

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

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@intel.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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45504 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/i2c/busses/i2c-mxs.c:802:18: warning: cast to smaller integer type 'enum mxs_i2c_devtype' from 'const void *'
@ 2022-04-21 19:44 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2022-04-21 19:44 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: llvm, kbuild-all, linux-kernel, Wolfram Sang

Hi Fabio,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b253435746d9a4a701b5f09211b9c14d3370d0da
commit: c32abd8b569144b20c9c9b6dd7232828c612452f i2c: mxs: Remove unneeded platform_device_id
date:   1 year, 5 months ago
config: arm64-randconfig-r034-20220421 (https://download.01.org/0day-ci/archive/20220422/202204220355.TdCb2zsz-lkp@intel.com/config)
compiler: clang version 15.0.0 (https://github.com/llvm/llvm-project 5bd87350a5ae429baf8f373cb226a57b62f87280)
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 config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm64 SHELL=/bin/bash drivers/i2c/busses/

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 >>):

>> 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
https://01.org/lkp

^ permalink raw reply	[flat|nested] 3+ messages in thread

* drivers/i2c/busses/i2c-mxs.c:802:18: warning: cast to smaller integer type 'enum mxs_i2c_devtype' from 'const void *'
@ 2021-09-28  4:29 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-09-28  4:29 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: llvm, kbuild-all, linux-kernel, Wolfram Sang

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   92477dd1faa650e50bd3bb35a6c0b8d09198cc35
commit: c32abd8b569144b20c9c9b6dd7232828c612452f i2c: mxs: Remove unneeded platform_device_id
date:   10 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@intel.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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 45506 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-04-21 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-06 19:22 drivers/i2c/busses/i2c-mxs.c:802:18: warning: cast to smaller integer type 'enum mxs_i2c_devtype' from 'const void *' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2022-04-21 19:44 kernel test robot
2021-09-28  4:29 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).