linux-mips
[Top] [All Lists]

Re: [PATCH 0/6] mips: diverse Makefile updates

To: Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH 0/6] mips: diverse Makefile updates
From: Ralf Baechle <ralf@linux-mips.org>
Date: Mon, 31 May 2010 11:29:54 +0100
Cc: linux-mips <linux-mips@linux-mips.org>, Wu Zhangjin <wuzhangjin@gmail.com>
In-reply-to: <20100530231954.GA318@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20100530141939.GA22153@merkur.ravnborg.org> <20100530153939.GA22352@merkur.ravnborg.org> <20100530231954.GA318@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mutt/1.5.20 (2009-08-17)
On Mon, May 31, 2010 at 12:19:54AM +0100, Ralf Baechle wrote:

> > > Note: I tried to test a little with bigsur_defconfig
> > > but get_user() is buggy. Or at least my gcc thinks that
> > > first argument may be used uninitialized.
> > > I think mips needs to fix the 64 bit variant of get_user().
> > > I took a quick look but ran away.
> > 
> > My gcc:
> > mips-linux-gcc (GCC) 4.1.2
> > Copyright (C) 2006 Free Software Foundation, Inc.

I played with it for a bit.  The warning is present in all gcc 4.1.0 to
4.1.2 and it is bogus.  When I first looked into this years ago I just
gave up on gcc 4.1 as a newer version was already available.

The variable returned by get_user is undefined in case of an error, so
what get_user() is doing is entirely legitimate.  This is different from
copy_from_user() which in case of an error will clear the remainder of
the destination area which couldn't not be copied from userspace.

A test compile of a bigsur_defconfig without and with your patch shows
a size increase of only 80 bytes with gcc 4.5.0.  So I'm considering
your patch for inclusion but I want to play with alternatives for a bit.
Outlining may the right thing with modern compilers.

  Ralf

<Prev in Thread] Current Thread [Next in Thread>