Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753043Ab1BWPKF (ORCPT ); Wed, 23 Feb 2011 10:10:05 -0500 Received: from exprod5og114.obsmtp.com ([64.18.0.28]:33558 "EHLO exprod5og114.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292Ab1BWPKD (ORCPT ); Wed, 23 Feb 2011 10:10:03 -0500 Message-ID: <4D652344.1020402@ge.com> Date: Wed, 23 Feb 2011 15:09:56 +0000 From: Martyn Welch Organization: GE Intelligent Platforms User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.13) Gecko/20101208 Thunderbird/3.1.7 MIME-Version: 1.0 To: Dan Carpenter , Manohar Vanga , devel@driverdev.osuosl.org, cota@braap.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] Staging: vme: remove unreachable code References: <1298403376-28352-1-git-send-email-manohar.vanga@cern.ch> <1298403376-28352-2-git-send-email-manohar.vanga@cern.ch> <4D64D10A.3070702@ge.com> <20110223121726.GR1898@bicker> In-Reply-To: <20110223121726.GR1898@bicker> X-Enigmail-Version: 1.1.2 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 23 Feb 2011 15:09:54.0513 (UTC) FILETIME=[B9F71410:01CBD36B] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1822 Lines: 58 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 > > 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@ge.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@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/