[PATCH] virtio: Staticize and constify driver ops

Kuan-Wei Chiu visitorckw at gmail.com
Mon May 11 17:29:32 CEST 2026


On Sun, May 10, 2026 at 07:17:53PM +0200, Marek Vasut wrote:
> Set the ops structure as static const. The structure is not accessible
> from outside of this driver and is not going to be modified at runtime.
> 
> Signed-off-by: Marek Vasut <marek.vasut+renesas at mailbox.org>

FWIW

Reviewed-by: Kuan-Wei Chiu <visitorckw at gmail.com>

Regards,
Kuan-Wei

> ---
> Cc: "Christian Pötzsch" <christian.poetzsch at kernkonzept.com>
> Cc: Adam Lackorzynski <adam at l4re.org>
> Cc: Bin Meng <bmeng.cn at gmail.com>
> Cc: Heinrich Schuchardt <xypron.glpk at gmx.de>
> Cc: Tom Rini <trini at konsulko.com>
> Cc: u-boot at lists.denx.de
> ---
>  drivers/virtio/virtio-uclass.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c
> index c36e9e9b3a7..6e4a3d7a7c1 100644
> --- a/drivers/virtio/virtio-uclass.c
> +++ b/drivers/virtio/virtio-uclass.c
> @@ -400,7 +400,7 @@ UCLASS_DRIVER(virtio) = {
>  	.per_device_auto	= sizeof(struct virtio_dev_priv),
>  };
>  
> -struct bootdev_ops virtio_bootdev_ops = {
> +static const struct bootdev_ops virtio_bootdev_ops = {
>  };
>  
>  static const struct udevice_id virtio_bootdev_ids[] = {
> -- 
> 2.53.0
> 
> 


More information about the U-Boot mailing list