2023-04-04 18:45:06

by Tom Rix

[permalink] [raw]
Subject: [PATCH] nvmem: imx-ocotp: set varaiable imx_ocotp_layout storage-class-specifier to static

smatch reports
drivers/nvmem/imx-ocotp.c:599:21: warning: symbol
'imx_ocotp_layout' was not declared. Should it be static?

This variable is only used in one file so should be static.

Signed-off-by: Tom Rix <[email protected]>
---
drivers/nvmem/imx-ocotp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
index ac0edb6398f1..fcea9c04be96 100644
--- a/drivers/nvmem/imx-ocotp.c
+++ b/drivers/nvmem/imx-ocotp.c
@@ -596,7 +596,7 @@ static void imx_ocotp_fixup_cell_info(struct nvmem_device *nvmem,
cell->read_post_process = imx_ocotp_cell_pp;
}

-struct nvmem_layout imx_ocotp_layout = {
+static struct nvmem_layout imx_ocotp_layout = {
.fixup_cell_info = imx_ocotp_fixup_cell_info,
};

--
2.27.0


2023-05-09 09:26:58

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH] nvmem: imx-ocotp: set varaiable imx_ocotp_layout storage-class-specifier to static



On 04/04/2023 19:31, Tom Rix wrote:
> smatch reports
> drivers/nvmem/imx-ocotp.c:599:21: warning: symbol
> 'imx_ocotp_layout' was not declared. Should it be static?
>
> This variable is only used in one file so should be static.
>
> Signed-off-by: Tom Rix <[email protected]>
> ---

Applied thanks,

--srini
> drivers/nvmem/imx-ocotp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nvmem/imx-ocotp.c b/drivers/nvmem/imx-ocotp.c
> index ac0edb6398f1..fcea9c04be96 100644
> --- a/drivers/nvmem/imx-ocotp.c
> +++ b/drivers/nvmem/imx-ocotp.c
> @@ -596,7 +596,7 @@ static void imx_ocotp_fixup_cell_info(struct nvmem_device *nvmem,
> cell->read_post_process = imx_ocotp_cell_pp;
> }
>
> -struct nvmem_layout imx_ocotp_layout = {
> +static struct nvmem_layout imx_ocotp_layout = {
> .fixup_cell_info = imx_ocotp_fixup_cell_info,
> };
>