Linux Hardware Monitor development
 help / color / mirror / Atom feed
* [hwmon:watchdog-next 21/22] drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size
@ 2018-09-23 15:16 kbuild test robot
  2018-09-23 16:39 ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: kbuild test robot @ 2018-09-23 15:16 UTC (permalink / raw)
  To: Chris Brandt; +Cc: kbuild-all, linux-hwmon, Guenter Roeck

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git watchdog-next
head:   419c9ad9c6d4f211ee83d49e2ce6a876cbb1800f
commit: c24a7cc9df8f17f0726daf9efc6aa290972009e9 [21/22] watchdog: rza_wdt: Support longer timeouts
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout c24a7cc9df8f17f0726daf9efc6aa290972009e9
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=sparc64 

All warnings (new ones prefixed by >>):

   drivers//watchdog/rza_wdt.c: In function 'rza_wdt_probe':
>> drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
     priv->cks = (unsigned int)of_device_get_match_data(&pdev->dev);
                 ^

vim +197 drivers//watchdog/rza_wdt.c

   166	
   167	static int rza_wdt_probe(struct platform_device *pdev)
   168	{
   169		struct rza_wdt *priv;
   170		struct resource *res;
   171		unsigned long rate;
   172		int ret;
   173	
   174		priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
   175		if (!priv)
   176			return -ENOMEM;
   177	
   178		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
   179		priv->base = devm_ioremap_resource(&pdev->dev, res);
   180		if (IS_ERR(priv->base))
   181			return PTR_ERR(priv->base);
   182	
   183		priv->clk = devm_clk_get(&pdev->dev, NULL);
   184		if (IS_ERR(priv->clk))
   185			return PTR_ERR(priv->clk);
   186	
   187		rate = clk_get_rate(priv->clk);
   188		if (rate < 16384) {
   189			dev_err(&pdev->dev, "invalid clock rate (%ld)\n", rate);
   190			return -ENOENT;
   191		}
   192	
   193		priv->wdev.info = &rza_wdt_ident,
   194		priv->wdev.ops = &rza_wdt_ops,
   195		priv->wdev.parent = &pdev->dev;
   196	
 > 197		priv->cks = (unsigned int)of_device_get_match_data(&pdev->dev);
   198		if (priv->cks == CKS_4BIT) {
   199			/* Assume slowest clock rate possible (CKS=0xF) */
   200			priv->wdev.max_timeout = (DIVIDER_4BIT * U8_MAX) / rate;
   201	
   202		} else if (priv->cks == CKS_3BIT) {
   203			/* Assume slowest clock rate possible (CKS=7) */
   204			rate /= DIVIDER_3BIT;
   205	
   206			/*
   207			 * Since the max possible timeout of our 8-bit count
   208			 * register is less than a second, we must use
   209			 * max_hw_heartbeat_ms.
   210			 */
   211			priv->wdev.max_hw_heartbeat_ms = (1000 * U8_MAX) / rate;
   212			dev_dbg(&pdev->dev, "max hw timeout of %dms\n",
   213				 priv->wdev.max_hw_heartbeat_ms);
   214		}
   215	
   216		priv->wdev.min_timeout = 1;
   217		priv->wdev.timeout = DEFAULT_TIMEOUT;
   218	
   219		watchdog_init_timeout(&priv->wdev, 0, &pdev->dev);
   220		watchdog_set_drvdata(&priv->wdev, priv);
   221	
   222		ret = devm_watchdog_register_device(&pdev->dev, &priv->wdev);
   223		if (ret)
   224			dev_err(&pdev->dev, "Cannot register watchdog device\n");
   225	
   226		return ret;
   227	}
   228	

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

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

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

* Re: [hwmon:watchdog-next 21/22] drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size
  2018-09-23 15:16 [hwmon:watchdog-next 21/22] drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size kbuild test robot
@ 2018-09-23 16:39 ` Guenter Roeck
  2018-09-23 17:49   ` Chris Brandt
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2018-09-23 16:39 UTC (permalink / raw)
  To: Chris Brandt; +Cc: kbuild test robot, kbuild-all, linux-hwmon

Chris,

On 09/23/2018 08:16 AM, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git watchdog-next
> head:   419c9ad9c6d4f211ee83d49e2ce6a876cbb1800f
> commit: c24a7cc9df8f17f0726daf9efc6aa290972009e9 [21/22] watchdog: rza_wdt: Support longer timeouts
> config: sparc64-allmodconfig (attached as .config)
> compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          git checkout c24a7cc9df8f17f0726daf9efc6aa290972009e9
>          # save the attached .config to linux build tree
>          GCC_VERSION=7.2.0 make.cross ARCH=sparc64
> 
> All warnings (new ones prefixed by >>):
> 
>     drivers//watchdog/rza_wdt.c: In function 'rza_wdt_probe':
>>> drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       priv->cks = (unsigned int)of_device_get_match_data(&pdev->dev);
>                   ^
> 
> vim +197 drivers//watchdog/rza_wdt.c
> 
>     166	
>     167	static int rza_wdt_probe(struct platform_device *pdev)
>     168	{
>     169		struct rza_wdt *priv;
>     170		struct resource *res;
>     171		unsigned long rate;
>     172		int ret;
>     173	
>     174		priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>     175		if (!priv)
>     176			return -ENOMEM;
>     177	
>     178		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>     179		priv->base = devm_ioremap_resource(&pdev->dev, res);
>     180		if (IS_ERR(priv->base))
>     181			return PTR_ERR(priv->base);
>     182	
>     183		priv->clk = devm_clk_get(&pdev->dev, NULL);
>     184		if (IS_ERR(priv->clk))
>     185			return PTR_ERR(priv->clk);
>     186	
>     187		rate = clk_get_rate(priv->clk);
>     188		if (rate < 16384) {
>     189			dev_err(&pdev->dev, "invalid clock rate (%ld)\n", rate);
>     190			return -ENOENT;
>     191		}
>     192	
>     193		priv->wdev.info = &rza_wdt_ident,
>     194		priv->wdev.ops = &rza_wdt_ops,
>     195		priv->wdev.parent = &pdev->dev;
>     196	
>   > 197		priv->cks = (unsigned int)of_device_get_match_data(&pdev->dev);

Please resubmit with this fixed. Something like
			priv->cks = (unsigned int)(uintptr_t)of_device_get_match_data(&pdev->dev);
should do it.

Thanks,
Guenter

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

* Re: [hwmon:watchdog-next 21/22] drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size
  2018-09-23 16:39 ` Guenter Roeck
@ 2018-09-23 17:49   ` Chris Brandt
  0 siblings, 0 replies; 3+ messages in thread
From: Chris Brandt @ 2018-09-23 17:49 UTC (permalink / raw)
  To: Guenter Roeck; +Cc: linux-hwmon@vger.kernel.org

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

OK, I will do that tomorrow.

Chris



On Sep 23, 2018 12:39 PM, Guenter Roeck <linux@roeck-us.net> wrote:
Chris,

On 09/23/2018 08:16 AM, kbuild test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git watchdog-next
> head:   419c9ad9c6d4f211ee83d49e2ce6a876cbb1800f
> commit: c24a7cc9df8f17f0726daf9efc6aa290972009e9 [21/22] watchdog: rza_wdt: Support longer timeouts
> config: sparc64-allmodconfig (attached as .config)
> compiler: sparc64-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
> reproduce:
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          git checkout c24a7cc9df8f17f0726daf9efc6aa290972009e9
>          # save the attached .config to linux build tree
>          GCC_VERSION=7.2.0 make.cross ARCH=sparc64
>
> All warnings (new ones prefixed by >>):
>
>     drivers//watchdog/rza_wdt.c: In function 'rza_wdt_probe':
>>> drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
>       priv->cks = (unsigned int)of_device_get_match_data(&pdev->dev);
>                   ^
>
> vim +197 drivers//watchdog/rza_wdt.c
>
>     166
>     167       static int rza_wdt_probe(struct platform_device *pdev)
>     168       {
>     169               struct rza_wdt *priv;
>     170               struct resource *res;
>     171               unsigned long rate;
>     172               int ret;
>     173
>     174               priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>     175               if (!priv)
>     176                       return -ENOMEM;
>     177
>     178               res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>     179               priv->base = devm_ioremap_resource(&pdev->dev, res);
>     180               if (IS_ERR(priv->base))
>     181                       return PTR_ERR(priv->base);
>     182
>     183               priv->clk = devm_clk_get(&pdev->dev, NULL);
>     184               if (IS_ERR(priv->clk))
>     185                       return PTR_ERR(priv->clk);
>     186
>     187               rate = clk_get_rate(priv->clk);
>     188               if (rate < 16384) {
>     189                       dev_err(&pdev->dev, "invalid clock rate (%ld)\n", rate);
>     190                       return -ENOENT;
>     191               }
>     192
>     193               priv->wdev.info = &rza_wdt_ident,
>     194               priv->wdev.ops = &rza_wdt_ops,
>     195               priv->wdev.parent = &pdev->dev;
>     196
>   > 197               priv->cks = (unsigned int)of_device_get_match_data(&pdev->dev);

Please resubmit with this fixed. Something like
                        priv->cks = (unsigned int)(uintptr_t)of_device_get_match_data(&pdev->dev);
should do it.

Thanks,
Guenter


[-- Attachment #2: Type: text/html, Size: 7680 bytes --]

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

end of thread, other threads:[~2018-09-23 22:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-23 15:16 [hwmon:watchdog-next 21/22] drivers//watchdog/rza_wdt.c:197:14: warning: cast from pointer to integer of different size kbuild test robot
2018-09-23 16:39 ` Guenter Roeck
2018-09-23 17:49   ` Chris Brandt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox