Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2683685imj; Mon, 11 Feb 2019 07:00:31 -0800 (PST) X-Google-Smtp-Source: AHgI3IaDrrBlU1jTWvF0cq4vn339kEb2KjnYml3AGkCCowl8sfCrrKP5vbxs9INle+12StyDhnEB X-Received: by 2002:a62:380a:: with SMTP id f10mr23945597pfa.100.1549897231347; Mon, 11 Feb 2019 07:00:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897231; cv=none; d=google.com; s=arc-20160816; b=cfR4sIZwwgt6luAbTmnlnEux2CJXbWCJ4u+xkzykyW5jZn6dWZRC3O8EZXr11YGkAT QFtbOg5ReGWUY10poe9IaeIvuspCzMxZsejLJQMgXZIFyPnBWAywWy45gleesFn/fqfW vR8oP3An6Cvuqf5w2KB0GnUZ8s9qNpwI5O9ngO27ETfFRuZpABmjvUGaO57lEUxS8oWz rA4tLAckymkAnEwqIei47ht8kziySwMR5f6K70s39h/Q3+Eb8Eq/ULgEzBXW/XjUYpx9 A0yCNfNvxTJTCpvfPpHib6rspPm6HymzMDfWV50ntSpW3s4tRkSu6j0kLzpfGzQo9A8K 4rEA== 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=4BKjZEOK6kfPMnRFeeh6ZeFedYx8HSXf0bIqiUXqErI=; b=l1hXCSphB6qV2Z8y4wcEp0VQp+JrojhLri1t0kSpUVlf6wZ//pdSz/Ugh+lFFcwSVn cjx6v3xNg1AW0stm885JvqrtZ8x88NU6tcbIyXh6rgBBqQ0umGGayhu2J6yjEKxtA7T5 L8kksD56ss4XZsLBXU0hlh+8Dyr14nLg3rnISvak7N7AA51aqd5ZcpSkQrPy2y08oTaV Sq8JJcfLgwbiKdScyXyzTUdBMLkIzgQBQjQaBv/xyed2552fFRrBOAir8DwF7nppYpkp yG8RWFZwOu3ffcwR4Yq9TEMRGxt4W/VxRL7/ELHDJ9rdz6iFAePEF/8xuGXspdf0MSkX CNAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rXhdFejN; 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 y188si8558688pfy.254.2019.02.11.07.00.14; Mon, 11 Feb 2019 07:00:31 -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=rXhdFejN; 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 S2389293AbfBKO7T (ORCPT + 99 others); Mon, 11 Feb 2019 09:59:19 -0500 Received: from mail.kernel.org ([198.145.29.99]:46988 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389755AbfBKO7P (ORCPT ); Mon, 11 Feb 2019 09:59:15 -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 E87DF206BA; Mon, 11 Feb 2019 14:59:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897154; bh=Dpf4La3DAcKPg/Q9XEvfrIyt5D5klPBhsLOiyKdnt20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rXhdFejNKRY/qflCvOSKsA8R0s8/RRMtj6aI/CnfNQ0ptwnPWYkUxTgDqhtYHCcj1 U7idOIx5QbNIeG2vA2P/zId3p6Gs9vwiDbXB6EVTVUVHgjJvqoOY9kBBkrfmK9syap 5gFL4Wzx2I2LmEYdXDVjx9WmgGF2/GSm+r6Ba8KE= 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.14 108/205] powerpc/uaccess: fix warning/error with access_ok() Date: Mon, 11 Feb 2019 15:18:26 +0100 Message-Id: <20190211141835.604417744@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 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