diff mbox series

[06/38] media: venus: place extern venus_fw_debug on a header file

Message ID 64a99ecb3e7cfae697a16c6b6ca05034f73ad985.1599062230.git.mchehab+huawei@kernel.org (mailing list archive)
State New, archived
Headers show
Series media sparse/smatch warn fixes | expand

Commit Message

Mauro Carvalho Chehab Sept. 2, 2020, 4:10 p.m. UTC
Sparse warns about this symbol:

	drivers/media/platform/qcom/venus/hfi_venus.c:133:5:  warning: symbol 'venus_fw_debug' was not declared. Should it be static?

Because hfi_venus.c doesn't include a header file with the
extern. So, move it to core.h, with is included by both
hfi_venus.c and dbgfs.c.

This way, if something changes with it, warnings or errors
will be produced.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/media/platform/qcom/venus/core.h  | 2 ++
 drivers/media/platform/qcom/venus/dbgfs.c | 2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Stanimir Varbanov Sept. 10, 2020, 10:45 a.m. UTC | #1
Hi Mauro,

Thanks for the fix!

On 9/2/20 7:10 PM, Mauro Carvalho Chehab wrote:
> Sparse warns about this symbol:
> 
> 	drivers/media/platform/qcom/venus/hfi_venus.c:133:5:  warning: symbol 'venus_fw_debug' was not declared. Should it be static?
> 
> Because hfi_venus.c doesn't include a header file with the
> extern. So, move it to core.h, with is included by both
> hfi_venus.c and dbgfs.c.
> 
> This way, if something changes with it, warnings or errors
> will be produced.
> 
> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
> ---
>  drivers/media/platform/qcom/venus/core.h  | 2 ++
>  drivers/media/platform/qcom/venus/dbgfs.c | 2 --
>  2 files changed, 2 insertions(+), 2 deletions(-)

Acked-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>

> 
> diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
> index 8e75a199f9f7..1a7aee7ee628 100644
> --- a/drivers/media/platform/qcom/venus/core.h
> +++ b/drivers/media/platform/qcom/venus/core.h
> @@ -24,6 +24,8 @@
>  #define VIDC_VCODEC_CLKS_NUM_MAX	2
>  #define VIDC_PMDOMAINS_NUM_MAX		3
>  
> +extern int venus_fw_debug;
> +
>  struct freq_tbl {
>  	unsigned int load;
>  	unsigned long freq;
> diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c
> index 782d54ac1b8f..52de47f2ca88 100644
> --- a/drivers/media/platform/qcom/venus/dbgfs.c
> +++ b/drivers/media/platform/qcom/venus/dbgfs.c
> @@ -7,8 +7,6 @@
>  
>  #include "core.h"
>  
> -extern int venus_fw_debug;
> -
>  void venus_dbgfs_init(struct venus_core *core)
>  {
>  	core->root = debugfs_create_dir("venus", NULL);
>
diff mbox series

Patch

diff --git a/drivers/media/platform/qcom/venus/core.h b/drivers/media/platform/qcom/venus/core.h
index 8e75a199f9f7..1a7aee7ee628 100644
--- a/drivers/media/platform/qcom/venus/core.h
+++ b/drivers/media/platform/qcom/venus/core.h
@@ -24,6 +24,8 @@ 
 #define VIDC_VCODEC_CLKS_NUM_MAX	2
 #define VIDC_PMDOMAINS_NUM_MAX		3
 
+extern int venus_fw_debug;
+
 struct freq_tbl {
 	unsigned int load;
 	unsigned long freq;
diff --git a/drivers/media/platform/qcom/venus/dbgfs.c b/drivers/media/platform/qcom/venus/dbgfs.c
index 782d54ac1b8f..52de47f2ca88 100644
--- a/drivers/media/platform/qcom/venus/dbgfs.c
+++ b/drivers/media/platform/qcom/venus/dbgfs.c
@@ -7,8 +7,6 @@ 
 
 #include "core.h"
 
-extern int venus_fw_debug;
-
 void venus_dbgfs_init(struct venus_core *core)
 {
 	core->root = debugfs_create_dir("venus", NULL);