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 <[email protected]>
> To: "Chen, Gong" <[email protected]>
> Cc: [email protected], [email protected],
>  [email protected]
> 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