Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp277899ybi; Wed, 29 May 2019 21:13:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqyZRB13YSC7gaE4z0WGpSqxOZ5oP9aDc8Sr0kDWba2Sv2HFx6cYrjDwhaVzkvDW4dxa2uzu X-Received: by 2002:a63:6f0b:: with SMTP id k11mr1875830pgc.342.1559189636116; Wed, 29 May 2019 21:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559189636; cv=none; d=google.com; s=arc-20160816; b=K7wcVEaU8r4rWtvZdCMCRI59vRH/wTc128pk9ckQ2+cHSU8kh8SoADS7rA+SxxYccA JFKSU7DELrsQ3aQZJKmoac/HOnYvP46jqtfp+rzP1KFI4HjIFFIZ/8Fc84KRI3wjZdoy ia0ZYMnes6jqaiC454zJixUBrUTvsDAxxOwEiSxCNp9xkrzuNQpe13/4amst5rXfhkXR 0LoqUoAXeYGGdh0L2jo0+LM7IVtP8z7qYF09IDGYjLGRQpN23BuTgqomL8L4SOWGkojh xrsLw8yp2RIQSEnB1ql5u+AZogTNjXWeu8UCjMmHrThs2hgYQ340JFA2IlJOBCwZxQ2Z AErA== 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=95c4ffOnNyYggxJtQbBP5I378TnH9TUYOmlhzspa42A=; b=0dOx1Yf16MyhMvzp8Fg1Jjv7WR3Iq+HzikyY1rHKwMxdr16+9oYeOGVv4UchqzVTD1 teXMUahOYW0gguacyGru/CzCDnxnLs16nxnhGVAXyqaxKSfAcKr/0JmkEASdWkUL0QKm agm7XeIwn4dUliRjqG2wcJFg7lBQjP3Z1uQ9XJQwvfggHbdKEvbo/84uLDmgHRa2s8Ri YFRAzvqt/1tYcwn9axf66JEeMhLWsHUV/NuD8RZHoPK/u4+A54inPJg7pBxRcBuzyzJn G6CLuxURNaBDvVi7IAW/quiIuADZXNxm2ecuXXJFBBT4IGmh7oV9GpKi5h0tVu3ytVXr kEgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Bpr6N3zF; 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 h16si2271087pfn.162.2019.05.29.21.13.40; Wed, 29 May 2019 21:13:56 -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=@kernel.org header.s=default header.b=Bpr6N3zF; 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 S1727216AbfE3EMg (ORCPT + 99 others); Thu, 30 May 2019 00:12:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:43280 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730737AbfE3DQh (ORCPT ); Wed, 29 May 2019 23:16:37 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 42CD72460D; Thu, 30 May 2019 03:16:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186197; bh=ZLRis+wSylIUGi+RIBvcKaF3A0kD1ZnA9EObKb4kYvc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bpr6N3zFCRikmFeeKYPl53gpShUonC5+9TJQAMnOVgTdwYJ/XmCCpwwL2Aqg5q6qB oCgocOUwqSheKcBX23z27Kk8lineNjVGfX8YWrMJIvpxtZ7xD0sHGOq49AZSCVZeX1 /Vl9MGtCkvW57HY9jW35JP/rZYTEY90rrbfDG5Wo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , Will Deacon , Sasha Levin Subject: [PATCH 4.19 072/276] arm64: Fix compiler warning from pte_unmap() with -Wunused-but-set-variable Date: Wed, 29 May 2019 20:03:50 -0700 Message-Id: <20190530030530.898039777@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 74dd022f9e6260c3b5b8d15901d27ebcc5f21eda ] When building with -Wunused-but-set-variable, the compiler shouts about a number of pte_unmap() users, since this expands to an empty macro on arm64: | mm/gup.c: In function 'gup_pte_range': | mm/gup.c:1727:16: warning: variable 'ptem' set but not used | [-Wunused-but-set-variable] | mm/gup.c: At top level: | mm/memory.c: In function 'copy_pte_range': | mm/memory.c:821:24: warning: variable 'orig_dst_pte' set but not used | [-Wunused-but-set-variable] | mm/memory.c:821:9: warning: variable 'orig_src_pte' set but not used | [-Wunused-but-set-variable] | mm/swap_state.c: In function 'swap_ra_info': | mm/swap_state.c:641:15: warning: variable 'orig_pte' set but not used | [-Wunused-but-set-variable] | mm/madvise.c: In function 'madvise_free_pte_range': | mm/madvise.c:318:9: warning: variable 'orig_pte' set but not used | [-Wunused-but-set-variable] Rewrite pte_unmap() as a static inline function, which silences the warnings. Signed-off-by: Qian Cai Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- arch/arm64/include/asm/pgtable.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 1bdeca8918a68..ea423db393644 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h @@ -444,6 +444,8 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd) return __pmd_to_phys(pmd); } +static inline void pte_unmap(pte_t *pte) { } + /* Find an entry in the third-level page table. */ #define pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) @@ -452,7 +454,6 @@ static inline phys_addr_t pmd_page_paddr(pmd_t pmd) #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) #define pte_offset_map_nested(dir,addr) pte_offset_kernel((dir), (addr)) -#define pte_unmap(pte) do { } while (0) #define pte_unmap_nested(pte) do { } while (0) #define pte_set_fixmap(addr) ((pte_t *)set_fixmap_offset(FIX_PTE, addr)) -- 2.20.1