mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: cleanup based on code inspection
Fix the following issues in Posix utils unit which were identified during code inspection, - Remove the usage of #undef. - Avoid defining reserved identifiers. Jira NVGPU-4993 Change-Id: I16189bfad5bba87ee73a26d61d19caefd5d852c2 Signed-off-by: ajesh <akv@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2292415 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Scott Long <scottl@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
@@ -23,6 +23,8 @@
|
||||
#ifndef NVGPU_POSIX_UTILS_H
|
||||
#define NVGPU_POSIX_UTILS_H
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <nvgpu/static_analysis.h>
|
||||
|
||||
/**
|
||||
@@ -41,13 +43,7 @@
|
||||
(t_a < t_b) ? t_a : t_b; \
|
||||
})
|
||||
|
||||
#if defined(min)
|
||||
#undef min
|
||||
#endif
|
||||
#if defined(max)
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
#ifndef _QNX_SOURCE
|
||||
/**
|
||||
* @brief Minimum of two values.
|
||||
*
|
||||
@@ -56,11 +52,12 @@
|
||||
*
|
||||
* @return Returns the minimum value from \a a and \a b.
|
||||
*/
|
||||
#ifndef min
|
||||
#define min(a, b) \
|
||||
({ \
|
||||
((a) < (b)) ? (a) : (b); \
|
||||
})
|
||||
|
||||
#endif
|
||||
/**
|
||||
* @brief Maximum of two values.
|
||||
*
|
||||
@@ -69,11 +66,13 @@
|
||||
*
|
||||
* @return Returns the maximum value from \a a and \a b.
|
||||
*/
|
||||
#ifndef max
|
||||
#define max(a, b) \
|
||||
({ \
|
||||
((a) > (b)) ? (a) : (b); \
|
||||
})
|
||||
|
||||
#endif
|
||||
#endif
|
||||
/**
|
||||
* @brief Minimum of three values.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user