From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6B78C282C8 for ; Mon, 28 Jan 2019 16:36:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7A0BD20844 for ; Mon, 28 Jan 2019 16:36:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548693387; bh=jrZzuc4k34f+c7tBM1X+krHhiGj3GRg7G+UAWtHJPHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=rdu1f3lcdEJ0FH9NXLVGX1VSWfNai+ib+MYjQlf1SXkfklgP8y6ggA0F89/dSESs8 vtsuv3yqOhDiquJsr2pp+Rbc6rxKhNcOusmB9shGsimhnSNZve79Jcm2cJ25hsuAMJ Q0DaMsOdSuTCGwMJgNQHnb/kuijg7ajdLOnnkOcc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389931AbfA1QZ0 (ORCPT ); Mon, 28 Jan 2019 11:25:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:34244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388483AbfA1QZZ (ORCPT ); Mon, 28 Jan 2019 11:25:25 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F0342084A; Mon, 28 Jan 2019 16:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548692724; bh=jrZzuc4k34f+c7tBM1X+krHhiGj3GRg7G+UAWtHJPHc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XqpKJl69Sx8F/OESJN7x14QCeCvvZjgUzEnwFIfuM3dQkKWzbktsrux1ptsGbksrt aJNGs28gpzn8TlWhLY6H3/WyL139Tkzu/Sgwu9IrcWf9hubuZJmfKJ+5YFk6IWQSO0 Guj7H1ktQel2Sv5jKH1sT+yUUMQdO+rMxC016t0Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Christophe Leroy , Michael Ellerman , Sasha Levin , linuxppc-dev@lists.ozlabs.org Subject: [PATCH AUTOSEL 4.4 48/80] powerpc/uaccess: fix warning/error with access_ok() Date: Mon, 28 Jan 2019 11:23:29 -0500 Message-Id: <20190128162401.58841-48-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128162401.58841-1-sashal@kernel.org> References: <20190128162401.58841-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Christophe Leroy [ Upstream commit 05a4ab823983d9136a460b7b5e0d49ee709a6f86 ] With the following piece of code, the following compilation warning is encountered: if (_IOC_DIR(ioc) != _IOC_NONE) { int verify = _IOC_DIR(ioc) & _IOC_READ ? VERIFY_WRITE : VERIFY_READ; if (!access_ok(verify, ioarg, _IOC_SIZE(ioc))) { drivers/platform/test/dev.c: In function 'my_ioctl': drivers/platform/test/dev.c:219:7: warning: unused variable 'verify' [-Wunused-variable] int verify = _IOC_DIR(ioc) & _IOC_READ ? VERIFY_WRITE : VERIFY_READ; This patch fixes it by referencing 'type' in the macro allthough doing nothing with it. Signed-off-by: Christophe Leroy Signed-off-by: Michael Ellerman Signed-off-by: Sasha Levin --- arch/powerpc/include/asm/uaccess.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/include/asm/uaccess.h b/arch/powerpc/include/asm/uaccess.h index a5ffe0207c16..05f1389228d2 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -59,7 +59,7 @@ #endif #define access_ok(type, addr, size) \ - (__chk_user_ptr(addr), \ + (__chk_user_ptr(addr), (void)(type), \ __access_ok((__force unsigned long)(addr), (size), get_fs())) /* -- 2.19.1