public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: linas@austin.ibm.com (Linas Vepstas)
To: Greg KH <gregkh@suse.de>
Cc: akpm@osdl.org, linux-kernel@vger.kernel.org,
	linux-pci@atrey.karlin.mff.cuni.cz
Subject: Re: [PATCH 1/2]: Renumber PCI error enums to start at zero
Date: Tue, 12 Dec 2006 15:35:42 -0600	[thread overview]
Message-ID: <20061212213542.GK4329@austin.ibm.com> (raw)
In-Reply-To: <20061212203543.GA4991@suse.de>

On Tue, Dec 12, 2006 at 12:35:43PM -0800, Greg KH wrote:
> On Tue, Dec 12, 2006 at 01:55:24PM -0600, Linas Vepstas wrote:
> > 
> > Subject: [PATCH 1/2]: Renumber PCI error enums to start at zero
> > 
> > Renumber the PCI error enums to start at zero for "normal/online".
> > This allows un-initialized pci channel state (which defaults to zero)
> > to be interpreted as "normal".  Add very simple routine to check
> > state, just in case this ever has to be fiddled with again.
> 
> No, as you have a specific type for this state, never test it against
> "zero".  That just defeats the whole issue of having a special type for
> this state.

Yes, well, I guess that was my initial thinking, which is why it got
coded that way. But "in real life", the value in the struct isn't
initialized (thus taking a value of zero). Its not initialized 
in deference to the traditional idea that "just saying bzero() 
should be enough".  

However, that turned the test for error into a dorky double test:
if(pdev->error_state && pdev->error_state != pci_channel_io_normal)
which struck me as lame. 

So, I'll ask: is it better to test for (state!=0 && state!=1) or,
to initialize pdev->error_state = pci_channel_io_normal; in the driver 
probe code?

--linas

  reply	other threads:[~2006-12-12 21:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-12 19:55 [PATCH 1/2]: Renumber PCI error enums to start at zero Linas Vepstas
2006-12-12 20:01 ` [PATCH 2/2]: Use newly defined PCI channel offline routine Linas Vepstas
2006-12-12 21:27   ` Auke Kok
2006-12-12 20:35 ` [PATCH 1/2]: Renumber PCI error enums to start at zero Greg KH
2006-12-12 21:35   ` Linas Vepstas [this message]
2006-12-12 21:42     ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2006-11-01 23:54 Linas Vepstas

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=20061212213542.GK4329@austin.ibm.com \
    --to=linas@austin.ibm.com \
    --cc=akpm@osdl.org \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    /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