From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier MATZ Subject: Re: [PATCH v2 1/6] ixgbe: put only non-zero initializer in definition Date: Mon, 08 Sep 2014 09:55:28 +0200 Message-ID: <540D60F0.2050403@6wind.com> References: <1409154628-30825-1-git-send-email-bruce.richardson@intel.com> <1409240559-14447-2-git-send-email-bruce.richardson@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit To: Bruce Richardson , dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1409240559-14447-2-git-send-email-bruce.richardson-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" Hello Bruce, On 08/28/2014 05:42 PM, Bruce Richardson wrote: > 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 Acked-by: Olivier Matz