From d8bc5883f336b61d9659858b7b46be1135e80d2f Mon Sep 17 00:00:00 2001 From: Jon Hunter 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 Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3184093 GVS: buildbot_gerritrpt Reviewed-by: Omar Nemri --- 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 73a9c1e8..d94dddf3 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 */ @@ -598,7 +598,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), \