From fe9f1e9e5cdb341e2f1bdda9f413ceb530517a70 Mon Sep 17 00:00:00 2001 From: ajesh Date: Mon, 6 May 2019 11:48:45 +0530 Subject: [PATCH] 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 Reviewed-on: https://git-master.nvidia.com/r/2112599 Reviewed-by: svc-mobile-coverity Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/timers.h | 8 ++++---- drivers/gpu/nvgpu/os/linux/timers.c | 14 +++++++------- drivers/gpu/nvgpu/os/posix/timers.c | 14 +++++++------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/timers.h b/drivers/gpu/nvgpu/include/nvgpu/timers.h index 9b1825510..684665b7d 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/timers.h +++ b/drivers/gpu/nvgpu/include/nvgpu/timers.h @@ -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, ...); diff --git a/drivers/gpu/nvgpu/os/linux/timers.c b/drivers/gpu/nvgpu/os/linux/timers.c index 8d8d28ec6..af52277f4 100644 --- a/drivers/gpu/nvgpu/os/linux/timers.c +++ b/drivers/gpu/nvgpu/os/linux/timers.c @@ -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); diff --git a/drivers/gpu/nvgpu/os/posix/timers.c b/drivers/gpu/nvgpu/os/posix/timers.c index f24b5886b..a30ff052d 100644 --- a/drivers/gpu/nvgpu/os/posix/timers.c +++ b/drivers/gpu/nvgpu/os/posix/timers.c @@ -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(); }