From c920508259451874c48a452302188a1ed4219727 Mon Sep 17 00:00:00 2001 From: Jon Hunter Date: Tue, 15 Feb 2022 10:12:32 +0000 Subject: [PATCH] platform: tegra: cvnas: Fix function declarations Sparse generates the following warnings for the CVNAS driver ... drivers/platform/tegra/cvnas/cvnas.c:126:5: warning: symbol 'nvcvnas_busy' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:138:5: warning: symbol 'nvcvnas_idle' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:444:13: warning: symbol 'nvcvnas_get_cvsram_base' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:456:8: warning: symbol 'nvcvnas_get_cvsram_size' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:468:5: warning: symbol 'is_nvcvnas_probed' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:476:5: warning: symbol 'is_nvcvnas_clk_enabled' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:779:5: warning: symbol 'nvcvnas_busy_no_rpm' was not declared. Should it be static? drivers/platform/tegra/cvnas/cvnas.c:793:5: warning: symbol 'nvcvnas_idle_no_rpm' was not declared. Should it be static? There are a few problems here which are: 1. The CVNAS driver does not include the 'cvnas.h' header file and so some of the declarations are not found. 2. Some of the CVNAS functions are not declared in the 'cvnas.h' header file and need to be added. 3. The Tegra19x CBB driver is a user of these CVNAS functions, but instead of including the 'cvnas.h' file it defines prototypes for these functions. This is not necessary and so we can remove these prototypes and simply include the 'cvnas.h' header file. 4. The function definition nvcvnas_idle_no_rpm() in the CVNAS driver is incorrect and this function should not have any arguments passed to it and currently does not match the prototype. Bug 3528414 Change-Id: I7945f8c66ceb5ca5b158b7ed1b81a50f19c52bb7 Signed-off-by: Jon Hunter Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2670149 Reviewed-by: Ketan Patil Reviewed-by: Sachin Nikam --- drivers/platform/tegra/cvnas/cvnas.c | 3 ++- include/linux/cvnas.h | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/platform/tegra/cvnas/cvnas.c b/drivers/platform/tegra/cvnas/cvnas.c index eae224e3..c3850d20 100644 --- a/drivers/platform/tegra/cvnas/cvnas.c +++ b/drivers/platform/tegra/cvnas/cvnas.c @@ -21,6 +21,7 @@ #define pr_fmt(fmt) "cvnas: %s,%d" fmt, __func__, __LINE__ #include +#include #include #include #include @@ -790,7 +791,7 @@ EXPORT_SYMBOL(nvcvnas_busy_no_rpm); /* * Function to suspend CV without using runtime pm. */ -int nvcvnas_idle_no_rpm(struct device *dev) +int nvcvnas_idle_no_rpm(void) { #ifdef CONFIG_PM_SLEEP if (cvnas_plat_dev && dev_get_drvdata(&cvnas_plat_dev->dev)) diff --git a/include/linux/cvnas.h b/include/linux/cvnas.h index a769106b..54b2d64f 100644 --- a/include/linux/cvnas.h +++ b/include/linux/cvnas.h @@ -3,7 +3,7 @@ * * Tegra cvnas driver * - * Copyright (c) 2018, NVIDIA Corporation. All rights reserved. + * Copyright (c) 2018-2022, NVIDIA Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,9 +20,15 @@ #ifndef __LINUX_CVNAS_H #define __LINUX_CVNAS_H +#include + int nvcvnas_busy(void); +int nvcvnas_busy_no_rpm(void); int nvcvnas_idle(void); +int nvcvnas_idle_no_rpm(void); +int is_nvcvnas_probed(void); phys_addr_t nvcvnas_get_cvsram_base(void); size_t nvcvnas_get_cvsram_size(void); +int is_nvcvnas_clk_enabled(void); #endif