* [PATCH] powerpc: fix "sz" set but not used @ 2019-02-28 2:35 Qian Cai 2019-03-01 3:24 ` Michael Ellerman 2019-03-04 0:48 ` Michael Ellerman 0 siblings, 2 replies; 3+ messages in thread From: Qian Cai @ 2019-02-28 2:35 UTC (permalink / raw) To: benh, paulus, mpe; +Cc: Qian Cai, linuxppc-dev, linux-kernel arch/powerpc/mm/hugetlbpage-hash64.c: In function '__hash_page_huge': arch/powerpc/mm/hugetlbpage-hash64.c:29:28: warning: variable 'sz' set but not used [-Wunused-but-set-variable] Signed-off-by: Qian Cai <cai@lca.pw> --- arch/powerpc/mm/hugetlbpage-hash64.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c index 2e6a8f9345d3..f6b09edc5e6e 100644 --- a/arch/powerpc/mm/hugetlbpage-hash64.c +++ b/arch/powerpc/mm/hugetlbpage-hash64.c @@ -26,7 +26,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, real_pte_t rpte; unsigned long vpn; unsigned long old_pte, new_pte; - unsigned long rflags, pa, sz; + unsigned long rflags, pa; long slot, offset; BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); @@ -73,7 +73,6 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, offset = PTRS_PER_PMD; rpte = __real_pte(__pte(old_pte), ptep, offset); - sz = ((1UL) << shift); if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) /* No CPU has hugepages but lacks no execute, so we * don't need to worry about that case */ -- 2.17.2 (Apple Git-113) ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powerpc: fix "sz" set but not used 2019-02-28 2:35 [PATCH] powerpc: fix "sz" set but not used Qian Cai @ 2019-03-01 3:24 ` Michael Ellerman 2019-03-04 0:48 ` Michael Ellerman 1 sibling, 0 replies; 3+ messages in thread From: Michael Ellerman @ 2019-03-01 3:24 UTC (permalink / raw) To: Qian Cai, benh, paulus; +Cc: Qian Cai, linuxppc-dev, linux-kernel Qian Cai <cai@lca.pw> writes: > arch/powerpc/mm/hugetlbpage-hash64.c: In function '__hash_page_huge': > arch/powerpc/mm/hugetlbpage-hash64.c:29:28: warning: variable 'sz' set > but not used [-Wunused-but-set-variable] It's always nice to know *why* it's not used. It's unlikely, but not impossible, that it's a bug that the variable is not used. To find out why: $ git log --oneline -S sz arch/powerpc/mm/hugetlbpage-hash64.c 0895ecda7942 powerpc/mm: Bring hugepage PTE accessor functions back into sync with normal accessors 883a3e523672 powerpc/mm: Split hash MMU specific hugepage code into a new file Then we look at those, and see the the first one did: @@ -89,8 +62,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) /* No CPU has hugepages but lacks no execute, so we * don't need to worry about that case */ - rflags = hash_huge_page_do_lazy_icache(rflags, __pte(old_pte), - trap, sz); + rflags = hash_page_do_lazy_icache(rflags, __pte(old_pte), trap); And if you read the commit log it's pretty clear the change was deliberate and so sz should indeed be removed. I've applied this as-is, no need to send a v2. cheers > diff --git a/arch/powerpc/mm/hugetlbpage-hash64.c b/arch/powerpc/mm/hugetlbpage-hash64.c > index 2e6a8f9345d3..f6b09edc5e6e 100644 > --- a/arch/powerpc/mm/hugetlbpage-hash64.c > +++ b/arch/powerpc/mm/hugetlbpage-hash64.c > @@ -26,7 +26,7 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, > real_pte_t rpte; > unsigned long vpn; > unsigned long old_pte, new_pte; > - unsigned long rflags, pa, sz; > + unsigned long rflags, pa; > long slot, offset; > > BUG_ON(shift != mmu_psize_defs[mmu_psize].shift); > @@ -73,7 +73,6 @@ int __hash_page_huge(unsigned long ea, unsigned long access, unsigned long vsid, > offset = PTRS_PER_PMD; > rpte = __real_pte(__pte(old_pte), ptep, offset); > > - sz = ((1UL) << shift); > if (!cpu_has_feature(CPU_FTR_COHERENT_ICACHE)) > /* No CPU has hugepages but lacks no execute, so we > * don't need to worry about that case */ > -- > 2.17.2 (Apple Git-113) ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: powerpc: fix "sz" set but not used 2019-02-28 2:35 [PATCH] powerpc: fix "sz" set but not used Qian Cai 2019-03-01 3:24 ` Michael Ellerman @ 2019-03-04 0:48 ` Michael Ellerman 1 sibling, 0 replies; 3+ messages in thread From: Michael Ellerman @ 2019-03-04 0:48 UTC (permalink / raw) To: Qian Cai, benh, paulus; +Cc: linuxppc-dev, Qian Cai, linux-kernel On Thu, 2019-02-28 at 02:35:05 UTC, Qian Cai wrote: > arch/powerpc/mm/hugetlbpage-hash64.c: In function '__hash_page_huge': > arch/powerpc/mm/hugetlbpage-hash64.c:29:28: warning: variable 'sz' set > but not used [-Wunused-but-set-variable] > > Signed-off-by: Qian Cai <cai@lca.pw> Applied to powerpc next, thanks. https://git.kernel.org/powerpc/c/8132cf115efc3b3684bb5fd3bfdf6860 cheers ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-03-04 0:54 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-02-28 2:35 [PATCH] powerpc: fix "sz" set but not used Qian Cai 2019-03-01 3:24 ` Michael Ellerman 2019-03-04 0:48 ` Michael Ellerman
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).