From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:57165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWv1t-0005gG-9E for qemu-devel@nongnu.org; Wed, 15 Jun 2011 14:41:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QWv1q-0007Xv-5s for qemu-devel@nongnu.org; Wed, 15 Jun 2011 14:41:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10550) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QWv1p-0007XX-G8 for qemu-devel@nongnu.org; Wed, 15 Jun 2011 14:41:25 -0400 Date: Wed, 15 Jun 2011 21:40:54 +0300 From: "Michael S. Tsirkin" Message-ID: <20110615184054.GC7197@redhat.com> References: <95538E92-0A9C-4464-BFE6-F44E528AB6FA@suse.de> <4DF8C292.7080900@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DF8C292.7080900@twiddle.net> Subject: Re: [Qemu-devel] [PATCH 10/10] linux-user: remove unused variables List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: Kevin Wolf , Anthony Liguori , Marcelo Tosatti , Stefan Hajnoczi , kvm@vger.kernel.org, Isaku Yamahata , Jan Kiszka , Riku Voipio , Alexander Graf , qemu-devel@nongnu.org, Blue Swirl , Alex Williamson , Paul Brook , Paolo Bonzini , Christoph Hellwig , Avi Kivity , Aurelien Jarno , Gerd Hoffmann On Wed, Jun 15, 2011 at 07:32:50AM -0700, Richard Henderson wrote: > On 06/15/2011 01:35 AM, Alexander Graf wrote: > >> - abi_ulong arg5 = 0, arg6 = 0, arg7 = 0, arg8 = 0; > >> + abi_ulong arg5 = 0, arg6 = 0; > >> > >> nb_args = mips_syscall_args[syscall_num]; > >> sp_reg = env->active_tc.gpr[29]; > >> switch (nb_args) { > >> /* these arguments are taken from the stack */ > >> /* FIXME - what to do if get_user() fails? */ > >> - case 8: get_user_ual(arg8, sp_reg + 28); > >> - case 7: get_user_ual(arg7, sp_reg + 24); > >> + case 8: /* get_user_ual(arg8, sp_reg + 28); */ > >> + case 7: /* get_user_ual(arg7, sp_reg + 24); */ > > > > I'd prefer to see these and the respective variable definitions #if > > 0'd with a comment, stating that they're currently unused. > > I'd prefer not to see if 0 code. Better, I think, to mark the > variables as __attribute__((unused)) with that same comment. Why keep dead code around? If it's for documentation pruposes comment or if 0 seems more appropriate than attributes. > >> @@ -7058,18 +7056,14 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, > >> case TARGET_NR_osf_sigprocmask: > >> { > >> abi_ulong mask; > >> - int how = arg1; > >> sigset_t set, oldset; > >> > >> switch(arg1) { > >> case TARGET_SIG_BLOCK: > >> - how = SIG_BLOCK; > >> break; > >> case TARGET_SIG_UNBLOCK: > >> - how = SIG_UNBLOCK; > >> break; > >> case TARGET_SIG_SETMASK: > >> - how = SIG_SETMASK; > > > > why go through the effort of setting "how" and then not using it? I'm > > pretty sure this is a bug as well. A few lines down is the following > > code: > > > > sigprocmask(arg1, &set, &oldset); > > > > which in TARGET_NR_sigprocmask would be: > > > > ret = get_errno(sigprocmask(how, &set, &oldset)); > > > > So we end up sending guest masks to the host. Richard, this is Alpha > > specific code. Mind to double-check? > > I remember fixing this before. Perhaps it was in a patch tree that > never got pulled... > > > r~