Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161032AbWKUVGW (ORCPT ); Tue, 21 Nov 2006 16:06:22 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161051AbWKUVGW (ORCPT ); Tue, 21 Nov 2006 16:06:22 -0500 Received: from mx1.cs.washington.edu ([128.208.5.52]:26251 "EHLO mx1.cs.washington.edu") by vger.kernel.org with ESMTP id S1161032AbWKUVGV (ORCPT ); Tue, 21 Nov 2006 16:06:21 -0500 Date: Tue, 21 Nov 2006 13:03:05 -0800 (PST) From: David Rientjes To: Adrian Bunk cc: d binderman , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: Re: [PATCH] i386 msr: remove unused variable In-Reply-To: <20061121210029.GO5200@stusta.de> Message-ID: References: <20061121210029.GO5200@stusta.de> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1587 Lines: 47 On Tue, 21 Nov 2006, Adrian Bunk wrote: > On Tue, Nov 21, 2006 at 12:27:22PM -0800, David Rientjes wrote: > > Remove unused variable in msr_write(). > > > > Reported by D Binderman . > > > > Cc: H. Peter Anvin > > Signed-off-by: David Rientjes > > --- > > arch/i386/kernel/msr.c | 3 +-- > > 1 files changed, 1 insertions(+), 2 deletions(-) > > > > diff --git a/arch/i386/kernel/msr.c b/arch/i386/kernel/msr.c > > index d535cdb..331bd59 100644 > > --- a/arch/i386/kernel/msr.c > > +++ b/arch/i386/kernel/msr.c > > @@ -195,7 +195,6 @@ static ssize_t msr_write(struct file *fi > > { > > const u32 __user *tmp = (const u32 __user *)buf; > > u32 data[2]; > > - size_t rv; > > u32 reg = *ppos; > > int cpu = iminor(file->f_dentry->d_inode); > > int err; > > @@ -203,7 +202,7 @@ static ssize_t msr_write(struct file *fi > > if (count % 8) > > return -EINVAL; /* Invalid chunk size */ > > > > - for (rv = 0; count; count -= 8) { > > + for (; count; count -= 8) { > >... > > What about changing this to a while() loop? > Unnecessary because tmp is also incremented at the bottom of this for loop so there are two incremental variables. It is not better served with a while loop; the absence of an initialization variable does not suggest such. David - 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/