[PATCH] net/hns3: fix build warning

Ferruh Yigit ferruh.yigit at amd.com
Fri Apr 7 19:08:02 CEST 2023


On 4/4/2023 9:22 AM, Dongdong Liu wrote:
> Hi Jerin
> 
> Many thanks for fixing the warning.
> On 2023/4/4 14:55, jerinj at marvell.com wrote:
>> From: Jerin Jacob <jerinj at marvell.com>
>>
>> aarch64 gcc 12.2.0 build complain with below warning[1].
>> Move the new_link initialization upwards to fix the warning.
>>
>> Compiling C object
>> drivers/libtmp_rte_net_hns3.a.p/net_hns3_hns3_ethdev.c.o
>> drivers/net/hns3/hns3_ethdev.c: In function ‘hns3_dev_link_update’:
>> drivers/net/hns3/hns3_ethdev.c:2249:1: warning: ‘new_link’ may be
>> used uninitialized [-Wmaybe-uninitialized]
> It looks like a false positive from the logic of the code.
> Anyway, this warning can be fixed by this patch, so
> Acked-by: Dongdong Liu <liudongdong3 at huawei.com>
> 

Agree that it looks false positive.
Moving memset upwards does unnecessary memset for some case but this can
be OK for control path function.

Applied to dpdk-next-net/main, thanks.


More information about the stable mailing list