misc: nvsciipc: Fix build for Linux v6.12

In Linux v6.12, commit 88a2f6468d01 ("struct fd: representation change")
removed the 'struct file' pointer from 'struct fd'. This breaks building
the NVSCIIPC driver that tries to directly access the 'file' pointer
from the 'fd' structure. Fix this by using the helper macros 'fd_empty'
and 'fd_file' as necessary to fix the build.

Bug 4593750

Change-Id: I0f84736b408f533a732476175a8745091bc8542f
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217429
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-09-17 17:30:02 +01:00
parent c69cddda5d
commit 7adb4caf5b
3 changed files with 45 additions and 0 deletions

View File

@@ -84,11 +84,20 @@ NvSciError NvSciIpcEndpointValidateAuthTokenLinuxCurrent(
}
f = fdget((int)authToken);
#if defined(NV_FD_EMPTY_PRESENT) /* Linux v6.12 */
if (fd_empty(f)) {
#else
if (!f.file) {
#endif
ERR("invalid auth token\n");
return NvSciError_BadParameter;
}
#if defined(NV_FD_FILE_PRESENT) /* Linux v6.12 */
filp = fd_file(f);
#else
filp = f.file;
#endif
devlen = strlen(filp->f_path.dentry->d_name.name);
#if DEBUG_VALIDATE_TOKEN