linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: "Moore, Eric" <Eric.Moore@lsi.com>
Cc: roel kluin <roel.kluin@gmail.com>,
	"James E.J. Bottomley" <James.Bottomley@suse.de>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	"Desai, Kashyap" <Kashyap.Desai@lsi.com>
Subject: Re: [PATCH] mpt2sas: Fix &&/|| confusion in _scsih_sas_device_status_change_event()
Date: Tue, 12 Jan 2010 16:38:16 -0800	[thread overview]
Message-ID: <20100112163816.97a2cbc4.akpm@linux-foundation.org> (raw)
In-Reply-To: <4565AEA676113A449269C2F3A549520F044646D4@cosmail03.lsi.com>

On Tue, 12 Jan 2010 17:23:41 -0700
"Moore, Eric" <Eric.Moore@lsi.com> wrote:

> > -----Original Message-----
> > From: Andrew Morton [mailto:akpm@linux-foundation.org] 
> > Sent: Tuesday, January 12, 2010 2:54 PM
> > To: roel kluin
> > Cc: Moore, Eric; James E.J. Bottomley; linux-scsi@vger.kernel.org; LKML; Desai, Kashyap
> > Subject: Re: [PATCH] mpt2sas: Fix &&/|| confusion in _scsih_sas_device_status_change_event()
> > 
> > On Thu, 7 Jan 2010 20:58:10 +0100
> > roel kluin <roel.kluin@gmail.com> wrote:
> > 
> > > On Thu, Jan 7, 2010 at 8:31 PM, Moore, Eric <Eric.Moore@lsi.com> wrote:
> > > > nack
> > > >
> > > > The code beyond this check is intended for either INTERNAL_DEVICE_RESET or CMP_DEVICE_RESET. __ If the reason code is something else, we will want to return. __There are 10 other types of reason codes besides these two. This proposed patch means we return only when the reason code is either INTERNAL_DEVICE_RESET or CMP_INTERNAL_RESET.
> > > >
> > > > Eric Moore
> > > 
> > > my patch is correct but my changelog was wrong. Sorry for the
> > > confusion. It should have been:
> > > 
> > > Even if the ReasonCode is not INTERNAL_DEVICE_RESET nor CMP_DEVICE_RESET
> > > this still evaluates to true.
> > > 
> > 
> > yup, the current code is wrong.
> > 
> > 	if (!(event_data->ReasonCode ==
> > 	    MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET &&
> > 	   event_data->ReasonCode ==
> > 	    MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET))
> > 		return;
> > 
> > ReasonCode cannot equal two different things at the same time.
> > 
> > This is what we want:
> > 
> > 	if (event_data->ReasonCode !=
> > 	      MPI2_EVENT_SAS_DEV_STAT_RC_INTERNAL_DEVICE_RESET &&
> > 	    event_data->ReasonCode !=
> > 	      MPI2_EVENT_SAS_DEV_STAT_RC_CMP_INTERNAL_DEV_RESET)
> > 		return;
> > 
> > Eric, the fix needs runtime testing please - it enables code which
> > hasn't been executed in a long time, if ever.
> > 
> > In fact the compiler wasn't even emitting any code for the second half
> > of _scsih_sas_device_status_change_event() because it worked out that
> > there was no path to it.
> > 
>
> Yes your patch will work.  I just have tested it by sending INTERNAL_DEVICE_RESETS events, and the code is getting executed.
> 

(top-posting and quoting fixed)

Thanks.  Was that an ack to merge?

  reply	other threads:[~2010-01-13  0:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-30 16:58 [PATCH] mpt2sas: Fix &&/|| confusion in _scsih_sas_device_status_change_event() Roel Kluin
2010-01-07 19:31 ` Moore, Eric
2010-01-07 19:58   ` roel kluin
2010-01-12 21:54     ` Andrew Morton
2010-01-13  0:23       ` Moore, Eric
2010-01-13  0:38         ` Andrew Morton [this message]
2010-01-13  0:42           ` Moore, Eric

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=20100112163816.97a2cbc4.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=Eric.Moore@lsi.com \
    --cc=James.Bottomley@suse.de \
    --cc=Kashyap.Desai@lsi.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=roel.kluin@gmail.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).