lkml.org 
[lkml]   [2020]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject答复: [PATCH -next] vdpa: Mark macaddr buf wi th static keyword
Date
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:sgarzare@redhat.com]
发送时间: 2020年12月18日 15:57
收件人: Zouwei (Samuel) <zou_wei@huawei.com>
抄送: mst@redhat.com; jasowang@redhat.com; mgurtovoy@nvidia.com; virtualization@lists.linux-foundation.org; linux-kernel@vger.kernel.org
主题: 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 <hulkci@huawei.com>
>Signed-off-by: Zou Wei <zou_wei@huawei.com>
>---
> drivers/vdpa/vdpa_sim/vdpa_sim_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

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
>

\
 
 \ /
  Last update: 2020-12-18 09:13    [W:0.062 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site