RE: [PATCH v5 3/4] iommufd: Add IOMMU_GET_HW_INFO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> From: Jason Gunthorpe <jgg@xxxxxxxxxx>
> Sent: Tuesday, August 8, 2023 9:03 PM
> 
> On Mon, Aug 07, 2023 at 08:49:27AM +0000, Liu, Yi L wrote:
> 
> > > > > +	/* driver has hw_info callback should have a unique hw_info_type */
> > > > > +	if (WARN_ON_ONCE(hw_info_type == IOMMU_HW_INFO_TYPE_NONE))
> {
> > > > > +		rc = -ENODEV;
> > > > > +		goto out_err;
> > > > > +	}
> > > > > +
> > > > > +	length = min(cmd->data_len, data_len);
> > > > > +	if (copy_to_user(user_ptr, data, length)) {
> > > > > +		rc = -EFAULT;
> > > > > +		goto out_err;
> > > > > +	}
> > > > > +
> > > > > +done:
> > >
> > > No label here, put it in a if {}
> >
> > How about below?
> 
> Looks better
> 
> You could also consider putting the content of the if {} in a function

Sure.

Regards,
Yi Liu




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux