[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D652344.1020402@ge.com>
Date: Wed, 23 Feb 2011 15:09:56 +0000
From: Martyn Welch <martyn.welch@...com>
To: Dan Carpenter <error27@...il.com>,
Manohar Vanga <manohar.vanga@...n.ch>,
devel@...verdev.osuosl.org, cota@...ap.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/2] Staging: vme: remove unreachable code
On 23/02/11 12:17, Dan Carpenter wrote:
> On Wed, Feb 23, 2011 at 09:19:06AM +0000, Martyn Welch wrote:
>> On 22/02/11 19:36, Manohar Vanga wrote:
>>> Remove unreachable code from vme_register_bridge
>>>
>>> Signed-off-by: Manohar Vanga <manohar.vanga@...n.ch>
>
> Please always CC the list. It's going to be Greg to commit this
> code so CC Greg as well.
>
> ./scripts/get_maintainer.pl patch.diff
>
> (Although you should generally remove Tejun from the CC list.)
>
>>
>> Yeah - that's there from development. If the function needed to be extended,
>> that's the next part of the error path.
>
> Don't do that. Kernel style is austere. Anything that isn't needed
> here and now should be removed.
>
>>> --- a/drivers/staging/vme/vme.c
>>> +++ b/drivers/staging/vme/vme.c
>>> @@ -1363,7 +1363,6 @@ int vme_register_bridge(struct vme_bridge *bridge)
>>>
>>> return retval;
>>>
>>> - i = VME_SLOTS_MAX;
>>> err_reg:
>>> while (i > -1) {
>>> dev = &bridge->dev[i];
>
> There are two problems with this loop. 1) It unregisters the device
> which failed to register. 2) It is a forever loop.
>
Even if "i" is a signed int?
> It should be:
> while (--i >= 0) {
> dev = &bridge->dev[i];
>
> Can you fix that up as well and resend.
>
> regards,
> dan carpenter
--
Martyn Welch (Principal Software Engineer) | Registered in England and
GE Intelligent Platforms | Wales (3828642) at 100
T +44(0)127322748 | Barbirolli Square, Manchester,
E martyn.welch@...com | M2 3AB VAT:GB 927559189
--
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