gpu: nvgpu: fix MISRA issues nvgpu.common.clk_arb

MISRA Rule 5.7 doesn't allow reuse of variable or tag name.
MISRA Rule 21.x forbids use of identifiers beginning with an underscore.

This patch resolves MISRA violations in nvgpu.common.clk_arb for above
mentioned rules.

Jira NVGPU-3740

Change-Id: I73234d1a9e1c98812620dd1c3b9a80426742e747
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2151248
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Vedashree Vidwans
2019-07-10 14:02:21 -07:00
committed by mobile promotions
parent e34b6f76d3
commit 280dceb864
3 changed files with 6 additions and 5 deletions

View File

@@ -274,7 +274,7 @@ u32 nvgpu_clk_arb_notify(struct nvgpu_clk_dev *dev,
head = (tail - head) < arb->notification_queue.size ?
head : tail - arb->notification_queue.size;
for (index = head; _WRAPGTEQ(tail, index); index++) {
for (index = head; WRAPGTEQ(tail, index); index++) {
u32 alarm_detected;
l_notification = &arb->notification_queue.

View File

@@ -49,7 +49,8 @@ struct nvgpu_clk_notification_queue;
struct nvgpu_clk_session;
#define VF_POINT_INVALID_PSTATE ~0U
#define VF_POINT_SET_PSTATE_SUPPORTED(a, b) ((a)->pstates |= (BIT16(b)))
#define VF_POINT_SET_PSTATE_SUPPORTED(a, b) \
((a)->clk_vf_point_pstates |= (BIT16(b)))
#define VF_POINT_GET_PSTATE(a) (((a)->pstates) ?\
(nvgpu_fls((a)->pstates) - 1UL) :\
VF_POINT_INVALID_PSTATE)
@@ -92,7 +93,7 @@ struct nvgpu_clk_session;
#define LOCAL_ALARM_MASK (EVENT(ALARM_LOCAL_TARGET_VF_NOT_POSSIBLE) | \
EVENT(VF_UPDATE))
#define _WRAPGTEQ(a, b) (((a)-(b)) > (typeof(a))0)
#define WRAPGTEQ(a, b) (((a)-(b)) > (typeof(a))0)
/*
* NVGPU_POLL* defines equivalent to the POLL* linux defines
@@ -132,7 +133,7 @@ struct nvgpu_clk_notification_queue {
};
struct nvgpu_clk_vf_point {
u16 pstates;
u16 clk_vf_point_pstates;
union {
struct {
u16 gpc_mhz;

View File

@@ -172,7 +172,7 @@ static inline u32 __pending_event(struct nvgpu_clk_dev *dev,
head = (tail - head) < dev->queue.size ? head : tail - dev->queue.size;
if (_WRAPGTEQ(tail, head) && info) {
if (WRAPGTEQ(tail, head) && info) {
head++;
p_notif = &dev->queue.clk_q_notifications[
head % dev->queue.size];