[dpdk-dev] [PATCH v2 1/6] ixgbe: put only non-zero initializer in definition

De Lara Guarch, Pablo pablo.de.lara.guarch at intel.com
Fri Sep 5 18:14:15 CEST 2014



> -----Original Message-----
> From: dev [mailto:dev-bounces at dpdk.org] On Behalf Of Bruce Richardson
> Sent: Thursday, August 28, 2014 4:43 PM
> To: dev at dpdk.org
> Subject: [dpdk-dev] [PATCH v2 1/6] ixgbe: put only non-zero initializer in
> definition
> 
> Since all unspecified fields in an initializer are assumed to be zero we
> can simplify the empty mbuf definition in the vector driver to only use
> the fields that are non-zero, i.e. just nb_segs = 1. This makes things
> shorter and means that the structure doesn't need as many updates for
> other fields being renamed or moved.
> 
> The variable itself is never modified and only used by a single function
> so it can be made const and local to the using function.
> 
> Changes in v2:
> * None
> 
> Signed-off-by: Bruce Richardson <bruce.richardson at intel.com>

Acked-by Pablo de Lara <pablo.de.lara.guarch at intel.com>


More information about the dev mailing list