gpu: nvgpu: fix MISRA violations in utils unit

Rule 21.1 states that #define and #undef shall not be used on a
reserved identifier or reserved macro name.
Rule 21.2 states that a reserved identifier or macro name shall
not be declared.
Fix violations of the above rules in utils unit.

Jira NVGPU-3878

Change-Id: I4302c498f5fb533699d2e53b9d1ffe1e7ccf53f2
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2194035
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
ajesh
2019-09-10 12:49:07 +05:30
committed by Alex Waterman
parent 54f67e1861
commit ca39cacdaf
6 changed files with 79 additions and 76 deletions

View File

@@ -235,14 +235,16 @@ static inline unsigned int nvgpu_posix_hweight64(uint64_t x)
* here.
*/
#define __must_check __attribute__((warn_unused_result))
#define __maybe_unused __attribute__((unused))
#define __iomem
#ifndef __user
#define __user
#else
#error "__user already defined !!"
#endif
#define unlikely(x) (x)
#define likely(x) (x)
#define __stringify(x) #x
/*
* Prevent compiler optimizations from mangling writes. But likely most uses of
* this in nvgpu are incorrect (i.e unnecessary).
@@ -257,8 +259,6 @@ static inline unsigned int nvgpu_posix_hweight64(uint64_t x)
const typeof(((type *)0)->member) *__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); })
#define __packed __attribute__((packed))
#define MAX_ERRNO 4095
#define ERESTARTSYS ERESTART