public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benny Halevy <bhalevy@panasas.com>
To: Greg KH <greg@kroah.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>, lkml <linux-kernel@vger.kernel.org>
Subject: Re: keyspan_pda.c use of keyspan_pda_get_modem_info
Date: Fri, 27 Jun 2008 10:18:35 +0300	[thread overview]
Message-ID: <4864944B.5020601@panasas.com> (raw)
In-Reply-To: <20080627041735.GB8145@kroah.com>

On Jun. 27, 2008, 7:17 +0300, Greg KH <greg@kroah.com> wrote:
> On Thu, Jun 26, 2008 at 04:23:46PM +0100, Alan Cox wrote:
>>> In these two call sites the callers bail out if
>>> keyspan_pda_get_modem_info return value is < 0
>> I don't think that is what the compiler is warning about.
>>
>> We error on rc < 0
>> We use the returned status on rc >= 0
>>
>> We set the returned status on rc > 0
>>
>> So the rc = 0 case is broken and gcc seems to be correct about that
> 
> Yes, that is correct, fortunatly that function can never return rc = 0,
> so this will not happen in real life.
> 
> But there is really no way the compiler can ever figure that out, so I
> don't blame it for complaining.
> 
> If you want to make a simple patch to make the compiler happy and be
> quiet about the warning, I'll take it.

Cool. I'll send a patch initializing status to 0.
Now, what about the rc == 0 case?
Does it warrant a BUG_ON() if it should ever happen?

Benny

> 
> thanks,
> 
> greg k-h


  reply	other threads:[~2008-06-27  7:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-26 14:52 keyspan_pda.c use of keyspan_pda_get_modem_info Benny Halevy
2008-06-26 15:23 ` Alan Cox
2008-06-27  4:17   ` Greg KH
2008-06-27  7:18     ` Benny Halevy [this message]
2008-06-27  7:58       ` [PATCH] usb: fix uninitialized variables in keyspan_pda Benny Halevy
2008-06-27  8:58         ` Alan Cox
2008-06-27  9:22           ` Benny Halevy
2008-06-27 20:25             ` Greg KH

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=4864944B.5020601@panasas.com \
    --to=bhalevy@panasas.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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