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 B56A2C282C8 for ; Mon, 28 Jan 2019 16:17:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7C1E120879 for ; Mon, 28 Jan 2019 16:17:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548692220; bh=DH3JmvVvCn8mv/sOuFbgLikjtUeDipSEb00RPDGudyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=Kx7Qov9uzc8IXBm6vaRwl1La9iNpTv7trqg3HBNqB310qDGOvuaDqzqMBMaUanD4t kLUm8yMcBxgWAnY2GNK3Ks+ggmhimsoEEZWsvGK1WTWdnwP9hCwJQoUeWlUn+uw5gk 7unIpqzxDMG8ODCCZKU8SaCHPmBbYbf/bbofp2ew= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388084AbfA1QQ7 (ORCPT ); Mon, 28 Jan 2019 11:16:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:50394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387405AbfA1QQz (ORCPT ); Mon, 28 Jan 2019 11:16:55 -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 A54662086C; Mon, 28 Jan 2019 16:16:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548692215; bh=DH3JmvVvCn8mv/sOuFbgLikjtUeDipSEb00RPDGudyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EhKrRQKomzPoF9KcAot0BLxaGlKWqIPWyYP1pveB1OTrH11r6/1WzelGV1DFaArdF wE51XEXz7LmcRGQnt9M+qutT6hgNWb551RDlhUT1pIFjxReP678luJb2HyZ+0K0YcW VDGd3S7M2bMDa0YSazz4VwTyNROT7WucWxoCvzt8= 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.14 113/170] powerpc/uaccess: fix warning/error with access_ok() Date: Mon, 28 Jan 2019 11:11:03 -0500 Message-Id: <20190128161200.55107-113-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128161200.55107-1-sashal@kernel.org> References: <20190128161200.55107-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 565cead12be2..cf26e62b268d 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -54,7 +54,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