On 20.11.2019 9:13, Lance Yang wrote:
> When compiling Open vSwitch for aarch64, the compiler will warn about
> an uninitailized variable in lib/dpif-netdev-perf.c. It is necessary to
> initialize it to avoid build failure.

Hi. Thanks for making OVS build on aarch64.

Could you provide the error message?
In fact this variable is never used (only assigned), so this should be
a false-positive.  So, I'd like to look at the error message.

Also, it might be better to rename the patch to something more
specific. e.g.
'dpif-netdev-perf: Avoid false-positive on uninitialized perf stats.'

> 
> Reviewed-by: Yanqin Wei <[email protected]>
> Signed-off-by: Lance Yang <[email protected]>
> ---
>  lib/dpif-netdev-perf.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/dpif-netdev-perf.c b/lib/dpif-netdev-perf.c
> index baf90b0..f85bb0c 100644
> --- a/lib/dpif-netdev-perf.c
> +++ b/lib/dpif-netdev-perf.c
> @@ -63,6 +63,7 @@ pmd_perf_estimate_tsc_frequency(void)
>      struct pmd_perf_stats s;
>      uint64_t start, stop;
>  
> +    memset(&s, 0, sizeof(s));

Please, don't parenthesize the argument of a 'sizeof'.

Also, it might be better to initialize the variable close to
the first usage.  It doesn't look good here.

>      /* DPDK is not available or returned unreliable value.
>       * Trying to estimate. */
>      affinity = ovs_numa_thread_getaffinity_dump();
> 
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to