2020-12-18 02:05:41

by Zou Wei

[permalink] [raw]
Subject: [PATCH -next] vdpa: Mark macaddr_buf with static keyword

Fix the following sparse warning:

drivers/vdpa/vdpa_sim/vdpa_sim_net.c:36:4: warning: symbol 'macaddr_buf' was not declared. Should it be static?

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
---
drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
index c10b698..f048242 100644
--- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
+++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
@@ -33,7 +33,7 @@ static char *macaddr;
module_param(macaddr, charp, 0);
MODULE_PARM_DESC(macaddr, "Ethernet MAC address");

-u8 macaddr_buf[ETH_ALEN];
+static u8 macaddr_buf[ETH_ALEN];

static struct vdpasim *vdpasim_net_dev;

--
2.6.2


2020-12-18 05:37:09

by Jason Wang

[permalink] [raw]
Subject: Re: [PATCH -next] vdpa: Mark macaddr_buf with static keyword


On 2020/12/18 上午9:51, Zou Wei wrote:
> Fix the following sparse warning:
>
> drivers/vdpa/vdpa_sim/vdpa_sim_net.c:36:4: warning: symbol 'macaddr_buf' was not declared. Should it be static?
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>
> ---
> drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
> index c10b698..f048242 100644
> --- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
> +++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
> @@ -33,7 +33,7 @@ static char *macaddr;
> module_param(macaddr, charp, 0);
> MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>
> -u8 macaddr_buf[ETH_ALEN];
> +static u8 macaddr_buf[ETH_ALEN];
>
> static struct vdpasim *vdpasim_net_dev;


Acked-by: Jason Wang <[email protected]>



>

2020-12-18 07:59:22

by Stefano Garzarella

[permalink] [raw]
Subject: Re: [PATCH -next] vdpa: Mark macaddr_buf with static keyword

On Fri, Dec 18, 2020 at 09:51:35AM +0800, Zou Wei wrote:
>Fix the following sparse warning:
>
>drivers/vdpa/vdpa_sim/vdpa_sim_net.c:36:4: warning: symbol 'macaddr_buf' was not declared. Should it be static?
>
>Reported-by: Hulk Robot <[email protected]>
>Signed-off-by: Zou Wei <[email protected]>
>---
> drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefano Garzarella <[email protected]>

I built with W=1 but I didn't have this warning.

Thanks for fixing,
Stefano

>
>diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>index c10b698..f048242 100644
>--- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>+++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>@@ -33,7 +33,7 @@ static char *macaddr;
> module_param(macaddr, charp, 0);
> MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>
>-u8 macaddr_buf[ETH_ALEN];
>+static u8 macaddr_buf[ETH_ALEN];
>
> static struct vdpasim *vdpasim_net_dev;
>
>--
>2.6.2
>

2020-12-18 08:13:01

by Zou Wei

[permalink] [raw]
Subject: 答复: [PATCH -next] vdpa: Mark macaddr_buf wi th static keyword

Hi,
I run this command:
make allmodconfig ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-
make C=2 drivers/vdpa/vdpa_sim/vdpa_sim_net.o ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-


-----?ʼ?ԭ??-----
??????: Stefano Garzarella [mailto:[email protected]]
????ʱ??: 2020??12??18?? 15:57
?ռ???: Zouwei (Samuel) <[email protected]>
????: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
????: Re: [PATCH -next] vdpa: Mark macaddr_buf with static keyword

On Fri, Dec 18, 2020 at 09:51:35AM +0800, Zou Wei wrote:
>Fix the following sparse warning:
>
>drivers/vdpa/vdpa_sim/vdpa_sim_net.c:36:4: warning: symbol 'macaddr_buf' was not declared. Should it be static?
>
>Reported-by: Hulk Robot <[email protected]>
>Signed-off-by: Zou Wei <[email protected]>
>---
> drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefano Garzarella <[email protected]>

I built with W=1 but I didn't have this warning.

Thanks for fixing,
Stefano

>
>diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>index c10b698..f048242 100644
>--- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>+++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>@@ -33,7 +33,7 @@ static char *macaddr; module_param(macaddr, charp,
>0); MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>
>-u8 macaddr_buf[ETH_ALEN];
>+static u8 macaddr_buf[ETH_ALEN];
>
> static struct vdpasim *vdpasim_net_dev;
>
>--
>2.6.2
>

2020-12-18 08:20:05

by Stefano Garzarella

[permalink] [raw]
Subject: Re: 答复 : [PATCH -next] vdpa: Mark macaddr_buf with static keyword

On Fri, Dec 18, 2020 at 08:11:20AM +0000, Zouwei (Samuel) wrote:
>Hi,
>I run this command:
>make allmodconfig ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-
>make C=2 drivers/vdpa/vdpa_sim/vdpa_sim_net.o ARCH=x86_64 CROSS_COMPILE=x86_64-linux-gnu-

Yeah, I can see the warning using C=2.
I'll use it next times.

Thanks for sharing,
Stefano

>
>
>-----邮件原件-----
>发件人: Stefano Garzarella [mailto:[email protected]]
>发送时间: 2020年12月18日 15:57
>收件人: Zouwei (Samuel) <[email protected]>
>抄送: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
>主题: Re: [PATCH -next] vdpa: Mark macaddr_buf with static keyword
>
>On Fri, Dec 18, 2020 at 09:51:35AM +0800, Zou Wei wrote:
>>Fix the following sparse warning:
>>
>>drivers/vdpa/vdpa_sim/vdpa_sim_net.c:36:4: warning: symbol 'macaddr_buf' was not declared. Should it be static?
>>
>>Reported-by: Hulk Robot <[email protected]>
>>Signed-off-by: Zou Wei <[email protected]>
>>---
>> drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>Reviewed-by: Stefano Garzarella <[email protected]>
>
>I built with W=1 but I didn't have this warning.
>
>Thanks for fixing,
>Stefano
>
>>
>>diff --git a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>>b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>>index c10b698..f048242 100644
>>--- a/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>>+++ b/drivers/vdpa/vdpa_sim/vdpa_sim_net.c
>>@@ -33,7 +33,7 @@ static char *macaddr; module_param(macaddr, charp,
>>0); MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
>>
>>-u8 macaddr_buf[ETH_ALEN];
>>+static u8 macaddr_buf[ETH_ALEN];
>>
>> static struct vdpasim *vdpasim_net_dev;
>>
>>--
>>2.6.2
>>
>