gpu: nvgpu: fix CERT-C EXP36-C issue in posix utils

Use uintptr_t for for pointer arithmmatic instead of char *
to fix following CERT-C violations.
cert_exp36_c_violation: Pointer "char *" is more strictly aligned
 than pointer "struct gk20a_event_id_data_rmos const *".

cert_exp36_c_violation: Pointer "struct nvgpu_clk_dev_rmos *" is
 more strictly aligned than pointer "char *".

JIRA NVGPU-3908
JIRA NVGPU-3561

Change-Id: I9d40b3337ed0ddaf172ad4f4c9dd319996d479a1
Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2197151
Reviewed-by: Scott Long <scottl@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Nitin Kumbhar
2019-09-13 15:20:25 +05:30
committed by Alex Waterman
parent ecc3ad902f
commit bd2334d79d

View File

@@ -257,7 +257,7 @@ static inline unsigned int nvgpu_posix_hweight64(uint64_t x)
#define container_of(ptr, type, member) ({ \
typeof(((type *)0)->member) *__mptr = (ptr); \
(type *)((char *)__mptr - offsetof(type, member)); })
(type *)((uintptr_t)__mptr - offsetof(type, member)); })
#define MAX_ERRNO 4095