[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Tue, 8 Aug 2023 15:36:01 +0000
From: "Liu, Yi L" <yi.l.liu@...el.com>
To: Jason Gunthorpe <jgg@...dia.com>
CC: Baolu Lu <baolu.lu@...ux.intel.com>,
"joro@...tes.org" <joro@...tes.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
"robin.murphy@....com" <robin.murphy@....com>,
"cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.com>,
"nicolinc@...dia.com" <nicolinc@...dia.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"mjrosato@...ux.ibm.com" <mjrosato@...ux.ibm.com>,
"chao.p.peng@...ux.intel.com" <chao.p.peng@...ux.intel.com>,
"yi.y.sun@...ux.intel.com" <yi.y.sun@...ux.intel.com>,
"peterx@...hat.com" <peterx@...hat.com>,
"jasowang@...hat.com" <jasowang@...hat.com>,
"shameerali.kolothum.thodi@...wei.com"
<shameerali.kolothum.thodi@...wei.com>,
"lulu@...hat.com" <lulu@...hat.com>,
"suravee.suthikulpanit@....com" <suravee.suthikulpanit@....com>,
"iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"Duan, Zhenzhong" <zhenzhong.duan@...el.com>
Subject: RE: [PATCH v5 3/4] iommufd: Add IOMMU_GET_HW_INFO
> From: Jason Gunthorpe <jgg@...dia.com>
> 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
Powered by blists - more mailing lists