On Wed, Nov 23, 2022 at 10:22:26PM +0000, Chaitanya Kulkarni wrote:
>
> > +/* Get lifetime information from device */
> > +static int virtblk_ioctl_lifetime(struct virtio_blk *vblk, unsigned long
> > arg)
> > +{
> > + struct request_queue *q = vblk->disk->queue;
> > + struct request *req = NULL;
> > + struct virtblk_req *vbr;
> > + struct virtio_blk_lifetime lifetime;
> > + int ret;
> > +
> > + /* The virtio_blk_lifetime struct fields follow virtio spec.
> > + * There is no check/decode on values received from the device.
> > + * The data is sent as is to the user.
> > + */
> > +
> > + /* This ioctl is allowed only if VIRTIO_BLK_F_LIFETIME
> > + * feature is negotiated.
> > + */
> > + if (!virtio_has_feature(vblk->vdev, VIRTIO_BLK_F_LIFETIME))
> > + return -ENOTTY;
> > +
> > + memset(&lifetime, 0, sizeof(lifetime));
> > +
>
> you can remove memset 0 call here and declare initialize struct var
> something like totally untested :-
>
> struct virtio_blk_lifetime lifetime = { };
>
> -ck
Yes, that's a bit cleaner, but there should be no space between {}:
struct virtio_blk_lifetime lifetime = {};
--
MST
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization