On Fri, Oct 11, 2013 at 06:14:36PM +0200, Borislav Petkov wrote:
> Date: Fri, 11 Oct 2013 18:14:36 +0200
> From: Borislav Petkov <b...@alien8.de>
> To: "Chen, Gong" <gong.c...@linux.intel.com>
> Cc: tony.l...@intel.com, linux-kernel@vger.kernel.org,
>  linux-a...@vger.kernel.org
> Subject: Re: [PATCH 8/8] ACPI / trace: Add trace interface for eMCA driver
> User-Agent: Mutt/1.5.21 (2010-09-15)
> 
...
> > +static void dimm_err_location(struct cper_sec_mem_err *mem)
> > +{
> > +   memset(dimm_location, 0, LOC_LEN);
> > +   if (mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE) {
> 
> By reversing this test you can save yourself an indentation level and a
> superfluous memset:
> 
>       if (!(mem->validation_bits & CPER_MEM_VALID_MODULE_HANDLE))
>               return;
> 
>       memset(dimm_location, 0, LOC_LEN);
>       dmi_memdev_name...
>       ...
> 
> 
memset should be called before return, otherwise the values from last time
will happen again in this time.

Attachment: signature.asc
Description: Digital signature



Reply via email to