Re: [RFC V2] drivers/virt/vSMP: new driver

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

 



>From: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
>Sent: Sunday, April 24, 2022 16:40
>To: Czerwacki, Eial <eial.czerwacki@xxxxxxx>
>Cc: linux-staging@xxxxxxxxxxxxxxx <linux-staging@xxxxxxxxxxxxxxx>; SAP vSMP Linux Maintainer <linux.vsmp@xxxxxxx>
>Subject: Re: [RFC V2] drivers/virt/vSMP: new driver 
> 
>On Sun, Apr 24, 2022 at 11:44:33AM +0000, Czerwacki, Eial wrote:
[snip]

>> +static struct kobject *vsmp_sysfs_kobj;
>> +static struct pci_dev *vsmp_dev_obj;
>
>static variables are not global :)
>
>And you should not need this, again, use the proper PCI api insted.
>
[snip]

>
>Do not use global data for anything, that's a huge hint that your driver
>is incorrectly written.
>
[snip]

>
>greg k-h

I understand the logic behind that, however, I'm not sure I understand what PCI api I can use to replace such vars?
for example for the pci_dev struct of the device or the sysfs object which is used for the other modules
is there a doc on this I can be pointed to?
as for saving the iomapping, I assume that I should map the bar regions rather than having it mapped all the time, am I right?

Eial




[Index of Archives]     [Linux Driver Development]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux