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
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Omar Nemri <onemri@nvidia.com>
This commit is contained in:
Jon Hunter
2024-07-29 13:12:19 +01:00
committed by mobile promotions
parent 8f1e881a2f
commit d8bc5883f3

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */ /* 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 * Tegra PVA Driver ioctls
*/ */
@@ -598,7 +598,9 @@ union nvpva_set_vpu_print_buffer_size_args {
#define NVPVA_IOCTL_NUMBER_MAX 12 #define NVPVA_IOCTL_NUMBER_MAX 12
#ifndef MAX
#define MAX(a, b) ((a) > (b) ? (a) : (b)) #define MAX(a, b) ((a) > (b) ? (a) : (b))
#endif
#define NVPVA_IOCTL_MAX_SIZE \ #define NVPVA_IOCTL_MAX_SIZE \
MAX(sizeof(union nvpva_vpu_exe_register_args), \ MAX(sizeof(union nvpva_vpu_exe_register_args), \
MAX(sizeof(union nvpva_vpu_exe_unregister_args), \ MAX(sizeof(union nvpva_vpu_exe_unregister_args), \