[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4864944B.5020601@panasas.com>
Date: Fri, 27 Jun 2008 10:18:35 +0300
From: Benny Halevy <bhalevy@...asas.com>
To: Greg KH <greg@...ah.com>
CC: Alan Cox <alan@...rguk.ukuu.org.uk>,
lkml <linux-kernel@...r.kernel.org>
Subject: Re: keyspan_pda.c use of keyspan_pda_get_modem_info
On Jun. 27, 2008, 7:17 +0300, Greg KH <greg@...ah.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists