All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: akpm@linux-foundation.org, aneesh.kumar@linux.ibm.com,
	dalias@libc.org, daniel@thingy.jp, geert+renesas@glider.be,
	jacopo+renesas@jmondi.org, linux-mm@kvack.org,
	mm-commits@vger.kernel.org, rob@landley.net,
	torvalds@linux-foundation.org, ysato@users.osdn.me
Subject: [patch 13/16] sh: pgtable-3level: fix cast to pointer from integer of different size
Date: Fri, 24 Sep 2021 15:43:57 -0700	[thread overview]
Message-ID: <20210924224357.vxbK4xVVa%akpm@linux-foundation.org> (raw)
In-Reply-To: <20210924154257.1dbf6699ab8d88c0460f924f@linux-foundation.org>

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 */
_

  parent reply	other threads:[~2021-09-24 22:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 22:42 incoming Andrew Morton
2021-09-24 22:43 ` [patch 01/16] mm, hwpoison: add is_free_buddy_page() in HWPoisonHandlable() Andrew Morton
2021-09-24 22:43 ` [patch 02/16] kasan: fix Kconfig check of CC_HAS_WORKING_NOSANITIZE_ADDRESS Andrew Morton
2021-09-24 22:43 ` [patch 03/16] mm/damon: don't use strnlen() with known-bogus source length Andrew Morton
2021-09-24 22:43 ` [patch 04/16] xtensa: increase size of gcc stack frame check Andrew Morton
2021-09-24 22:43 ` [patch 05/16] mm/shmem.c: fix judgment error in shmem_is_huge() Andrew Morton
2021-09-24 22:43 ` [patch 06/16] ocfs2: drop acl cache for directories too Andrew Morton
2021-09-24 22:43 ` [patch 07/16] scripts/sorttable: riscv: fix undeclared identifier 'EM_RISCV' error Andrew Morton
2021-09-24 22:43 ` [patch 08/16] tools/vm/page-types: remove dependency on opt_file for idle page tracking Andrew Morton
2021-09-24 22:43 ` [patch 09/16] lib/zlib_inflate/inffast: check config in C to avoid unused function warning Andrew Morton
2021-09-24 22:43 ` [patch 10/16] mm: fs: invalidate bh_lrus for only cold path Andrew Morton
2021-09-24 22:43 ` [patch 11/16] mm/debug: sync up MR_CONTIG_RANGE and MR_LONGTERM_PIN Andrew Morton
2021-09-24 22:43 ` [patch 12/16] mm/debug: sync up latest migrate_reason to migrate_reason_names Andrew Morton
2021-09-24 22:43 ` Andrew Morton [this message]
2021-09-24 22:44 ` [patch 14/16] kasan: always respect CONFIG_KASAN_STACK Andrew Morton
2021-09-24 22:44 ` [patch 15/16] mm/memory_failure: fix the missing pte_unmap() call Andrew Morton
2021-09-24 22:44 ` [patch 16/16] mm: fix uninitialized use in overcommit_policy_handler Andrew Morton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210924224357.vxbK4xVVa%akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=dalias@libc.org \
    --cc=daniel@thingy.jp \
    --cc=geert+renesas@glider.be \
    --cc=jacopo+renesas@jmondi.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=rob@landley.net \
    --cc=torvalds@linux-foundation.org \
    --cc=ysato@users.osdn.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.