mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: timers: fix MISRA 5.5 violation
MISRA Rule 5.5 requires identifiers be unique from macro names. The struct timeout member max is renamed to max_attempts to fix the violation. JIRA NVGPU-3374 Change-Id: I701899e38a25b654d5f78feabbb273e21601f313 Signed-off-by: Philip Elcan <pelcan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2118815 GVS: Gerrit_Virtual_Submit Reviewed-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-by: Vinod Gopalakrishnakurup <vinodg@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
bb1ca4fef5
commit
e0fa45135a
@@ -59,7 +59,7 @@ struct nvgpu_timeout {
|
||||
union {
|
||||
s64 time;
|
||||
struct {
|
||||
u32 max;
|
||||
u32 max_attempts;
|
||||
u32 attempted;
|
||||
} retries;
|
||||
};
|
||||
|
||||
@@ -67,7 +67,7 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
|
||||
timeout->flags = flags;
|
||||
|
||||
if (flags & NVGPU_TIMER_RETRY_TIMER)
|
||||
timeout->retries.max = duration;
|
||||
timeout->retries.max_attempts = duration;
|
||||
else
|
||||
timeout->time = ktime_to_ns(ktime_add_ns(ktime_get(),
|
||||
(s64)NSEC_PER_MSEC * duration));
|
||||
@@ -109,7 +109,7 @@ static int nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
|
||||
if (nvgpu_timeout_is_pre_silicon(timeout))
|
||||
return 0;
|
||||
|
||||
if (timeout->retries.attempted >= timeout->retries.max) {
|
||||
if (timeout->retries.attempted >= timeout->retries.max_attempts) {
|
||||
if (!(timeout->flags & NVGPU_TIMER_SILENT_TIMEOUT)) {
|
||||
char buf[128];
|
||||
|
||||
@@ -173,7 +173,8 @@ int nvgpu_timeout_peek_expired(struct nvgpu_timeout *timeout)
|
||||
return 0;
|
||||
|
||||
if (timeout->flags & NVGPU_TIMER_RETRY_TIMER)
|
||||
return timeout->retries.attempted >= timeout->retries.max;
|
||||
return timeout->retries.attempted >=
|
||||
timeout->retries.max_attempts;
|
||||
else
|
||||
return ktime_after(ktime_get(), ns_to_ktime(timeout->time));
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ int nvgpu_timeout_init(struct gk20a *g, struct nvgpu_timeout *timeout,
|
||||
timeout->flags = (unsigned int)flags;
|
||||
|
||||
if ((flags & NVGPU_TIMER_RETRY_TIMER) != 0U) {
|
||||
timeout->retries.max = duration;
|
||||
timeout->retries.max_attempts = duration;
|
||||
} else {
|
||||
duration_ns = (s64)duration;
|
||||
duration_ns *= NSEC_PER_MSEC;
|
||||
@@ -122,7 +122,7 @@ static int nvgpu_timeout_expired_msg_retry(struct nvgpu_timeout *timeout,
|
||||
{
|
||||
struct gk20a *g = timeout->g;
|
||||
|
||||
if (timeout->retries.attempted >= timeout->retries.max) {
|
||||
if (timeout->retries.attempted >= timeout->retries.max_attempts) {
|
||||
if ((timeout->flags & NVGPU_TIMER_SILENT_TIMEOUT) == 0U) {
|
||||
char buf[128];
|
||||
|
||||
@@ -162,7 +162,7 @@ int nvgpu_timeout_peek_expired(struct nvgpu_timeout *timeout)
|
||||
{
|
||||
if ((timeout->flags & NVGPU_TIMER_RETRY_TIMER) != 0U) {
|
||||
return (int) (timeout->retries.attempted >=
|
||||
timeout->retries.max);
|
||||
timeout->retries.max_attempts);
|
||||
} else {
|
||||
return (int) (time_after(get_time_ns(), timeout->time));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user