linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *'
@ 2021-11-17  3:56 kernel test robot
  2021-11-17  8:27 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: kernel test robot @ 2021-11-17  3:56 UTC (permalink / raw)
  To: Lad Prabhakar
  Cc: llvm, kbuild-all, linux-kernel, Krzysztof Kozlowski, Biju Das,
	Wolfram Sang

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git for-v5.17/renesas-rpc
head:   b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
commit: b04cc0d912eb80d3c438b11d96ca847c3e77e8ab [5/5] memory: renesas-rpc-if: Add support for RZ/G2L
config: x86_64-buildonly-randconfig-r002-20211116 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4c2cf3a314d9131b1b288e7c8ab0c75ac1b2be1d)
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/krzk/linux-mem-ctrl.git/commit/?id=b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
        git remote add krzk-mem-ctrl https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git
        git fetch --no-tags krzk-mem-ctrl for-v5.17/renesas-rpc
        git checkout b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

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/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
           rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   1 warning generated.


vim +253 drivers/memory/renesas-rpc-if.c

   226	
   227	int rpcif_sw_init(struct rpcif *rpc, struct device *dev)
   228	{
   229		struct platform_device *pdev = to_platform_device(dev);
   230		struct resource *res;
   231	
   232		rpc->dev = dev;
   233	
   234		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
   235		rpc->base = devm_ioremap_resource(&pdev->dev, res);
   236		if (IS_ERR(rpc->base))
   237			return PTR_ERR(rpc->base);
   238	
   239		rpc->regmap = devm_regmap_init(&pdev->dev, NULL, rpc, &rpcif_regmap_config);
   240		if (IS_ERR(rpc->regmap)) {
   241			dev_err(&pdev->dev,
   242				"failed to init regmap for rpcif, error %ld\n",
   243				PTR_ERR(rpc->regmap));
   244			return	PTR_ERR(rpc->regmap);
   245		}
   246	
   247		res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "dirmap");
   248		rpc->dirmap = devm_ioremap_resource(&pdev->dev, res);
   249		if (IS_ERR(rpc->dirmap))
   250			return PTR_ERR(rpc->dirmap);
   251		rpc->size = resource_size(res);
   252	
 > 253		rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
   254		rpc->rstc = devm_reset_control_get_exclusive(&pdev->dev, NULL);
   255	
   256		return PTR_ERR_OR_ZERO(rpc->rstc);
   257	}
   258	EXPORT_SYMBOL(rpcif_sw_init);
   259	

---
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: 38155 bytes --]

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

* Re: [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *'
  2021-11-17  3:56 [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *' kernel test robot
@ 2021-11-17  8:27 ` Krzysztof Kozlowski
  2021-11-21 12:30   ` Krzysztof Kozlowski
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-11-17  8:27 UTC (permalink / raw)
  To: kernel test robot, Lad Prabhakar
  Cc: llvm, kbuild-all, linux-kernel, Biju Das, Wolfram Sang

On 17/11/2021 04:56, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git for-v5.17/renesas-rpc
> head:   b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
> commit: b04cc0d912eb80d3c438b11d96ca847c3e77e8ab [5/5] memory: renesas-rpc-if: Add support for RZ/G2L
> config: x86_64-buildonly-randconfig-r002-20211116 (attached as .config)
> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4c2cf3a314d9131b1b288e7c8ab0c75ac1b2be1d)
> 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/krzk/linux-mem-ctrl.git/commit/?id=b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
>         git remote add krzk-mem-ctrl https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git
>         git fetch --no-tags krzk-mem-ctrl for-v5.17/renesas-rpc
>         git checkout b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 
> 
> 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/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
>            rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>    1 warning generated.
> 

I am afraid several drivers repeat this pattern and will be affected as
well on clang. GCC does not complain (apparently cast is enough for
GCC), but still this has to be fixed. Maybe cast via  uintptr_t would
quite it?

Let me know when I can expect the fix.

Best regards,
Krzysztof

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

* Re: [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *'
  2021-11-17  8:27 ` Krzysztof Kozlowski
@ 2021-11-21 12:30   ` Krzysztof Kozlowski
  2021-11-21 18:04     ` Prabhakar Mahadev Lad
  0 siblings, 1 reply; 4+ messages in thread
From: Krzysztof Kozlowski @ 2021-11-21 12:30 UTC (permalink / raw)
  To: kernel test robot, Lad Prabhakar
  Cc: llvm, kbuild-all, linux-kernel, Biju Das, Wolfram Sang

On 17/11/2021 09:27, Krzysztof Kozlowski wrote:
> On 17/11/2021 04:56, kernel test robot wrote:
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git for-v5.17/renesas-rpc
>> head:   b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
>> commit: b04cc0d912eb80d3c438b11d96ca847c3e77e8ab [5/5] memory: renesas-rpc-if: Add support for RZ/G2L
>> config: x86_64-buildonly-randconfig-r002-20211116 (attached as .config)
>> compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 4c2cf3a314d9131b1b288e7c8ab0c75ac1b2be1d)
>> 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/krzk/linux-mem-ctrl.git/commit/?id=b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
>>         git remote add krzk-mem-ctrl https://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git
>>         git fetch --no-tags krzk-mem-ctrl for-v5.17/renesas-rpc
>>         git checkout b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
>>         # save the attached .config to linux build tree
>>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 
>>
>> 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/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *' [-Wvoid-pointer-to-enum-cast]
>>            rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
>>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>    1 warning generated.
>>
> 
> I am afraid several drivers repeat this pattern and will be affected as
> well on clang. GCC does not complain (apparently cast is enough for
> GCC), but still this has to be fixed. Maybe cast via  uintptr_t would
> quite it?
> 
> Let me know when I can expect the fix.
> 

Any progress on fixing this one? It blocks entire set (and further
Wolfram's patches) from being included in pull-request and might be
postponed till next release.


Best regards,
Krzysztof

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

* RE: [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *'
  2021-11-21 12:30   ` Krzysztof Kozlowski
@ 2021-11-21 18:04     ` Prabhakar Mahadev Lad
  0 siblings, 0 replies; 4+ messages in thread
From: Prabhakar Mahadev Lad @ 2021-11-21 18:04 UTC (permalink / raw)
  To: Krzysztof Kozlowski, kernel test robot
  Cc: llvm, kbuild-all, linux-kernel, Biju Das, Wolfram Sang

Hi Krzysztof,

> -----Original Message-----
> From: Krzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
> Sent: 21 November 2021 12:31
> To: kernel test robot <lkp@intel.com>; Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>
> Cc: llvm@lists.linux.dev; kbuild-all@lists.01.org; linux-kernel@vger.kernel.org; Biju Das
> <biju.das.jz@bp.renesas.com>; Wolfram Sang <wsa-dev@sang-engineering.com>
> Subject: Re: [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14:
> warning: cast to smaller integer type 'enum rpcif_type' from 'const void *'
> 
> On 17/11/2021 09:27, Krzysztof Kozlowski wrote:
> > On 17/11/2021 04:56, kernel test robot wrote:
> >> tree:
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2
> Fkernel%2Fgit%2Fkrzk%2Flinux-mem-ctrl.git&amp;data=04%7C01%7Cprabhakar.mahadev-
> lad.rj%40bp.renesas.com%7C2dc6e2d7058a4d615cec08d9aceac56f%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%
> 7C637730946616076082%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000&amp;sdata=jDl%2B2uGmMvHbDRBNhRYdHcMs8tVpV2QyHjIEvIjmBog%3D&amp;reserved=0 for-
> v5.17/renesas-rpc
> >> head:   b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
> >> commit: b04cc0d912eb80d3c438b11d96ca847c3e77e8ab [5/5] memory:
> >> renesas-rpc-if: Add support for RZ/G2L
> >> config: x86_64-buildonly-randconfig-r002-20211116 (attached as
> >> .config)
> >> compiler: clang version 14.0.0
> >> (https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgi
> >> thub.com%2Fllvm%2Fllvm-project&amp;data=04%7C01%7Cprabhakar.mahadev-l
> >> ad.rj%40bp.renesas.com%7C2dc6e2d7058a4d615cec08d9aceac56f%7C53d82571d
> >> a1947e49cb4625a166a4a2a%7C0%7C0%7C637730946616076082%7CUnknown%7CTWFp
> >> bGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6M
> >> n0%3D%7C3000&amp;sdata=GncdHf45Tf5IFjq650tIcWCQHr8b%2FKi%2BW%2F5%2Frh
> >> WLCZo%3D&amp;reserved=0 4c2cf3a314d9131b1b288e7c8ab0c75ac1b2be1d)
> >> reproduce (this is a W=1 build):
> >>         wget
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fraw.githubusercontent.com%2Fintel%2F
> lkp-tests%2Fmaster%2Fsbin%2Fmake.cross&amp;data=04%7C01%7Cprabhakar.mahadev-
> lad.rj%40bp.renesas.com%7C2dc6e2d7058a4d615cec08d9aceac56f%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%
> 7C637730946616086037%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000&amp;sdata=A2rdd3p77C5yTeebqFwISM8aINdbRAbWrsreBV9%2BcpI%3D&amp;reserved=0 -O
> ~/bin/make.cross
> >>         chmod +x ~/bin/make.cross
> >>         #
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2
> Fkernel%2Fgit%2Fkrzk%2Flinux-mem-
> ctrl.git%2Fcommit%2F%3Fid%3Db04cc0d912eb80d3c438b11d96ca847c3e77e8ab&amp;data=04%7C01%7Cprabhakar.maha
> dev-
> lad.rj%40bp.renesas.com%7C2dc6e2d7058a4d615cec08d9aceac56f%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%
> 7C637730946616086037%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000&amp;sdata=RkD43W82kRZCCNpN%2FqxuQb%2FVNaKkJvgHt8NN8A%2BgIsw%3D&amp;reserved=0
> >>         git remote add krzk-mem-ctrl
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgit.kernel.org%2Fpub%2Fscm%2Flinux%2
> Fkernel%2Fgit%2Fkrzk%2Flinux-mem-ctrl.git&amp;data=04%7C01%7Cprabhakar.mahadev-
> lad.rj%40bp.renesas.com%7C2dc6e2d7058a4d615cec08d9aceac56f%7C53d82571da1947e49cb4625a166a4a2a%7C0%7C0%
> 7C637730946616086037%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXV
> CI6Mn0%3D%7C3000&amp;sdata=unRWu2Zo3KD9lrN8%2BgWHDqvUdcmISul3ynABH8YVj44%3D&amp;reserved=0
> >>         git fetch --no-tags krzk-mem-ctrl for-v5.17/renesas-rpc
> >>         git checkout b04cc0d912eb80d3c438b11d96ca847c3e77e8ab
> >>         # save the attached .config to linux build tree
> >>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross
> >> W=1 ARCH=x86_64
> >>
> >> 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/memory/renesas-rpc-if.c:253:14: warning: cast to smaller
> >>>> integer type 'enum rpcif_type' from 'const void *'
> >>>> [-Wvoid-pointer-to-enum-cast]
> >>            rpc->type = (enum rpcif_type)of_device_get_match_data(dev);
> >>                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>    1 warning generated.
> >>
> >
> > I am afraid several drivers repeat this pattern and will be affected
> > as well on clang. GCC does not complain (apparently cast is enough for
> > GCC), but still this has to be fixed. Maybe cast via  uintptr_t would
> > quite it?
> >
> > Let me know when I can expect the fix.
> >
> 
> Any progress on fixing this one? It blocks entire set (and further Wolfram's patches) from being
> included in pull-request and might be postponed till next release.
> 
Sorry for the delay I completely missed it, I have now posted a fix [1] to ML.

[1] https://patchwork.kernel.org/project/linux-renesas-soc/patch/20211121180155.9062-1-prabhakar.mahadev-lad.rj@bp.renesas.com/

Cheers,
Prabhakar

> 
> Best regards,
> Krzysztof

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

end of thread, other threads:[~2021-11-21 18:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17  3:56 [krzk-mem-ctrl:for-v5.17/renesas-rpc 5/5] drivers/memory/renesas-rpc-if.c:253:14: warning: cast to smaller integer type 'enum rpcif_type' from 'const void *' kernel test robot
2021-11-17  8:27 ` Krzysztof Kozlowski
2021-11-21 12:30   ` Krzysztof Kozlowski
2021-11-21 18:04     ` Prabhakar Mahadev Lad

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