mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 18:16:01 +03:00
While not necessary for MISRA compliance purposes, this change
modifies the linux platform clk code use of container_of() to follow
similar changes applied to address the following rule violations:
* Rule 11.3 : A cast shall not be performed between a pointer to
object type and a pointer to a different object type.
* Rule 11.8 : A cast shall not remove any const or volatile
qualification from the type pointed to be a pointer.
* Rule 20.7 : Expressions resulting from the expansion of macro
parameters shall be enclosed in parentheses.
This patch replaces the to_clk_gk20a() macro with a new (static)
clk_gk20a_from_hw() function that eliminates the Rule 11.8 and
Rule 20.7 violations and exchanges the Rule 11.3 violation with
an advisory Rule 11.4 violation.
It should be noted that the replacement function still contains
potentially dangerous (and non-MISRA compliant code) and that it is
expected that deviation requests will be filed for the new advisory
rule violations where appropriate.
JIRA NVGPU-782
Change-Id: Ia702cca1e3fc1a57771d0d6db2fd3b4788ac49b8
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1995893
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
3.5 KiB
3.5 KiB