mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
MISRA Rule 11.8 states that a cast shall not remove any const or volatile qualification from the type pointed to by a pointer. The linux kernel's container_of() macro contains such a violation as it generates a pointer to a caller-specified (and so possibly non-const qualified) type by casting an internally declared const pointer. The gk20a_from_pmu() uses the container_of() macro to convert from a struct nvgpu_pmu pointer to a struct gk20a pointer. The struct nvgpu_pmu has a back pointer to struct gk20a already however and so this change modifies gk20a_from_gpu() to just return this back pointer rather than use container_of(). JIRA NVGPU-862 Change-Id: If0e2481c1cf104c2fa6b89334e20e75705bf9c44 Signed-off-by: Scott Long <scottl@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1955540 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>