[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZN7BPMra5fC7YBcs@nvidia.com>
Date: Thu, 17 Aug 2023 21:54:20 -0300
From: Jason Gunthorpe <jgg@...dia.com>
To: "Liu, Yi L" <yi.l.liu@...el.com>
Cc: Nicolin Chen <nicolinc@...dia.com>,
"Tian, Kevin" <kevin.tian@...el.com>,
"joro@...tes.org" <joro@...tes.org>,
"alex.williamson@...hat.com" <alex.williamson@...hat.com>,
"robin.murphy@....com" <robin.murphy@....com>,
"baolu.lu@...ux.intel.com" <baolu.lu@...ux.intel.com>,
"cohuck@...hat.com" <cohuck@...hat.com>,
"eric.auger@...hat.com" <eric.auger@...hat.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 v8 3/5] iommufd: Add IOMMU_GET_HW_INFO
On Fri, Aug 18, 2023 at 12:04:29AM +0000, Liu, Yi L wrote:
> > > > +int iommufd_get_hw_info(struct iommufd_ucmd *ucmd)
> > > > +{
> > > > + struct iommu_hw_info *cmd = ucmd->cmd;
> > > > + void __user *user_ptr = u64_to_user_ptr(cmd->data_uptr);
> > > > + const struct iommu_ops *ops;
> > > > + struct iommufd_device *idev;
> > > > + unsigned int data_len;
> > > > + unsigned int copy_len;
> > > > + void *data = NULL;
> > [..]
> > > > + } else {
> > > > + cmd->out_data_type = IOMMU_HW_INFO_TYPE_NONE;
> > > > + data_len = 0;
> > > > + data = NULL;
> > >
> > > data is already initialized as NULL.
>
> Probably we can set data_len = 0 and the out_data_type to _NONE is
> the top as well. Any preference?
I think it is clear to remove the variable initialization so this
branch is more explicit
Jason
Powered by blists - more mailing lists