Kernel 5.14.2: Reworked and updated patch
While compiling this driver against the latest kernel 5.14.2
, I encountered a few possibilities for improving the patch the driver needs for this kernel.
- I saw that there was some redundancy in the code.
os_delay()
inos-interface.c
andnvlink_sleep()
innvlink_linux.c
were actually the same code. Consequently, this already has been fixed by the Nvidia folks in later driver versions: they moved this function intonv-time.h
and added an#include
in bothnvlink_linux.c
andos-interface.c
. - Out of curiosity, I also had a look at the warnings that appear when compiling the driver. There's actually two of them, one about a direct cast from
int
tovoid*
, and the other one about a directive that could fall through. While thefallthrough
appears to be intended (you will find a comment in later driver versions), the warning about the typecast pointed me to a few leftovers from patches for former kernel versions. I verified that they can be safely removed for kernel5.14.2
. Please see the updated patch in the attachment.kernel-5.14.2.patch