2022-11-04 08:07:41

by kernel test robot

[permalink] [raw]
Subject: drivers/soc/apple/sart.c:190:38: warning: cast from 'void (*)(struct device *)' to 'void (*)(void *)' converts to incompatible function type

tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: ee6050c8af96bba2f81e8b0793a1fc2f998fcd20
commit: b170143ae1113882731666aec9b9105356f1fc17 soc: apple: Add SART driver
date: 6 months ago
config: hexagon-randconfig-r041-20221104
compiler: clang version 16.0.0 (https://github.com/llvm/llvm-project 2bbafe04fe785a9469bea5a3737f8d7d3ce4aca2)
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/torvalds/linux.git/commit/?id=b170143ae1113882731666aec9b9105356f1fc17
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout b170143ae1113882731666aec9b9105356f1fc17
# 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=hexagon SHELL=/bin/bash drivers/soc/apple/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <[email protected]>

All warnings (new ones prefixed by >>):

>> drivers/soc/apple/sart.c:190:38: warning: cast from 'void (*)(struct device *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
ret = devm_add_action_or_reset(dev, (void (*)(void *))put_device,
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.


vim +190 drivers/soc/apple/sart.c

166
167 struct apple_sart *devm_apple_sart_get(struct device *dev)
168 {
169 struct device_node *sart_node;
170 struct platform_device *sart_pdev;
171 struct apple_sart *sart;
172 int ret;
173
174 sart_node = of_parse_phandle(dev->of_node, "apple,sart", 0);
175 if (!sart_node)
176 return ERR_PTR(-ENODEV);
177
178 sart_pdev = of_find_device_by_node(sart_node);
179 of_node_put(sart_node);
180
181 if (!sart_pdev)
182 return ERR_PTR(-ENODEV);
183
184 sart = dev_get_drvdata(&sart_pdev->dev);
185 if (!sart) {
186 put_device(&sart_pdev->dev);
187 return ERR_PTR(-EPROBE_DEFER);
188 }
189
> 190 ret = devm_add_action_or_reset(dev, (void (*)(void *))put_device,
191 &sart_pdev->dev);
192 if (ret)
193 return ERR_PTR(ret);
194
195 device_link_add(dev, &sart_pdev->dev,
196 DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_SUPPLIER);
197
198 return sart;
199 }
200 EXPORT_SYMBOL_GPL(devm_apple_sart_get);
201

--
0-DAY CI Kernel Test Service
https://01.org/lkp


Attachments:
(No filename) (2.75 kB)
config (100.57 kB)
Download all attachments

2022-11-04 09:01:35

by Arnd Bergmann

[permalink] [raw]
Subject: Re: drivers/soc/apple/sart.c:190:38: warning: cast from 'void (*)(struct device *)' to 'void (*)(void *)' converts to incompatible function type

On Fri, Nov 4, 2022, at 09:01, kernel test robot wrote:
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <[email protected]>

Thanks for the report!

>>> drivers/soc/apple/sart.c:190:38: warning: cast from 'void (*)(struct device *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
>
> ret = devm_add_action_or_reset(dev, (void (*)(void *))put_device,
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

Sven, can you send a patch to add the missing helper function that calls
put_device?

Arnd

2022-11-04 13:25:07

by Sven Peter

[permalink] [raw]
Subject: Re: drivers/soc/apple/sart.c:190:38: warning: cast from 'void (*)(struct device *)' to 'void (*)(void *)' converts to incompatible function type

On Fri, Nov 4, 2022, at 09:14, Arnd Bergmann wrote:
> On Fri, Nov 4, 2022, at 09:01, kernel test robot wrote:
>>
>> If you fix the issue, kindly add following tag where applicable
>> | Reported-by: kernel test robot <[email protected]>
>
> Thanks for the report!
>
>>>> drivers/soc/apple/sart.c:190:38: warning: cast from 'void (*)(struct device *)' to 'void (*)(void *)' converts to incompatible function type [-Wcast-function-type-strict]
>>
>> ret = devm_add_action_or_reset(dev, (void (*)(void *))put_device,
>> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> Sven, can you send a patch to add the missing helper function that calls
> put_device?

Sure, I'll send a patch tonight.


Sven