File drivers-pva-Fix-build-for-Linux-v6.11.patch of Package nvidia-jetson-36_3

From 42263f1dfe64e1ff08a906ce1c4bc12346c128ed Mon Sep 17 00:00:00 2001
From: Jon Hunter <jonathanh@nvidia.com>
Date: Mon, 29 Jul 2024 13:12:19 +0100
Subject: [PATCH] drivers: pva: Fix build for Linux v6.11

In Linux v6.11, commit 1a251f52cfdc ("minmax: make generic MIN() and
MAX() macros available everywhere") causes the PVA driver build to fail
with the following error:

 include/uapi/linux/nvpva_ioctl.h:601: error: "MAX" redefined [-Werror]
 601 | #define MAX(a, b) ((a) > (b) ? (a) : (b))

Fix this by add guards around the definition of 'MAX' in the
nvpva_ioctl.h file.

Bug 4749580

Change-Id: If7960e0617e659f4e264b1e638e9f8c98a027a73
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3184093
(cherry picked from commit d8bc5883f336b61d9659858b7b46be1135e80d2f)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3185779
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
---
 include/uapi/linux/nvpva_ioctl.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/uapi/linux/nvpva_ioctl.h b/include/uapi/linux/nvpva_ioctl.h
index f8d5ca70..8f434a29 100644
--- a/include/uapi/linux/nvpva_ioctl.h
+++ b/include/uapi/linux/nvpva_ioctl.h
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-only */
 /*
- * Copyright (c) 2021-2023, NVIDIA Corporation.  All rights reserved.
+ * SPDX-FileCopyrightText: Copyright (c) 2021-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
  *
  * Tegra PVA Driver ioctls
  */
@@ -597,7 +597,9 @@ union nvpva_set_vpu_print_buffer_size_args {
 
 #define NVPVA_IOCTL_NUMBER_MAX 12
 
+#ifndef MAX
 #define MAX(a, b) ((a) > (b) ? (a) : (b))
+#endif
 #define NVPVA_IOCTL_MAX_SIZE                                 \
 	    MAX(sizeof(union nvpva_vpu_exe_register_args), \
 	    MAX(sizeof(union nvpva_vpu_exe_unregister_args), \
-- 
2.43.0

openSUSE Build Service is sponsored by