Re: [PATCH v3 04/11] driver core: Constify API device_find_child() then adapt for various usages

Uwe Kleine-König <[email protected]>
Newsgroups gmane.linux.serial,gmane.linux.kernel,gmane.linux.sound,gmane.linux.ports.sparc,gmane.linux.block,gmane.linux.kernel.firewire.devel,gmane.linux.kernel.efi,gmane.linux.kernel.gpio,gmane.comp.video.dri.devel,gmane.linux.ports.arm.mediatek,gmane.linux.kernel.hwmon,gmane.linux.drivers.video-input-infrastructure,gmane.linux.pwm,gmane.linux.scsi,gmane.linux.iscsi.open-iscsi,gmane.linux.usb.general,gmane.linux.network
Message-ID <h4pndknfwvck5yjnbs5rdmrxkqeksfxldwj4qbjqyvdzs5cjbf@i4afsjsg3obw>
On Thu, Dec 05, 2024 at 08:10:13AM +0800, Zijun Hu wrote:
> diff --git a/arch/sparc/kernel/vio.c b/arch/sparc/kernel/vio.c
> index 07933d75ac815160a2580dce39fde7653a9502e1..1a1a9d6b8f2e8dfedefafde846315a06a167fbfb 100644
> --- a/arch/sparc/kernel/vio.c
> +++ b/arch/sparc/kernel/vio.c
> @@ -419,13 +419,13 @@ struct vio_remove_node_data {
>  	u64 node;
>  };
>  
> -static int vio_md_node_match(struct device *dev, void *arg)
> +static int vio_md_node_match(struct device *dev, const void *arg)
>  {
>  	struct vio_dev *vdev = to_vio_dev(dev);
> -	struct vio_remove_node_data *node_data;
> +	const struct vio_remove_node_data *node_data;
>  	u64 node;
>  
> -	node_data = (struct vio_remove_node_data *)arg;
> +	node_data = (const struct vio_remove_node_data *)arg;

You can just drop the cast here. But maybe that is better be done i a
separate change.

>  	node = vio_vdev_node(node_data->hp, vdev);
>  

Best regards
Uwe
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmdRg3IACgkQj4D7WH0S
/k6XGAf6Av8yk2DAhSYXPrLn/Ud4m0Je4HKR7wDERTkoucUo/owwlaJH19v3/SEN
BoXiIS4oqDNVJbzYsEPr2ZJQLZUTvBMyzKLJ4oNU1RzaivgdSipCPyK6I0OAHNui
CtQI8qTG+gSxHLhoEeFCl2kcnUCtV4nGeXk44by5/Mu3CkC/pXRfbRn7iLrDX34F
XHQ9MMrA6tMoRuStbxo3xHkRI7CkjOJVO6hWgv6PPAoKdFb63QX7jdTrZQTIoNtP
2SMqVunbF87nTNTOQZWDCN1E3vELVsVjs6YsrlJeMYI9Gs7tcbVD4OHKUvrtSf86
UHoREl5N4LOf8l+HqvTaxQnH6pb+QQ==
=qufa
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.