From patchwork Wed Apr 23 13:12:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 28892 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8EC3520534 for ; Wed, 23 Apr 2014 13:20:13 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id 29sf3850718yhl.5 for ; Wed, 23 Apr 2014 06:20:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:cc:subject:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:list-subscribe :errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list:content-type :content-transfer-encoding; bh=DaVA3Z8aY7AUPLO3+6gIH0dPbHXdkBYDkE7Tyy6CNYc=; b=ShE5UeRlzkJJe4IjHK4GgFA6rNrW1QLbULtmrNWQNBqhvAayjx6Ogxk5VlNs0O07Vf t5NCG3cWjT7hbCvO2OngFCDF/ljCt2M97nkaC/UeT4ON9rfGoJTfTnmWw8x6EaIrhAWX putCAp5pb5nFL/SzKWSjM7dFiT4+E7S0VHHcKwyD3yPFAAbBh7WNz6QP2VRk5HkprAhu oid0WoLIAGVrgvfhfXyQ4eApT02fPf4qe5dHggsWQVpTwe0BjAi2/yGmuxRORnm+4ajS uTc0Y0PFENM/ljZRTP5k3ksKqnBsrFqLTkPC64FWCUj8lssvxmvmeFhKsSTNLBdTzM6B wkJg== X-Gm-Message-State: ALoCoQl6oZk7eOE/kXqeOeZ37Z12DmgpqjqX5tPSLTfvzZr12gVJLnNhQyXxE8Zp6lOZ3kehNg+2 X-Received: by 10.58.22.166 with SMTP id e6mr26531287vef.6.1398259213247; Wed, 23 Apr 2014 06:20:13 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.81.69 with SMTP id e63ls621018qgd.29.gmail; Wed, 23 Apr 2014 06:20:13 -0700 (PDT) X-Received: by 10.220.139.198 with SMTP id f6mr177478vcu.47.1398259213056; Wed, 23 Apr 2014 06:20:13 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id iz10si162465vec.60.2014.04.23.06.20.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:20:13 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so1114928vcb.6 for ; Wed, 23 Apr 2014 06:20:13 -0700 (PDT) X-Received: by 10.58.38.40 with SMTP id d8mr165803vek.61.1398259212981; Wed, 23 Apr 2014 06:20:12 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp103488vcb; Wed, 23 Apr 2014 06:20:12 -0700 (PDT) X-Received: by 10.224.114.209 with SMTP id f17mr58345874qaq.40.1398259212602; Wed, 23 Apr 2014 06:20:12 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id d5si427642qab.153.2014.04.23.06.20.12 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 23 Apr 2014 06:20:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:60978 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcx5w-0000b2-7T for patch@linaro.org; Wed, 23 Apr 2014 09:20:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50082) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WcwyG-0001l0-67 for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Wcwy9-0001K8-8F for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:16 -0400 Received: from afflict.kos.to ([92.243.29.197]:42809) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Wcwy8-0001JS-R4 for qemu-devel@nongnu.org; Wed, 23 Apr 2014 09:12:09 -0400 Received: from localhost.localdomain (afflict [92.243.29.197]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by afflict.kos.to (Postfix) with ESMTPSA id 4AD08264DC; Wed, 23 Apr 2014 15:12:06 +0200 (CEST) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 23 Apr 2014 16:12:04 +0300 Message-Id: <2a13438272820c294b50b188468e622c54878729.1398257165.git.riku.voipio@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: References: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 92.243.29.197 Cc: Richard Henderson Subject: [Qemu-devel] [PATCH 13/13] fix gcc-4.9 compiler error on __{get, put]}_user X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: riku.voipio@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Riku Voipio gcc-4.9 finds unused operand: linux-user/syscall.c: In function ‘host_to_target_stat64’: linux-user/qemu.h:301:19: error: right-hand operand of comma expression has no effect [-Werror=unused-value] ((hptr), (x)), 0) Just removing the rh operand is no good, it will error in later: linux-user/main.c: In function ‘arm_kernel_cmpxchg64_helper’: linux-user/qemu.h:330:15: error: void value not ignored as it ought to be __ret = __put_user((x), __hptr); \ Thus, remove setting __ret from __get_user and __put_user, as and set the right hand operand to (void)0 to make it clear that these return never nothing. This commit depends on the signal.c cleanup, to ensure bisectable version history. Signed-off-by: Riku Voipio Cc: Richard Henderson --- linux-user/qemu.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/linux-user/qemu.h b/linux-user/qemu.h index 36d4a73..772e180 100644 --- a/linux-user/qemu.h +++ b/linux-user/qemu.h @@ -298,7 +298,7 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) __builtin_choose_expr(sizeof(*(hptr)) == 2, stw_##e##_p, \ __builtin_choose_expr(sizeof(*(hptr)) == 4, stl_##e##_p, \ __builtin_choose_expr(sizeof(*(hptr)) == 8, stq_##e##_p, abort)))) \ - ((hptr), (x)), 0) + ((hptr), (x)), (void)0) #define __get_user_e(x, hptr, e) \ ((x) = (typeof(*hptr))( \ @@ -306,7 +306,7 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) __builtin_choose_expr(sizeof(*(hptr)) == 2, lduw_##e##_p, \ __builtin_choose_expr(sizeof(*(hptr)) == 4, ldl_##e##_p, \ __builtin_choose_expr(sizeof(*(hptr)) == 8, ldq_##e##_p, abort)))) \ - (hptr)), 0) + (hptr)), (void)0) #ifdef TARGET_WORDS_BIGENDIAN # define __put_user(x, hptr) __put_user_e(x, hptr, be) @@ -325,9 +325,9 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) ({ \ abi_ulong __gaddr = (gaddr); \ target_type *__hptr; \ - abi_long __ret; \ + abi_long __ret = 0; \ if ((__hptr = lock_user(VERIFY_WRITE, __gaddr, sizeof(target_type), 0))) { \ - __ret = __put_user((x), __hptr); \ + __put_user((x), __hptr); \ unlock_user(__hptr, __gaddr, sizeof(target_type)); \ } else \ __ret = -TARGET_EFAULT; \ @@ -338,9 +338,9 @@ static inline int access_ok(int type, abi_ulong addr, abi_ulong size) ({ \ abi_ulong __gaddr = (gaddr); \ target_type *__hptr; \ - abi_long __ret; \ + abi_long __ret = 0; \ if ((__hptr = lock_user(VERIFY_READ, __gaddr, sizeof(target_type), 1))) { \ - __ret = __get_user((x), __hptr); \ + __get_user((x), __hptr); \ unlock_user(__hptr, __gaddr, 0); \ } else { \ /* avoid warning */ \