Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp1198245ybm; Wed, 22 May 2019 19:34:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY8Pv7o7LNKTHG4oqEoWAuJdQJS7qyfTeRsdwgzvQCjSl/8aWG21wEYXpDle7W2H1pi4Hq X-Received: by 2002:a65:64c9:: with SMTP id t9mr93651576pgv.221.1558578865468; Wed, 22 May 2019 19:34:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558578865; cv=none; d=google.com; s=arc-20160816; b=S5tCYNTCRzsnE8g9Bj4yuXyiM+JNcyvQo1xCptx6sG6/O3uczB3lsIapc8J4PAGxvD /8B6hwBS0PsLnNbbjnZVTyxKhmuVPFJhrgu1iNVLp1lifG7+cTF6LGi0sKc9WlMuiFhH 62Fv4+E9CbZYls2vrdDrcteJ58xPJsiiMg+fcvIBDY46d78dMNDqf5GDBFBUDL3ciIM/ tSrt6lt456n/U/bAIiA9gnijHgO4l3tCu2uAT0oGErc+eQ86WwuW/McOvIKrgSqZmfzz twcdqJ/BNOGHypqBKpaO6vnoJC1GNJq0K7ouXhYNEh+YFlsb/26k5HxJDHxmFcD42IT3 7l5A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=w1BRoEDPELMK0Gyp9/s2p/rcYNsdRckdJGf7yGafkuk=; b=tiVNgTVjEPQ0wy5z83iC9ZgFsq6UTLFFZAf/9dmqn6YUSHX1HYXduPzdXUdLMUgogk nPyT7R5TbgED5ONW3uMd5SRm4806rzRJj7Px87FjWAhwzpKHWZCGUqiJ/11X5RIgRMbe dYRiHDQoukHR0WVaQ+sRXkB+G3jmA8eBw6Dbmv8SSB4qJunUL8C28ZKAXsIeoRlHIsdY 0iAph+N3X3RhELTJz8UcMYFKTRKIR5M8fjhMsIGIM6U7mjjhBE2kSUbQrawfxz5sI9Az HZxikbcZsE1gmUSnCE8CE8yivq0khNFhBlyW0ITMfCLPSSsMFDjRu3txzivAawDpXYkx XVIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=fs3cKvK0; 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 bh11si26456250plb.383.2019.05.22.19.34.10; Wed, 22 May 2019 19:34:25 -0700 (PDT) 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=@lca.pw header.s=google header.b=fs3cKvK0; 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 S1728668AbfEWCch (ORCPT + 99 others); Wed, 22 May 2019 22:32:37 -0400 Received: from mail-qt1-f194.google.com ([209.85.160.194]:40894 "EHLO mail-qt1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727802AbfEWCch (ORCPT ); Wed, 22 May 2019 22:32:37 -0400 Received: by mail-qt1-f194.google.com with SMTP id k24so4978556qtq.7 for ; Wed, 22 May 2019 19:32:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lca.pw; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w1BRoEDPELMK0Gyp9/s2p/rcYNsdRckdJGf7yGafkuk=; b=fs3cKvK0NKboTT76WS2fOatBli8xun3JE9RHPbc8Y7ra9i2bA9b+aNHPVgi2NOuEh9 Sd5ZMaa4Iqwn3Y0zFXXwS/t9vhQ7qx3cqzUWZd6BtEVHeKeT/2YC8ACuc89T9bhYBlBN tAwI7GH7qRt/ANpVMLvKLfRpD27QtExgoc+e0V3JY4w5S1QSuTnhvAFsxpzZ6+ZmVE4J BUBbKREis/mvL9qmSOyoE+eKFb9VFUnaT2QHpkA9LuxeAYAX2w8eNE5f+G+deolb8+tt Hlbd1wFXYtOudAn3gYWzSAfpsEbdY+YIY9zLQx04JTViMMr+MJjbn2lIZC+kUWlObBTD Yvkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=w1BRoEDPELMK0Gyp9/s2p/rcYNsdRckdJGf7yGafkuk=; b=Z+NeFk+DqIGjOjIRO6PnZ1SBtV5fttRSrDHdX0Y4POCriBf3IAylL0qUfzxmJ8jKWH ZZupE4t8zOy6ID1oKurO+ZYY4SMl/PaanTTP2qc8/MejSkk4H0Te9HWaXVSWFZ8jaGsh X35RjIVyILEtWmqTUacj9WmTRxa0uL2TaRT0shjQl/Rb8Ck95rbBT3DlvTwOfglFfeYt WtA6pO2yiReLzsiOhI8wKCu/fGTUfHGOZrz6VBc+oqAphxPa/XhmgPe6JPhyvsJHM3oL pwbSqZe3dIK/fFZ45X9RvmozQREZ3K9BywCJeyqhxOm3/FHxzTK8963fxra9/NAdr9Rb PHHw== X-Gm-Message-State: APjAAAWXUHyKXv0igs0oyPCpYE0P5ZbovmQzUtumbZHKv64A05Z7xjwD qVllcLvI1kC61qyVTzr2oCtIag== X-Received: by 2002:a0c:9228:: with SMTP id a37mr15950616qva.221.1558578756618; Wed, 22 May 2019 19:32:36 -0700 (PDT) Received: from ovpn-121-0.rdu2.redhat.com (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id q66sm12891044qke.66.2019.05.22.19.32.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 May 2019 19:32:35 -0700 (PDT) From: Qian Cai To: benh@kernel.crashing.org, paulus@samba.org, mpe@ellerman.id.au Cc: aik@ozlabs.ru, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [PATCH] powerpc/powernv: fix variable "c" set but not used Date: Wed, 22 May 2019 22:31:41 -0400 Message-Id: <20190523023141.2973-1-cai@lca.pw> X-Mailer: git-send-email 2.20.1 (Apple Git-117) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The commit 58629c0dc349 ("powerpc/powernv/npu: Fault user page into the hypervisor's pagetable") introduced a variable "c" to be used in __get_user() and __get_user_nocheck() which need to stay as macros for performance reasons, and "c" is not actually used in pnv_npu2_handle_fault(), arch/powerpc/platforms/powernv/npu-dma.c: In function 'pnv_npu2_handle_fault': arch/powerpc/platforms/powernv/npu-dma.c:1122:7: warning: variable 'c' set but not used [-Wunused-but-set-variable] Fixed it by appending the __maybe_unused attribute, so compilers would ignore it. Signed-off-by: Qian Cai --- arch/powerpc/platforms/powernv/npu-dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c index 495550432f3d..5bbe59573ee6 100644 --- a/arch/powerpc/platforms/powernv/npu-dma.c +++ b/arch/powerpc/platforms/powernv/npu-dma.c @@ -1119,7 +1119,8 @@ int pnv_npu2_handle_fault(struct npu_context *context, uintptr_t *ea, int i, is_write; struct page *page[1]; const char __user *u; - char c; + /* To silence a -Wunused-but-set-variable warning. */ + char c __maybe_unused; /* mmap_sem should be held so the struct_mm must be present */ struct mm_struct *mm = context->mm; -- 2.20.1 (Apple Git-117)