mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch added to -mm tree
@ 2021-09-23 22:17 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-09-23 22:17 UTC (permalink / raw)
  To: aneesh.kumar, dalias, daniel, geert+renesas, jacopo+renesas,
	mm-commits, rob, ysato


The patch titled
     Subject: sh: pgtable-3level: fix cast to pointer from integer of different size
has been added to the -mm tree.  Its filename is
     sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Geert Uytterhoeven <geert+renesas@glider.be>
Subject: sh: pgtable-3level: fix cast to pointer from integer of different size

If X2TLB=y (CPU_SHX2=y or CPU_SHX3=y, e.g. migor_defconfig), pgd_t.pgd
is "unsigned long long", causing:

    In file included from arch/sh/include/asm/pgtable.h:13,
		     from include/linux/pgtable.h:6,
		     from include/linux/mm.h:33,
		     from arch/sh/kernel/asm-offsets.c:14:
    arch/sh/include/asm/pgtable-3level.h: In function `pud_pgtable':
    arch/sh/include/asm/pgtable-3level.h:37:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
       37 |  return (pmd_t *)pud_val(pud);
	  |         ^

Fix this by adding an intermediate cast to "unsigned long", which is
basically what the old code did before.

Link: https://lkml.kernel.org/r/2c2eef3c9a2f57e5609100a4864715ccf253d30f.1631713483.git.geert+renesas@glider.be
Fixes: 9cf6fa2458443118 ("mm: rename pud_page_vaddr to pud_pgtable and make it return pmd_t *")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Daniel Palmer <daniel@thingy.jp>
Acked-by: Rob Landley <rob@landley.net>
Cc: Yoshinori Sato <ysato@users.osdn.me>
Cc: Rich Felker <dalias@libc.org>
Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.ibm.com>
Cc: Jacopo Mondi <jacopo+renesas@jmondi.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 arch/sh/include/asm/pgtable-3level.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/arch/sh/include/asm/pgtable-3level.h~sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size
+++ a/arch/sh/include/asm/pgtable-3level.h
@@ -34,7 +34,7 @@ typedef struct { unsigned long long pmd;
 
 static inline pmd_t *pud_pgtable(pud_t pud)
 {
-	return (pmd_t *)pud_val(pud);
+	return (pmd_t *)(unsigned long)pud_val(pud);
 }
 
 /* only used by the stubbed out hugetlb gup code, should never be called */
_

Patches currently in -mm which might be from geert+renesas@glider.be are

sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch
mm-move-node_reclaim_distance-to-fix-numa-without-smp.patch
mm-move-fold_vm_numa_events-to-fix-numa-without-smp.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-09-23 22:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 22:17 + sh-pgtable-3level-fix-cast-to-pointer-from-integer-of-different-size.patch added to -mm tree akpm

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).