Received: by 2002:ac0:950e:0:0:0:0:0 with SMTP id f14csp1460640imc; Sun, 17 Mar 2019 15:08:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgHmumVu1WpCyS+Gf3qxT01W6brcihDcW7LgG0sO3Y9+f09J78CpRCJg1tkGF0LjiSzwJ9 X-Received: by 2002:a63:d5f:: with SMTP id 31mr14557669pgn.274.1552860494581; Sun, 17 Mar 2019 15:08:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552860494; cv=none; d=google.com; s=arc-20160816; b=cDW2w3stqu8hC3TyEWfWBtrcRhSBA+nGzxaj48mu/Yd7GWxPUQpjMO/tSKgkNRkj16 n5onPml0d4qq0C4bivZjS6XD7jMAtQBBhHruPvfqWlqNhrUhh/qFpqonZXxJHItIu0At MAoIG6elgj2q6JS8GU5a23DO/dHoaR43o+vJ0g4fN+8gV8kevgmFtR0+9ApRMxL1YE5v prjHvNFkZ31x2sY3DLLK8qTAajDRqKCmERzIj5e9AvVht1edbUERnZbpsbJEso13xACU sSBTnDhdJMj+ytnKSPAoPqByIFcH5jpN10fn8GDsBt3QniqEbzcGajsOWCRpB/7GxThB vGMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=IcWacMfHF/AVn0k21ppx7/coY7WOvCyg2dM8iR4NJXs=; b=HqQKbzprzxJGNDBKCt8HBQmIUYQDPVHvNfQaLUz5UilgecfgHMJljeao54WqwnblY7 m3ysmRBuOlCGWWfvUJCOeTgyRFIFhyxj/AgIVkSbNbTW1z8tiAJ+gjj3/w9Zf+0jN183 3Al+Llk7nZs4LegzPgxGBQjYNCzzsG08Feafo2+WbOWq3uow7XsZIsu0t0GuAE7ickmb nU+nZCPrOXL/36Edn5K0DuXcdehXtlan5v5gl9OpoVw2fMSihitSYnjmaSu0I4v0p+E3 nz6eVE6hJlmceyFRA6niyfzDgceKEE6aEl/UEntXa60r+bHbeLLzQe9KHTn7XLW+bw0a vn+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lca.pw header.s=google header.b=lb3u8a6p; 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 g132si8001916pfc.240.2019.03.17.15.07.59; Sun, 17 Mar 2019 15:08:14 -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=lb3u8a6p; 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 S1727508AbfCQWGI (ORCPT + 99 others); Sun, 17 Mar 2019 18:06:08 -0400 Received: from mail-qk1-f193.google.com ([209.85.222.193]:46762 "EHLO mail-qk1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbfCQWGI (ORCPT ); Sun, 17 Mar 2019 18:06:08 -0400 Received: by mail-qk1-f193.google.com with SMTP id i5so8545212qkd.13 for ; Sun, 17 Mar 2019 15:06:07 -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; bh=IcWacMfHF/AVn0k21ppx7/coY7WOvCyg2dM8iR4NJXs=; b=lb3u8a6pPVm8uoNsiHm5xunrfvg339f1A6zuVExgsvlk9TxKL7iwpSWadBnhT4yEVc j03Y2HrKwWQgLmr6JuGYlkM6jOlHsfwb7UxkXT41uHcrUIoSvjzbZH5UqzS41htO+H50 nLrNYFN4oZLh54fQp6k3C72Z4hnvjzKCL/mHmtoB3FvMdzGoC4HM5B/IgEeGRFiWOXR8 K18GEfFWmPnQuqI68PhPfc8sCVbYSs43UP03OqdK2DDeeEEQZgKyYm2hH2ThtWOFVPsm XR/pKlUjmJ+bCEdzYSwj8OmNWsI7+2Z27SnG4fChJVR5fPkg3S2xLcS9vj7mK/iDDydj kiXA== 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; bh=IcWacMfHF/AVn0k21ppx7/coY7WOvCyg2dM8iR4NJXs=; b=o5vg9Q2HwMytIeGFLQRSQH5DB19W0PF4c9tp0lQTrnI7ayt5IDL1fI7z5ujUuF7KXy u1cbII6WLDgkssXd1U5LjSxUhUFxkjYFK56bG9T2DQnsZC2Kl/mpv+0rXOjQsIVEiuwq XaF3/WRhWy9GhDAEFwEbYe8xqKpwKJv2mWd6Y011hb3mfq2RK3v0SlNejYdj9djyA9HV ElJF9rmFE1GO0IhsFRZwNStMvJCjzMa2NTsVjsvGNIQeI8XEqjh3xVvkJPzMH7LHDuZi R4ShazZqjLeGbhIFq8gMvKUCqK460D4mkZOR1+042SDo9w2flREFsw1wCzwRthJrujM6 4YYg== X-Gm-Message-State: APjAAAXBGh07xs9ZEE/FXafIZUUVXGvBKwy5irip1sCSfdsDDXENnrtl +XBr/WTCq3J91GbrOclx21775g== X-Received: by 2002:a37:4b4e:: with SMTP id y75mr10734924qka.158.1552860366714; Sun, 17 Mar 2019 15:06:06 -0700 (PDT) Received: from ovpn-116-105.phx2.redhat.com (pool-71-184-117-43.bstnma.fios.verizon.net. [71.184.117.43]) by smtp.gmail.com with ESMTPSA id x29sm5339984qtm.74.2019.03.17.15.06.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 17 Mar 2019 15:06:06 -0700 (PDT) From: Qian Cai To: mpe@ellerman.id.au, benh@kernel.crashing.org, paulus@samba.org Cc: christophe.leroy@c-s.fr, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [RESEND PATCH v2] powerpc: mute unused-but-set-variable warnings Date: Sun, 17 Mar 2019 18:05:16 -0400 Message-Id: <20190317220516.92654-1-cai@lca.pw> X-Mailer: git-send-email 2.17.2 (Apple Git-113) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pte_unmap() compiles away on some powerpc platforms, so silence the warnings below by making it a static inline function. mm/memory.c: In function 'copy_pte_range': mm/memory.c:820:24: warning: variable 'orig_dst_pte' set but not used [-Wunused-but-set-variable] mm/memory.c:820:9: warning: variable 'orig_src_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] mm/swap_state.c: In function 'swap_ra_info': mm/swap_state.c:634:15: warning: variable 'orig_pte' set but not used [-Wunused-but-set-variable] Suggested-by: Christophe Leroy Reviewed-by:: Christophe Leroy Signed-off-by: Qian Cai --- v2: make it a static inline function. arch/powerpc/include/asm/book3s/64/pgtable.h | 3 ++- arch/powerpc/include/asm/nohash/64/pgtable.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/include/asm/book3s/64/pgtable.h b/arch/powerpc/include/asm/book3s/64/pgtable.h index 868fcaf56f6b..d798e33a0c86 100644 --- a/arch/powerpc/include/asm/book3s/64/pgtable.h +++ b/arch/powerpc/include/asm/book3s/64/pgtable.h @@ -1006,7 +1006,8 @@ extern struct page *pgd_page(pgd_t pgd); (((pte_t *) pmd_page_vaddr(*(dir))) + pte_index(addr)) #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) -#define pte_unmap(pte) do { } while(0) + +static inline void pte_unmap(pte_t *pte) { } /* to find an entry in a kernel page-table-directory */ /* This now only contains the vmalloc pages */ diff --git a/arch/powerpc/include/asm/nohash/64/pgtable.h b/arch/powerpc/include/asm/nohash/64/pgtable.h index e77ed9761632..0384a3302fb6 100644 --- a/arch/powerpc/include/asm/nohash/64/pgtable.h +++ b/arch/powerpc/include/asm/nohash/64/pgtable.h @@ -205,7 +205,8 @@ static inline void pgd_set(pgd_t *pgdp, unsigned long val) (((pte_t *) pmd_page_vaddr(*(dir))) + (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1))) #define pte_offset_map(dir,addr) pte_offset_kernel((dir), (addr)) -#define pte_unmap(pte) do { } while(0) + +static inline void pte_unmap(pte_t *pte) { } /* to find an entry in a kernel page-table-directory */ /* This now only contains the vmalloc pages */ -- 2.17.2 (Apple Git-113)