From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:32812) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvtJE-0002sa-MM for qemu-devel@nongnu.org; Mon, 30 Jul 2012 12:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SvtJD-0005Vt-Io for qemu-devel@nongnu.org; Mon, 30 Jul 2012 12:59:08 -0400 Received: from cantor2.suse.de ([195.135.220.15]:59828 helo=mx2.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SvtJD-0005Vf-8y for qemu-devel@nongnu.org; Mon, 30 Jul 2012 12:59:07 -0400 Message-ID: <5016BD57.3090706@suse.de> Date: Mon, 30 Jul 2012 18:59:03 +0200 From: =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= MIME-Version: 1.0 References: <5ddedba0015c15117770b3d1860f7dd6d8d08a0c.1343664167.git.blauwirbel@gmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH 2/5] sparc: fix expression with uninitialized initial value List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Maydell Cc: blauwirbel@gmail.com, qemu-devel@nongnu.org Am 30.07.2012 18:13, schrieb Peter Maydell: > On 30 July 2012 17:04, wrote: >> From: Blue Swirl >> >> err was uninitalized, it's not OK to use |=3D. Spotted by Clang >=20 > "uninitialized" (feel free to just fix typo on commit). >=20 >> compiler. >> >> Fix by replacing |=3D by =3D. >> >> Signed-off-by: Blue Swirl >> --- >> linux-user/signal.c | 2 +- >> 1 files changed, 1 insertions(+), 1 deletions(-) >> >> diff --git a/linux-user/signal.c b/linux-user/signal.c >> index 97f30d9..3d6b5df 100644 >> --- a/linux-user/signal.c >> +++ b/linux-user/signal.c >> @@ -2061,7 +2061,7 @@ restore_fpu_state(CPUSPARCState *env, qemu_sigin= fo_fpu_t *fpu) >> err =3D __copy_from_user(&env->fpr[0], &fpu->si_float_regs[0]= , >> (sizeof(unsigned long) * 32)); >> #endif >> - err |=3D __get_user(env->fsr, &fpu->si_fsr); >> + err =3D __get_user(env->fsr, &fpu->si_fsr); >> #if 0 >> err |=3D __get_user(current->thread.fpqdepth, &fpu->si_fpqdep= th); >> if (current->thread.fpqdepth !=3D 0) >=20 > This will need changing again if we ever fix the #if 0-d out > code in this function, but I guess that will be obvious to whoever > does that. You mean the #endif part? Would an explicit err =3D 0 make things better? Andreas >=20 > Incidentally, __get_user() can never fail [we catch unreadable memory > earlier when wo do the lock_user_struct] so you could also just > not do anything with its return value. Some of the other targets > rely on this in their signal save/restore code. I think the use > of the return value is mostly in code that was copy-and-pasted > from the Linux kernel (which does use a __get_user() that can fail). >=20 > Reviewed-by: Peter Maydell >=20 > -- PMM --=20 SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imend=C3=B6rffer; HRB 16746 AG N=C3=BC= rnberg