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

@@ -243,7 +243,7 @@ static void nvgpu_init_mm_vars(struct gk20a *g)
int nvgpu_probe(struct gk20a *g,
const char *debugfs_symlink,
const char *interface_name,
struct class *class)
struct class *device_class)
{
struct device *dev = dev_from_gk20a(g);
struct gk20a_platform *platform = dev_get_drvdata(dev);
@@ -275,7 +275,7 @@ int nvgpu_probe(struct gk20a *g,
nvgpu_init_mm_vars(g);
/* platform probe can defer do user init only if probe succeeds */
err = gk20a_user_init(dev, interface_name, class);
err = gk20a_user_init(dev, interface_name, device_class);
if (err)
return err;
@@ -317,5 +317,5 @@ static void nvgpu_free_gk20a(struct gk20a *g)
void nvgpu_init_gk20a(struct gk20a *g)
{
g->free = nvgpu_free_gk20a;
g->gfree = nvgpu_free_gk20a;
}