All of lore.kernel.org
 help / color / mirror / Atom feed
* [nomadik:ixp4 8/14] drivers/input/misc/ixp4xx-beeper.c:61:21: warning: cast from pointer to integer of different size
@ 2021-04-17 22:40 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-04-17 22:40 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git ixp4
head:   e0bf0c1bc94b9100d85ace594fd1f0fb0024dbf2
commit: b3e3d2dd8684e80e87ca90e847c413cb45058bb3 [8/14] Input: ixp4xx-beeper: pass resources as platform data
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
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/linusw/linux-nomadik.git/commit/?id=b3e3d2dd8684e80e87ca90e847c413cb45058bb3
        git remote add nomadik https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git
        git fetch --no-tags nomadik ixp4
        git checkout b3e3d2dd8684e80e87ca90e847c413cb45058bb3
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 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/input/misc/ixp4xx-beeper.c: In function 'ixp4xx_spkr_event':
>> drivers/input/misc/ixp4xx-beeper.c:61:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      61 |  unsigned int pin = (unsigned int) input_get_drvdata(dev);
         |                     ^
   drivers/input/misc/ixp4xx-beeper.c: In function 'ixp4xx_spkr_interrupt':
   drivers/input/misc/ixp4xx-beeper.c:87:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      87 |  unsigned int pin = (unsigned int) dev_id;
         |                     ^
   drivers/input/misc/ixp4xx-beeper.c: In function 'ixp4xx_spkr_probe':
>> drivers/input/misc/ixp4xx-beeper.c:109:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     109 |  input_set_drvdata(input_dev, (void *) dev->id);
         |                               ^
   drivers/input/misc/ixp4xx-beeper.c:149:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     149 |      (void *) dev->id);
         |      ^
   drivers/input/misc/ixp4xx-beeper.c:163:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     163 |  free_irq(irq, (void *)dev->id);
         |                ^
   drivers/input/misc/ixp4xx-beeper.c: In function 'ixp4xx_spkr_remove':
   drivers/input/misc/ixp4xx-beeper.c:175:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     175 |  unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
         |                     ^
   drivers/input/misc/ixp4xx-beeper.c:183:30: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     183 |  free_irq(ixp4xx_timer2_irq, (void *)dev->id);
         |                              ^
   drivers/input/misc/ixp4xx-beeper.c: In function 'ixp4xx_spkr_shutdown':
   drivers/input/misc/ixp4xx-beeper.c:192:21: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     192 |  unsigned int pin = (unsigned int) input_get_drvdata(input_dev);
         |                     ^


vim +61 drivers/input/misc/ixp4xx-beeper.c

01387959022def Alessandro Zummo  2006-01-29   58  
01387959022def Alessandro Zummo  2006-01-29   59  static int ixp4xx_spkr_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
01387959022def Alessandro Zummo  2006-01-29   60  {
643bd27298bdcc Frederik Deweerdt 2007-05-10  @61  	unsigned int pin = (unsigned int) input_get_drvdata(dev);
01387959022def Alessandro Zummo  2006-01-29   62  	unsigned int count = 0;
01387959022def Alessandro Zummo  2006-01-29   63  
01387959022def Alessandro Zummo  2006-01-29   64  	if (type != EV_SND)
01387959022def Alessandro Zummo  2006-01-29   65  		return -1;
01387959022def Alessandro Zummo  2006-01-29   66  
01387959022def Alessandro Zummo  2006-01-29   67  	switch (code) {
01387959022def Alessandro Zummo  2006-01-29   68  		case SND_BELL:
01387959022def Alessandro Zummo  2006-01-29   69  			if (value)
01387959022def Alessandro Zummo  2006-01-29   70  				value = 1000;
01387959022def Alessandro Zummo  2006-01-29   71  		case SND_TONE:
01387959022def Alessandro Zummo  2006-01-29   72  			break;
01387959022def Alessandro Zummo  2006-01-29   73  		default:
01387959022def Alessandro Zummo  2006-01-29   74  			return -1;
01387959022def Alessandro Zummo  2006-01-29   75  	}
01387959022def Alessandro Zummo  2006-01-29   76  
01387959022def Alessandro Zummo  2006-01-29   77  	if (value > 20 && value < 32767)
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26   78  		count = (ixp4xx_spkr_timer_freq / (value * 4)) - 1;
01387959022def Alessandro Zummo  2006-01-29   79  
01387959022def Alessandro Zummo  2006-01-29   80  	ixp4xx_spkr_control(pin, count);
01387959022def Alessandro Zummo  2006-01-29   81  
01387959022def Alessandro Zummo  2006-01-29   82  	return 0;
01387959022def Alessandro Zummo  2006-01-29   83  }
01387959022def Alessandro Zummo  2006-01-29   84  
7d12e780e003f9 David Howells     2006-10-05   85  static irqreturn_t ixp4xx_spkr_interrupt(int irq, void *dev_id)
01387959022def Alessandro Zummo  2006-01-29   86  {
b22973d0ecfcf4 Linus Walleij     2013-09-10   87  	unsigned int pin = (unsigned int) dev_id;
b22973d0ecfcf4 Linus Walleij     2013-09-10   88  
01387959022def Alessandro Zummo  2006-01-29   89  	/* clear interrupt */
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26   90  	__raw_writel(IXP4XX_OSST_TIMER_2_PEND, ixp4xx_spkr_regs + IXP4XX_OSST_OFFSET);
01387959022def Alessandro Zummo  2006-01-29   91  
01387959022def Alessandro Zummo  2006-01-29   92  	/* flip the beeper output */
b22973d0ecfcf4 Linus Walleij     2013-09-10   93  	gpio_set_value(pin, !gpio_get_value(pin));
01387959022def Alessandro Zummo  2006-01-29   94  
01387959022def Alessandro Zummo  2006-01-29   95  	return IRQ_HANDLED;
01387959022def Alessandro Zummo  2006-01-29   96  }
01387959022def Alessandro Zummo  2006-01-29   97  
5298cc4cc753bb Bill Pemberton    2012-11-23   98  static int ixp4xx_spkr_probe(struct platform_device *dev)
01387959022def Alessandro Zummo  2006-01-29   99  {
01387959022def Alessandro Zummo  2006-01-29  100  	struct input_dev *input_dev;
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  101  	struct resource *res;
075df31aed44cd Linus Walleij     2018-12-29  102  	int irq;
01387959022def Alessandro Zummo  2006-01-29  103  	int err;
01387959022def Alessandro Zummo  2006-01-29  104  
01387959022def Alessandro Zummo  2006-01-29  105  	input_dev = input_allocate_device();
01387959022def Alessandro Zummo  2006-01-29  106  	if (!input_dev)
01387959022def Alessandro Zummo  2006-01-29  107  		return -ENOMEM;
01387959022def Alessandro Zummo  2006-01-29  108  
373f9713dccc8f Dmitry Torokhov   2007-04-12 @109  	input_set_drvdata(input_dev, (void *) dev->id);
373f9713dccc8f Dmitry Torokhov   2007-04-12  110  
94ddf7a371ff5d Zheng Yongjun     2020-12-11  111  	input_dev->name = "ixp4xx beeper";
01387959022def Alessandro Zummo  2006-01-29  112  	input_dev->phys = "ixp4xx/gpio";
01387959022def Alessandro Zummo  2006-01-29  113  	input_dev->id.bustype = BUS_HOST;
01387959022def Alessandro Zummo  2006-01-29  114  	input_dev->id.vendor  = 0x001f;
01387959022def Alessandro Zummo  2006-01-29  115  	input_dev->id.product = 0x0001;
01387959022def Alessandro Zummo  2006-01-29  116  	input_dev->id.version = 0x0100;
293e6392d72dfa Dmitry Torokhov   2007-04-12  117  	input_dev->dev.parent = &dev->dev;
01387959022def Alessandro Zummo  2006-01-29  118  
7b19ada2ed3c1e Jiri Slaby        2007-10-18  119  	input_dev->evbit[0] = BIT_MASK(EV_SND);
7b19ada2ed3c1e Jiri Slaby        2007-10-18  120  	input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE);
01387959022def Alessandro Zummo  2006-01-29  121  	input_dev->event = ixp4xx_spkr_event;
01387959022def Alessandro Zummo  2006-01-29  122  
075df31aed44cd Linus Walleij     2018-12-29  123  	irq = platform_get_irq(dev, 0);
075df31aed44cd Linus Walleij     2018-12-29  124  	if (irq < 0) {
075df31aed44cd Linus Walleij     2018-12-29  125  		err = irq;
075df31aed44cd Linus Walleij     2018-12-29  126  		goto err_free_device;
075df31aed44cd Linus Walleij     2018-12-29  127  	}
075df31aed44cd Linus Walleij     2018-12-29  128  
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  129  	res = platform_get_resource(dev, IORESOURCE_MEM, 0);
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  130  	if (!res) {
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  131  		err = -ENXIO;
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  132  		goto err_free_device;
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  133  	}
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  134  	/* note: don't call request_mem_region because of conflict */
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  135  	ixp4xx_spkr_regs = devm_ioremap(&dev->dev, res->start, resource_size(res));
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  136  	if (!ixp4xx_spkr_regs) {
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  137  		err = -ENXIO;
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  138  		goto err_free_device;
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  139  	}
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  140  
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  141  	ixp4xx_spkr_timer_freq = (uintptr_t)dev_get_platdata(&dev->dev);
b3e3d2dd8684e8 Arnd Bergmann     2019-08-26  142  
b22973d0ecfcf4 Linus Walleij     2013-09-10  143  	err = gpio_request(dev->id, "ixp4-beeper");
b22973d0ecfcf4 Linus Walleij     2013-09-10  144  	if (err)
b22973d0ecfcf4 Linus Walleij     2013-09-10  145  		goto err_free_device;
b22973d0ecfcf4 Linus Walleij     2013-09-10  146  
075df31aed44cd Linus Walleij     2018-12-29  147  	err = request_irq(irq, &ixp4xx_spkr_interrupt,
ec4665c46b11f6 Yong Zhang        2011-09-07  148  			  IRQF_NO_SUSPEND, "ixp4xx-beeper",
2dd9320305416c Ian Campbell      2010-07-29  149  			  (void *) dev->id);
01387959022def Alessandro Zummo  2006-01-29  150  	if (err)
b22973d0ecfcf4 Linus Walleij     2013-09-10  151  		goto err_free_gpio;
075df31aed44cd Linus Walleij     2018-12-29  152  	ixp4xx_timer2_irq = irq;
01387959022def Alessandro Zummo  2006-01-29  153  
01387959022def Alessandro Zummo  2006-01-29  154  	err = input_register_device(input_dev);
01387959022def Alessandro Zummo  2006-01-29  155  	if (err)
01387959022def Alessandro Zummo  2006-01-29  156  		goto err_free_irq;
01387959022def Alessandro Zummo  2006-01-29  157  
01387959022def Alessandro Zummo  2006-01-29  158  	platform_set_drvdata(dev, input_dev);
01387959022def Alessandro Zummo  2006-01-29  159  
01387959022def Alessandro Zummo  2006-01-29  160  	return 0;
01387959022def Alessandro Zummo  2006-01-29  161  
01387959022def Alessandro Zummo  2006-01-29  162   err_free_irq:
075df31aed44cd Linus Walleij     2018-12-29  163  	free_irq(irq, (void *)dev->id);
b22973d0ecfcf4 Linus Walleij     2013-09-10  164   err_free_gpio:
b22973d0ecfcf4 Linus Walleij     2013-09-10  165  	gpio_free(dev->id);
01387959022def Alessandro Zummo  2006-01-29  166   err_free_device:
01387959022def Alessandro Zummo  2006-01-29  167  	input_free_device(input_dev);
01387959022def Alessandro Zummo  2006-01-29  168  
01387959022def Alessandro Zummo  2006-01-29  169  	return err;
01387959022def Alessandro Zummo  2006-01-29  170  }
01387959022def Alessandro Zummo  2006-01-29  171  

:::::: The code at line 61 was first introduced by commit
:::::: 643bd27298bdcc4e75b3e6a7ca459675eb5378c3 Fix ixp4xx compile error

:::::: TO: Frederik Deweerdt <deweerdt@free.fr>
:::::: CC: Linus Torvalds <torvalds@woody.linux-foundation.org>

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

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-04-17 22:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-17 22:40 [nomadik:ixp4 8/14] drivers/input/misc/ixp4xx-beeper.c:61:21: warning: cast from pointer to integer of different size kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.