Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2752913imj; Mon, 11 Feb 2019 07:59:40 -0800 (PST) X-Google-Smtp-Source: AHgI3IYsbe8zijexe5BynSofu/AecC/8uCfA5p59UnQ15TPkg7I4HlxaoZsc+wNVW6VlSzpZa+rh X-Received: by 2002:a62:36c1:: with SMTP id d184mr37512265pfa.242.1549900780614; Mon, 11 Feb 2019 07:59:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900780; cv=none; d=google.com; s=arc-20160816; b=oMNbQHs5AZ0OOlLcNfpuiEfqBx8eVfFP/l09NGz4cqVjBYKdu3y5fPf5C1MmDqsA2W NEgzdmafqMTxPWJ4gPL6a77B7A3MP/fDf0iF6mCSnip9rwwoI4rFuAdYKABwIKO9Tzyg RwFLlxigPKiRZwMLieMxbRWycQ6y7t4unzQMeg1aMuXzt+L5nETmhYCn4/W1i4tly5dQ mi4E7JwsrXpLSfc8nkTvWU559DNZijFZPLcYhjag0HO3CytUkmHcRbMFDBsbbXrIHgBk O9kaRxpY8A0pN/NJ+1uPgP798EZQWJV/KSCDEPCVhGMVOs1Dxky+m/F6BZ037UZgx3EJ kbGQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M0wg4Fj/2EtdacyZB1oXJj2H8aSzcpa99nDGagoMjH0=; b=r1mtqL5QvunV9xfwbKjMqb28Tgw6itPpSyJ17Q2msMrDQQRFD6ugGfA05FiJUdgHnl AJLZYscg8i0fwRrT9+IwmB7jABmRFTHTWRXaZILjhWli5flWdB4WmAkX+rnk5f4jf6OV XOuDm5nWoiRZG3Mv1VpKueJubekwpy5A53eeSsmL4e3Kfb6uvC+UF/Up3qj9F5X3R1s/ loIuBB3v0KNT5B0X6ROaNDHAna21xfJb57rULW7PVKatCRf7xn1VMRr8czKFJtmjDzwX lG6Y9ZQutsI+9KPUuzQgmWkZ81yzZgJNTwbd0ilE8Nfi7P+lZ9lBr1LagOv9X3qy7w5I p13A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LGc1fHPs; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u20si3144435pgh.147.2019.02.11.07.59.23; Mon, 11 Feb 2019 07:59:40 -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=LGc1fHPs; 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 S1730545AbfBKOcy (ORCPT + 99 others); Mon, 11 Feb 2019 09:32:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:40390 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730522AbfBKOcv (ORCPT ); Mon, 11 Feb 2019 09:32:51 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E65A214DA; Mon, 11 Feb 2019 14:32:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895571; bh=Egzy29Qcqt8OzDM5OLctP+MXQwYRzMvHGuC++Iz2Oag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LGc1fHPsDb1ocbwkYbVA211w+suWcLb5H+53VdfWTEN9Iq7mqKRqlCDQVrsH8V4vh KvQuRM4MFHXxOeMnrgqFqb3D0zNtT/BZR3EO/fpQtWqZ/4zYWKYJgjD+VayazcjRUR 0nKRbwBudhwNiEDJTnu+oCFxX1RUrwKvuwIr9Q2A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christophe Leroy , Michael Ellerman , Sasha Levin Subject: [PATCH 4.20 210/352] powerpc/uaccess: fix warning/error with access_ok() Date: Mon, 11 Feb 2019 15:17:17 +0100 Message-Id: <20190211141900.546117792@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ 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 15bea9a0f260..ebc0b916dcf9 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