gpu: nvgpu: fix MISRA violations in timers unit

MISRA rule 21.2 forbids the usage of identifier names which start with
an underscore.  Fix the violations of MISRA rule 21.2 in timers unit.

Jira NVGPU-3139

Change-Id: I507d0f2a51e83ce24d642dcc81975aa513fa41eb
Signed-off-by: ajesh <akv@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2112599
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
ajesh
2019-05-06 11:48:45 +05:30
committed by mobile promotions
parent 38bc7e3b7e
commit fe9f1e9e5c
3 changed files with 18 additions and 18 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-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"),
@@ -86,16 +86,16 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
int nvgpu_timeout_peek_expired(struct nvgpu_timeout *timeout);
#define nvgpu_timeout_expired(__timeout) \
__nvgpu_timeout_expired_msg(__timeout, _NVGPU_GET_IP_, "")
nvgpu_timeout_expired_msg_impl(__timeout, _NVGPU_GET_IP_, "")
#define nvgpu_timeout_expired_msg(__timeout, fmt, args...) \
__nvgpu_timeout_expired_msg(__timeout, _NVGPU_GET_IP_, \
nvgpu_timeout_expired_msg_impl(__timeout, _NVGPU_GET_IP_, \
fmt, ##args)
/*
* Don't use this directly.
*/
int __nvgpu_timeout_expired_msg(struct nvgpu_timeout *timeout,
int nvgpu_timeout_expired_msg_impl(struct nvgpu_timeout *timeout,
void *caller, const char *fmt, ...);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2016-2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -75,7 +75,7 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
return 0;
}
static int __nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout,
static int nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout,
void *caller,
const char *fmt, va_list args)
{
@@ -100,7 +100,7 @@ static int __nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout,
return 0;
}
static int __nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
static int nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
void *caller,
const char *fmt, va_list args)
{
@@ -127,7 +127,7 @@ static int __nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
}
/**
* __nvgpu_timeout_expired_msg - Check if a timeout has expired.
* nvgpu_timeout_expired_msg_impl - Check if a timeout has expired.
*
* @timeout - The timeout to check.
* @caller - Address of the caller of this function.
@@ -138,7 +138,7 @@ static int __nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
* If a timeout occurs and %NVGPU_TIMER_SILENT_TIMEOUT is not set in the timeout
* then a message is printed based on %fmt.
*/
int __nvgpu_timeout_expired_msg(struct nvgpu_timeout *timeout,
int nvgpu_timeout_expired_msg_impl(struct nvgpu_timeout *timeout,
void *caller, const char *fmt, ...)
{
int ret;
@@ -146,10 +146,10 @@ int __nvgpu_timeout_expired_msg(struct nvgpu_timeout *timeout,
va_start(args, fmt);
if (timeout->flags & NVGPU_TIMER_RETRY_TIMER)
ret = __nvgpu_timeout_expired_msg_retry(timeout, caller, fmt,
ret = nvgpu_timeout_expired_msg_retry(timeout, caller, fmt,
args);
else
ret = __nvgpu_timeout_expired_msg_cpu(timeout, caller, fmt,
ret = nvgpu_timeout_expired_msg_cpu(timeout, caller, fmt,
args);
va_end(args);

View File

@@ -34,7 +34,7 @@
#define NSEC_PER_MSEC 1000000
#define NSEC_PER_SEC 1000000000
static inline s64 __nvgpu_current_time_us(void)
static inline s64 nvgpu_current_time_us(void)
{
struct timeval now;
s64 time_now;
@@ -95,7 +95,7 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
return 0;
}
static int __nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout,
static int nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout,
void *caller,
const char *fmt, va_list args)
{
@@ -116,7 +116,7 @@ static int __nvgpu_timeout_expired_msg_cpu(struct nvgpu_timeout *timeout,
return 0;
}
static int __nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
static int nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
void *caller,
const char *fmt, va_list args)
{
@@ -139,7 +139,7 @@ static int __nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
return 0;
}
int __nvgpu_timeout_expired_msg(struct nvgpu_timeout *timeout,
int nvgpu_timeout_expired_msg_impl(struct nvgpu_timeout *timeout,
void *caller, const char *fmt, ...)
{
int ret;
@@ -147,10 +147,10 @@ int __nvgpu_timeout_expired_msg(struct nvgpu_timeout *timeout,
va_start(args, fmt);
if ((timeout->flags & NVGPU_TIMER_RETRY_TIMER) != 0U) {
ret = __nvgpu_timeout_expired_msg_retry(timeout, caller, fmt,
ret = nvgpu_timeout_expired_msg_retry(timeout, caller, fmt,
args);
} else {
ret = __nvgpu_timeout_expired_msg_cpu(timeout, caller, fmt,
ret = nvgpu_timeout_expired_msg_cpu(timeout, caller, fmt,
args);
}
va_end(args);
@@ -226,5 +226,5 @@ s64 nvgpu_current_time_ns(void)
u64 nvgpu_hr_timestamp(void)
{
return (u64)__nvgpu_current_time_us();
return (u64)nvgpu_current_time_us();
}