Thanks for your comments.

> > +     /* Pass the data to the user */
> > +     if (copy_to_user((void __user *)arg, &lifetime, sizeof(lifetime))) {
> > +             ret = -EFAULT;
> > +             goto out;
>
>
> there nothing here to "goto out" following is sufficient I guess :-


You're right, but like Michael said, it will be pretty easy to forget
adding a goto statement if adding more code to the function.

> > +     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 = { };


>
> Yes, that's a bit cleaner, but there should be no space between {}:
>         struct virtio_blk_lifetime lifetime = {};


I will fix it in the next version.

Alvaro
_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reply via email to