All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] m68k: fix __page_to_pfn for a const struct page argument
@ 2011-08-18  8:37 Ian Campbell
  2011-08-23  7:56 ` Geert Uytterhoeven
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Campbell @ 2011-08-18  8:37 UTC (permalink / raw)
  To: linux-m68k; +Cc: Ian Campbell, Andrew Morton, Geert Uytterhoeven

Fixes fallout due to the removal of the cast in
mm-fix-__page_to_pfn-for-a-const-struct-page-argument.patch

(akpm: this should probably be folded into that patch. I glanced over the other
       architectures which appear not to use include/asm-generic/memory_model.h
       and they appear to follow the other pattern (using ptr arithmetic) and
       hence I think aren't susceptible to this issue).

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: linux-m68k@lists.linux-m68k.org
---
 arch/m68k/include/asm/page_mm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
index 31d5570..89f2014 100644
--- a/arch/m68k/include/asm/page_mm.h
+++ b/arch/m68k/include/asm/page_mm.h
@@ -162,7 +162,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void)
 	pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn);		\
 })
 #define page_to_pfn(_page) ({						\
-	struct page *__p = (_page);					\
+	const struct page *__p = (_page);				\
 	struct pglist_data *pgdat;					\
 	pgdat = &pg_data_map[page_to_nid(__p)];				\
 	((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn;		\
-- 
1.7.2.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] m68k: fix __page_to_pfn for a const struct page argument
  2011-08-18  8:37 [PATCH] m68k: fix __page_to_pfn for a const struct page argument Ian Campbell
@ 2011-08-23  7:56 ` Geert Uytterhoeven
  0 siblings, 0 replies; 2+ messages in thread
From: Geert Uytterhoeven @ 2011-08-23  7:56 UTC (permalink / raw)
  To: Ian Campbell, Linus Torvalds; +Cc: linux-m68k, Andrew Morton

On Thu, Aug 18, 2011 at 10:37, Ian Campbell <ian.campbell@citrix.com> wrote:
> Fixes fallout due to the removal of the cast in
> mm-fix-__page_to_pfn-for-a-const-struct-page-argument.patch
>
> (akpm: this should probably be folded into that patch. I glanced over the other
>       architectures which appear not to use include/asm-generic/memory_model.h
>       and they appear to follow the other pattern (using ptr arithmetic) and
>       hence I think aren't susceptible to this issue).
>
> Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Geert Uytterhoeven <geert@linux-m68k.org>

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>

The original patch claimed to fix the callers of __page_to_pfn(),
while it actually changed (and thus broke) the caller of page_to_pfn()...
Please put this on the fast track.

> Cc: linux-m68k@lists.linux-m68k.org
> ---
>  arch/m68k/include/asm/page_mm.h |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/m68k/include/asm/page_mm.h b/arch/m68k/include/asm/page_mm.h
> index 31d5570..89f2014 100644
> --- a/arch/m68k/include/asm/page_mm.h
> +++ b/arch/m68k/include/asm/page_mm.h
> @@ -162,7 +162,7 @@ static inline __attribute_const__ int __virt_to_node_shift(void)
>        pgdat->node_mem_map + (__pfn - pgdat->node_start_pfn);          \
>  })
>  #define page_to_pfn(_page) ({                                          \
> -       struct page *__p = (_page);                                     \
> +       const struct page *__p = (_page);                               \
>        struct pglist_data *pgdat;                                      \
>        pgdat = &pg_data_map[page_to_nid(__p)];                         \
>        ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn;          \
> --
> 1.7.2.5

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-08-23  7:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-18  8:37 [PATCH] m68k: fix __page_to_pfn for a const struct page argument Ian Campbell
2011-08-23  7:56 ` Geert Uytterhoeven

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.