From 1e3cac3bc8525326f1a15beeef71bfa1930be579 Mon Sep 17 00:00:00 2001 From: Vedashree Vidwans Date: Thu, 11 Apr 2019 14:25:00 -0700 Subject: [PATCH] gpu: nvgpu: Fix MISRA rule 8.2 MISRA rule 8.2 requires function prototypes to have defined and named parameters. This avoids undefined behavior and ensures variable type check. Specifying parameter name can provide more information. Jira NVGPU-861 Change-Id: I7c4669c2b2c57336e0f978d7e67425bf2687fbad Signed-off-by: Vedashree Vidwans Reviewed-on: https://git-master.nvidia.com/r/2095656 Reviewed-by: svc-misra-checker Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/nvhost.h | 5 +++-- drivers/gpu/nvgpu/os/posix/posix-nvhost.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h index 74dc48b5c..dd2e64d2e 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/nvhost.h +++ b/drivers/gpu/nvgpu/include/nvgpu/nvhost.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -58,7 +58,8 @@ void nvgpu_nvhost_syncpt_set_safe_state( struct nvgpu_nvhost_dev *nvhost_dev, u32 id); int nvgpu_nvhost_intr_register_notifier(struct nvgpu_nvhost_dev *nvhost_dev, - u32 id, u32 thresh, void (*callback)(void *, int), void *private_data); + u32 id, u32 thresh, void (*callback)(void *priv, int nr_completed), + void *private_data); const char *nvgpu_nvhost_syncpt_get_name(struct nvgpu_nvhost_dev *nvhost_dev, int id); diff --git a/drivers/gpu/nvgpu/os/posix/posix-nvhost.c b/drivers/gpu/nvgpu/os/posix/posix-nvhost.c index 25ee702bc..53d75171c 100644 --- a/drivers/gpu/nvgpu/os/posix/posix-nvhost.c +++ b/drivers/gpu/nvgpu/os/posix/posix-nvhost.c @@ -84,7 +84,7 @@ u32 nvgpu_nvhost_syncpt_incr_max_ext( int nvgpu_nvhost_intr_register_notifier( struct nvgpu_nvhost_dev *nvhost_dev, u32 id, u32 thresh, - void (*callback)(void *, int), void *private_data) + void (*callback)(void *priv, int nr_completed), void *private_data) { BUG(); return 0;