lkml.org 
[lkml]   [2012]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi
On Fri, Dec 07, 2012 at 09:41:56AM +0100, Rolf Eike Beer wrote:
> > memset(&ioc->diag_trigger_mpi, 0,
> >- sizeof(struct SL_WH_EVENT_TRIGGERS_T));
> >+ sizeof(struct SL_WH_MPI_TRIGGERS_T));
> > memcpy(&ioc->diag_trigger_mpi, buf, sz);
> > if (ioc->diag_trigger_mpi.ValidEntries > NUM_VALID_ENTRIES)
> > ioc->diag_trigger_mpi.ValidEntries = NUM_VALID_ENTRIES;
>
> Then just use sizeof(ioc->diag_trigger_mpi), then it's irrelevant
> how that type is ever called.
>

Yeah, that's the way I would have prefered to write this as well.
It took me a while to verify that the intent here was not to clear
only part of the struct. Using sizeof(variable_name) instead of
sizeof(type) is more readable.

But then you get into the thing where the line before uses
sizeof(type)...

Oh well, I've sent both styles and the maintainer can choose. :)

regards,
dan carpenter



\
 
 \ /
  Last update: 2012-12-07 12:41    [W:0.044 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site