From patchwork Mon Nov 8 18:13:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 70440 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id CBACEB70F7 for ; Tue, 9 Nov 2010 05:15:28 +1100 (EST) Received: from localhost ([127.0.0.1]:35103 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFWFa-0000av-6e for incoming@patchwork.ozlabs.org; Mon, 08 Nov 2010 13:15:26 -0500 Received: from [140.186.70.92] (port=60280 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PFWED-0000R4-Ud for qemu-devel@nongnu.org; Mon, 08 Nov 2010 13:14:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PFWEC-0000Km-FJ for qemu-devel@nongnu.org; Mon, 08 Nov 2010 13:14:01 -0500 Received: from mnementh.archaic.org.uk ([81.2.115.146]:44490) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PFWEC-0000Jp-8L for qemu-devel@nongnu.org; Mon, 08 Nov 2010 13:14:00 -0500 Received: from pm215 (helo=mnementh.archaic.org.uk) by mnementh.archaic.org.uk with local-esmtp (Exim 4.69) (envelope-from ) id 1PFWEA-0005c0-2x for qemu-devel@nongnu.org; Mon, 08 Nov 2010 18:13:58 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Date: Mon, 08 Nov 2010 18:13:58 +0000 Message-Id: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Subject: [Qemu-devel] [PATCH] linux-user: remove unnecessary local from __get_user(), __put_user() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Remove an unnecessary local variable from the __get_user() and __put_user() macros. This avoids confusing compilation failures if the name of the local variable ('size') happens to be the same as the variable the macro user is trying to read/write. Signed-off-by: Peter Maydell Acked-by: Riku Voipio --- linux-user/qemu.h | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 708021e..d717392 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -266,8 +266,7 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) */ #define __put_user(x, hptr)\ ({\ - int size = sizeof(*hptr);\ - switch(size) {\ + switch(sizeof(*hptr)) {\ case 1:\ *(uint8_t *)(hptr) = (uint8_t)(typeof(*hptr))(x);\ break;\ @@ -288,8 +287,7 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) #define __get_user(x, hptr) \ ({\ - int size = sizeof(*hptr);\ - switch(size) {\ + switch(sizeof(*hptr)) {\ case 1:\ x = (typeof(*hptr))*(uint8_t *)(hptr);\ break;\