Re: [PATCH v4 1/1] vfio/nvgpu: Add vfio pci variant module for grace hopper

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

 



On Fri, Jun 23, 2023 at 03:04:17PM +0200, Cédric Le Goater wrote:
> On 6/23/23 13:47, Jason Gunthorpe wrote:
> > On Fri, Jun 23, 2023 at 08:27:17AM +0200, Cédric Le Goater wrote:
> > > > +	req_len = vma->vm_end - vma->vm_start;
> > > > +	pgoff = vma->vm_pgoff &
> > > > +		((1U << (VFIO_PCI_OFFSET_SHIFT - PAGE_SHIFT)) - 1);
> > > > +	if (pgoff >= (nvdev->mem_prop.mem_length >> PAGE_SHIFT))
> > > > +		return -EINVAL;
> > > 
> > > you cound introduce accessor macros for nvdev->mem_prop.mem_length and
> > > nvdev->mem_prop.hpa
> > 
> > Accessors are not the usual style..
> 
> I meant something like
> 
>   #define nvgpu_mem_size(nvdev) (nvdev)->mem_prop.mem_length
>   #define nvgpu_mem_pa_base(nvdev) (nvdev)->mem_prop.hpa
> 
> This is minor.

Yeah, this is what I thought you ment, I'm against this kind of
obfuscation in the kernel without a very strong purpose, and if you do
something like this it should be a static inline function.

Jason



[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