Skip to contentSkip to conversation

vdpa: Mark macaddr_buf with static keyword

PATCH In review Zou Wei 3 participants 5 messages Dec 18, 2020 virtio core

lore
Share & tools
lore

Zou Wei

author
#0 lore raw

PATCH 1/1 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?

---
 drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +1 -1
index c10b698..f048242 100644
@@ -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;
 
Signature · 1 line
2.6.2
Acked-by on v1 1/1
#1 lore raw
Quoted 15 lines · Zou Wei

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?

---
  drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +0 -0
index c10b698..f048242 100644

drivers/vdpa/vdpa_sim/vdpa_sim_net.c static char *macaddr; · line 38

Quoted 7 lines
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +1 -1
@@ -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;
Quoted 1 line

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Reviewed-by on v1 1/1
#2 lore raw
In reply to Zou Wei
Quoted 9 lines · Zou Wei

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?

---
drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

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

Thanks for fixing,
Stefano

Quoted 17 lines
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +1 -1
index c10b698..f048242 100644
@@ -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;
 
Signature · 1 line
2.6.2

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

author Reviewed-by Stefano Garzarella
#3 lore raw

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

Quoted 9 lines · Zou Wei

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?

---
drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

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

Thanks for fixing,
Stefano

Quoted 17 lines
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +1 -2
index c10b698..f048242 100644
@@ -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

#4 lore raw
Quoted 4 lines · Zouwei (Samuel)

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

Quoted 36 lines

-----邮件原件-----
发件人: 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

Quoted 9 lines · Zou Wei

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?

---
drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)

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

Thanks for fixing,
Stefano

Quoted 9 lines
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +0 -0
index c10b698..f048242 100644
@@ -33,7 +33,7 @@ static char *macaddr;  module_param(macaddr, charp,
 0);  MODULE_PARM_DESC(macaddr, "Ethernet MAC address");
 
Quoted 9 lines
Quoted 8 lines
drivers/vdpa/vdpa_sim/vdpa_sim_net.c +1 -2
-u8 macaddr_buf[ETH_ALEN];
+static u8 macaddr_buf[ETH_ALEN];
 
 static struct vdpasim *vdpasim_net_dev;
 
--

2.6.2

_______________________________________________
Virtualization mailing list
[email protected]
https://lists.linuxfoundation.org/mailman/listinfo/virtualization