Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3634023imu; Mon, 28 Jan 2019 08:10:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN4rbyn/I4ca4jaxVUoGY3EsictDugOA13Na6qy2E3XMYTOYSfCsfenRIWk4BX9jvb5dpd6R X-Received: by 2002:a63:4611:: with SMTP id t17mr20262503pga.119.1548691842614; Mon, 28 Jan 2019 08:10:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548691842; cv=none; d=google.com; s=arc-20160816; b=p5VoR5dA0C85ikZHjXRSUNuUfad1KTmXJb5Vixnov5Q/QazyZ9ddsVw6Gx2mgFRhiM /u0cg97JhGouaas0/QlPRyp9EjBas9mZPuoYoDzle/FLG0Hh/t8IuGteVWiDFV+B+oSz lKADrx6Ozid55M9HB0Ux4my3eiaeLOIxT/L8SyE70JaLWYOKC1W7RAfr4aKQNGODpPvn rlKzCg3hHaR3eY6QDnKyLxV+qJBmPEthsY+PfCnmjDHMNWA86SMXBx4Z9Um2jR1EmpVT iNY1MjtXIXF6VcR+wA7iXFJL2NwBnEDEwTeNX2udyeiDv81MPGibBoAj+ErrLDu2Psn4 SVYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vZvkQVT2heDGlWy4RXolo5vwNcOg3dGhar5VXGDlJdI=; b=pz63Od1US7X5SBaUJ+iXc/opNkOo1ulIoiP9kBPORhNv3jmKiugBlvMNJ0F3845xxH M85ZFhFV8fmZxWxyoyLiGHv259r1asgNhgsQFJaSTRCu9jzZL2ak6Kip4M3G28H0uNnV XfSRnvTq4/+W6PtB7VBFZm5dqH23C/3u6O0qtSnTtYxN21PZOm+nIyI/TW90c4uh4zg9 Uc/LDW2UVEx2osiYlor63cAv8xUuXjRiBEKCTR+Rq7E2QFizgm9nP1BbTKCho+0xmcyC ZcVt75bKKq+fXyKXoztE4rKakX3y1Af5J1w4klxce3S8CbOM7m2HWphN+g6YrmEr9ns/ l+rA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NLxKeT+S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i5si11812168pgn.243.2019.01.28.08.10.27; Mon, 28 Jan 2019 08:10:42 -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; dkim=pass header.i=@kernel.org header.s=default header.b=NLxKeT+S; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732347AbfA1QIO (ORCPT + 99 others); Mon, 28 Jan 2019 11:08:14 -0500 Received: from mail.kernel.org ([198.145.29.99]:59710 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731682AbfA1QIM (ORCPT ); Mon, 28 Jan 2019 11:08:12 -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 ABAE420989; Mon, 28 Jan 2019 16:08:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548691692; bh=wqkf0fkLShcxze+9Nn2AvM9iTOb15S7UUiHJyO1H7qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLxKeT+SVXUzJ2rzwkMq7e+uu27u1EeB27X7i7txH2u5aNE23MfGy6nuitwel2eK0 nkaSOUTw3IBISbPVq4yhl8zOzWpki9LVhGWLGrxIYydhPv0O0VGZRJbaqAgUB2CtP3 2vR2XUSpfPHhrZ4SKYglaZfgSsdeBLdovqbNmh3Y= 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.19 186/258] powerpc/uaccess: fix warning/error with access_ok() Date: Mon, 28 Jan 2019 10:58:12 -0500 Message-Id: <20190128155924.51521-186-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190128155924.51521-1-sashal@kernel.org> References: <20190128155924.51521-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 bac225bb7f64..23bea99bf8d5 100644 --- a/arch/powerpc/include/asm/uaccess.h +++ b/arch/powerpc/include/asm/uaccess.h @@ -63,7 +63,7 @@ static inline int __access_ok(unsigned long addr, unsigned long size, #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