netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net-next:master 1118/1134] drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size
@ 2016-07-11 21:19 kbuild test robot
  2016-07-11 21:31 ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2016-07-11 21:19 UTC (permalink / raw)
  Cc: kbuild-all, netdev, Florian Fainelli

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git master
head:   a536a6e13ecd0d6eb0ffc36c5d56555896617282
commit: fefae6909ead1798c39bee4d94e7e8f1f2752ef6 [1118/1134] net: dsa: b53: Allow SRAB driver to specify platform data
config: ia64-allyesconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout fefae6909ead1798c39bee4d94e7e8f1f2752ef6
        # save the attached .config to linux build tree
        make.cross ARCH=ia64 

All warnings (new ones prefixed by >>):

   drivers/net/dsa/b53/b53_srab.c: In function 'b53_srab_probe':
>> drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      pdata->chip_id = (u32)of_id->data;
                       ^

vim +388 drivers/net/dsa/b53/b53_srab.c

   372	{
   373		struct b53_platform_data *pdata = pdev->dev.platform_data;
   374		struct device_node *dn = pdev->dev.of_node;
   375		const struct of_device_id *of_id = NULL;
   376		struct b53_srab_priv *priv;
   377		struct b53_device *dev;
   378		struct resource *r;
   379	
   380		if (dn)
   381			of_id = of_match_node(b53_srab_of_match, dn);
   382	
   383		if (of_id) {
   384			pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
   385			if (!pdata)
   386				return -ENOMEM;
   387	
 > 388			pdata->chip_id = (u32)of_id->data;
   389		}
   390	
   391		priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
   392		if (!priv)
   393			return -ENOMEM;
   394	
   395		r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   396		priv->regs = devm_ioremap_resource(&pdev->dev, r);

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 46371 bytes --]

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

* Re: [net-next:master 1118/1134] drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size
  2016-07-11 21:19 [net-next:master 1118/1134] drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size kbuild test robot
@ 2016-07-11 21:31 ` David Miller
  2016-07-11 21:37   ` Florian Fainelli
  0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2016-07-11 21:31 UTC (permalink / raw)
  To: fengguang.wu; +Cc: kbuild-all, netdev, f.fainelli

From: kbuild test robot <fengguang.wu@intel.com>
Date: Tue, 12 Jul 2016 05:19:57 +0800

> All warnings (new ones prefixed by >>):
> 
>    drivers/net/dsa/b53/b53_srab.c: In function 'b53_srab_probe':
>>> drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       pdata->chip_id = (u32)of_id->data;
>                        ^
> 

Fixed as follows:

====================
[PATCH] b53: Fix build warning.

   drivers/net/dsa/b53/b53_srab.c: In function 'b53_srab_probe':
>> drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      pdata->chip_id = (u32)of_id->data;
                       ^

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
---
 drivers/net/dsa/b53/b53_srab.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/b53/b53_srab.c b/drivers/net/dsa/b53/b53_srab.c
index 2b304ea..3e2d4a5 100644
--- a/drivers/net/dsa/b53/b53_srab.c
+++ b/drivers/net/dsa/b53/b53_srab.c
@@ -393,7 +393,7 @@ static int b53_srab_probe(struct platform_device *pdev)
 		if (!pdata)
 			return -ENOMEM;
 
-		pdata->chip_id = (u32)of_id->data;
+		pdata->chip_id = (u32)(unsigned long)of_id->data;
 	}
 
 	priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
-- 
2.1.0

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

* Re: [net-next:master 1118/1134] drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size
  2016-07-11 21:31 ` David Miller
@ 2016-07-11 21:37   ` Florian Fainelli
  0 siblings, 0 replies; 3+ messages in thread
From: Florian Fainelli @ 2016-07-11 21:37 UTC (permalink / raw)
  To: David Miller, fengguang.wu; +Cc: kbuild-all, netdev

On 07/11/2016 02:31 PM, David Miller wrote:
> From: kbuild test robot <fengguang.wu@intel.com>
> Date: Tue, 12 Jul 2016 05:19:57 +0800
> 
>> All warnings (new ones prefixed by >>):
>>
>>    drivers/net/dsa/b53/b53_srab.c: In function 'b53_srab_probe':
>>>> drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>>       pdata->chip_id = (u32)of_id->data;
>>                        ^
>>
> 
> Fixed as follows:
> 
> ====================
> [PATCH] b53: Fix build warning.
> 
>    drivers/net/dsa/b53/b53_srab.c: In function 'b53_srab_probe':
>>> drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       pdata->chip_id = (u32)of_id->data;
>                        ^
> 
> Reported-by: kbuild test robot <fengguang.wu@intel.com>
> Signed-off-by: David S. Miller <davem@davemloft.net>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

You are fast, thanks David!
-- 
Florian

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

end of thread, other threads:[~2016-07-11 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11 21:19 [net-next:master 1118/1134] drivers/net/dsa/b53/b53_srab.c:388:20: warning: cast from pointer to integer of different size kbuild test robot
2016-07-11 21:31 ` David Miller
2016-07-11 21:37   ` Florian Fainelli

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