Re: [PATCH v1 1/9] drivers: hv: dxgkrnl: Driver initialization and creation of dxgadapter

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

 



On Wed, Jan 12, 2022 at 11:55:06AM -0800, Iouri Tarassov wrote:
> +	dev_dbg(dxgglobaldev, "%s: %x:%x %p %pUb\n",
> +		    __func__, adapter->luid.b, adapter->luid.a, hdev->channel,
> +		    &hdev->channel->offermsg.offer.if_instance);

When I see something like "global device pointer", that is a HUGE red
flag.

No driver should ever have anything that is static to the driver like
this, it should always be per-device.  Please use the correct device
model here, which does not include a global pointer, but rather unique
ones that are given to you by the driver core.  That way you are never
tied to only "one device per system" as that is a constraint that you
will have to fix eventually, might as well do it all correctly the first
time as it is not any extra effort to do so.

thanks,

greg k-h



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux