From patchwork Thu Feb 18 14:01:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 102744 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp605427lbl; Thu, 18 Feb 2016 06:04:55 -0800 (PST) X-Received: by 10.66.124.170 with SMTP id mj10mr10386050pab.92.1455804295503; Thu, 18 Feb 2016 06:04:55 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c74si9688072pfj.65.2016.02.18.06.04.55; Thu, 18 Feb 2016 06:04:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946367AbcBROEx (ORCPT + 30 others); Thu, 18 Feb 2016 09:04:53 -0500 Received: from mout.kundenserver.de ([212.227.17.10]:59502 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1425501AbcBROEt (ORCPT ); Thu, 18 Feb 2016 09:04:49 -0500 Received: from wuerfel.lan. ([78.42.132.4]) by mrelayeu.kundenserver.de (mreue101) with ESMTPA (Nemesis) id 0M8hqV-1Zk5jT43Bz-00wEGK; Thu, 18 Feb 2016 15:04:21 +0100 From: Arnd Bergmann To: Russell King Cc: linux-arm-kernel@lists.infradead.org, Arnd Bergmann , Ard Biesheuvel , Nicolas Pitre , Jon Medhurst , Marc Zyngier , Will Deacon , linux-kernel@vger.kernel.org Subject: [PATCH 6/9] ARM: uaccess: avoid warning for NOMMU in access_ok Date: Thu, 18 Feb 2016 15:01:58 +0100 Message-Id: <1455804123-2526139-7-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455804123-2526139-1-git-send-email-arnd@arndb.de> References: <1455804123-2526139-1-git-send-email-arnd@arndb.de> X-Provags-ID: V03:K0:Ua541HzBJT5rCyNvpOhC4kw9l2dFl7MaSTPEFPn0n16hK6rL6oN Qc1eYbk/WgxLhLIOWEZSFlb4WD1SuTmLFkRP6lhMPjlNN4f0lWnUGknUiIohMUbOHJXxLUS MhDQpgGIGRISCRUMypJcoyuD6V1Nx2yfG4DHTELkklq+E/jcgFFSIKlgZIa/XkdrApsTNY3 iTMlWUTAkLYtlF9PuUDAA== X-UI-Out-Filterresults: notjunk:1; V01:K0:12xWeJA8upo=:Wp5jSG9kqxqi9oiULc8ova npDFm02q22/UblxHsiL9QCcjFG3xIKEq5iayJ/PDeXc27CIB37B1+9UyxCcgzG/pI/MFAAOFV 8+JjZjhRo2BYLOUEbWNJtA7T8YMLGNSNdviQQs7uypMfiJi6vI6A0Ww74hu/RYMA5ciRglSYc KjNmGhfbw9bGRyYzcDxK/p77WFndQ54YmuFLCY7xYbiBfK6i5xoHJpFO0LkJTZz8KahlE3/wF 5VpHPk6qG8OoCFYiFx2zIqYS/NXx2kgiUQpgGud3rxCDulzwS687oQtu/WlXlFwyfFyPeJFv7 AL2cBC6BymlTVjiChnmC9nCVVzVfTq07meInm1LoRPZOuplKvxgfL3SOgPSeZ78mqDO35nsdb 61kemBFbqe2SPA2wAHgXsAjxf4TmoXq7RDfwoYCw/ViWfHutP3jbva2VbhefZXqDO6WNQ0Pqf PyAtFYfKstouSNo3DNoVML+0K01ZUAJ08mAxuXmYUPQtN+revM+xyi5PfQIc7EtFq1pF41P8R YrKOX3t1OtDyNCrHgs0EH+4mi+JzG7MsnzgSAAkn68/Hg3KozGQGEu6Tb5rZtNb2RlLGts+iD QplrMowa8bNnIxkJcduUScLdMu7IduU0fzkezONl7eiQ/L2K0WJBS1SseAJgKWdE2isTp7qfb fSN9yv/losI/X1ZeYjwniXitjA5cia6JrliR2p/DiIUdS15Ugbx1vr5TW00aRA/BgyfI= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When CONFIG_MMU is disabled, the access_ok() and __range_ok() macros always return success, and there is a cast to void to ensure the compiler does not warn about an unused address variable. However, at least one driver has a variable for the size argument as well and does warn about that one: drivers/vhost/vhost.c: In function 'vq_access_ok': drivers/vhost/vhost.c:633:9: warning: unused variable 's' [-Wunused-variable] This changes the macro to also ignore the size argument explicitly to shut up that warning. Signed-off-by: Arnd Bergmann --- arch/arm/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.7.0 diff --git a/arch/arm/include/asm/uaccess.h b/arch/arm/include/asm/uaccess.h index 35c9db857ebe..9c74c84a10d2 100644 --- a/arch/arm/include/asm/uaccess.h +++ b/arch/arm/include/asm/uaccess.h @@ -290,7 +290,7 @@ extern int __put_user_8(void *, unsigned long long); #define segment_eq(a, b) (1) #define __addr_ok(addr) ((void)(addr), 1) -#define __range_ok(addr, size) ((void)(addr), 0) +#define __range_ok(addr, size) ((void)(addr), (void)(size), 0) #define get_fs() (KERNEL_DS) static inline void set_fs(mm_segment_t fs)