gpu: nvgpu: common: fix MISRA violations

Fix 8.2 violation for not specifying parameter name in prototype of
secure_alloc().

Fix 21.3 & 21.8 violations for using reserved names "free" and "exit."

Fix 8.6 and 21.2 violations for __gk20a_do_idle() and
__gk20a_do_unidle() by renaming the functions and wrapping them in a
missing #ifdef CONFIG_PM.

Fix 5.7 violation for reusing "class" as parameter name when already
defined as a struct.

JIRA NVGPU-3343

Change-Id: I976e95a32868fa0a657f4baf0845a32bd7aceb9e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2117913
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-05-13 12:46:21 -04:00
committed by mobile promotions
parent 78c7e601f8
commit 5c09935297
6 changed files with 26 additions and 25 deletions

View File

@@ -769,7 +769,7 @@ static ssize_t force_idle_store(struct device *dev,
if (g->forced_idle)
return count; /* do nothing */
else {
err = __gk20a_do_idle(g, false);
err = gk20a_do_idle_impl(g, false);
if (!err) {
g->forced_idle = 1;
nvgpu_info(g, "gpu is idle : %d",
@@ -780,7 +780,7 @@ static ssize_t force_idle_store(struct device *dev,
if (!g->forced_idle)
return count; /* do nothing */
else {
err = __gk20a_do_unidle(g);
err = gk20a_do_unidle_impl(g);
if (!err) {
g->forced_idle = 0;
nvgpu_info(g, "gpu is idle : %d",