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.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 BBD58C282D7 for ; Mon, 11 Feb 2019 14:59:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8AF4A2229E for ; Mon, 11 Feb 2019 14:59:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897156; bh=Dpf4La3DAcKPg/Q9XEvfrIyt5D5klPBhsLOiyKdnt20=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=r99kVw44x76W2miWFCrhuX/zfvNmjg+cjHXIo7sG1o8EBYNvNMdiJe9b0zEPvTlZi N/Ypn7m0/cc3uWam8czd0GhhdJxbj/Dnac/tG09Kd1p8Rfg+bcQkqvOqGJpNUpyq4X nC6qyrxC2dxZO4I1ZsREC6ZBklmDI45rWtflwCfs= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389756AbfBKO7P (ORCPT ); Mon, 11 Feb 2019 09:59:15 -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: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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