linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: Nagalakshmi Nandigama <Nagalakshmi.Nandigama@lsi.com>,
	Sreekanth Reddy <Sreekanth.Reddy@lsi.com>,
	support@lsi.com,
	"James E.J. Bottomley" <JBottomley@parallels.com>,
	DL-MPTFusionLinux@lsi.com, linux-scsi@vger.kernel.org,
	linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi
Date: Fri, 7 Dec 2012 14:00:43 +0300	[thread overview]
Message-ID: <20121207110043.GO22569@mwanda> (raw)
In-Reply-To: <953b00ff89996c4a3681b3c8f425462b@sf-mail.de>

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


  parent reply	other threads:[~2012-12-07 11:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-07  6:28 [patch] [SCSI] mpt3sas: cut and paste bug storing trigger mpi Dan Carpenter
2012-12-07  8:41 ` Rolf Eike Beer
2012-12-07 10:56   ` [patch v2] " Dan Carpenter
2012-12-07 11:00   ` Dan Carpenter [this message]
2012-12-11  9:02 ` [patch] " Reddy, Sreekanth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121207110043.GO22569@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=DL-MPTFusionLinux@lsi.com \
    --cc=JBottomley@parallels.com \
    --cc=Nagalakshmi.Nandigama@lsi.com \
    --cc=Sreekanth.Reddy@lsi.com \
    --cc=eike-kernel@sf-tec.de \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=support@lsi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).