All of lore.kernel.org
 help / color / mirror / Atom feed
* linux-next: rr-latest-cpumask/sparc tree build failure
@ 2009-06-12  8:51 Stephen Rothwell
  2009-06-12 11:22   ` Rusty Russell
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Rothwell @ 2009-06-12  8:51 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-next, linux-kernel, David S. Miller

Hi Rusty,

Today's linux-next build (sparc64 defconfig) failed like this:

arch/sparc/mm/init_64.c: In function 'paging_init':
arch/sparc/mm/init_64.c:1802: error: 'CPU_MASK_ALL_PTR' undeclared (first use in this function)
arch/sparc/kernel/smp_64.c: In function 'setup_per_cpu_areas':
arch/sparc/kernel/smp_64.c:1541: error: 'CPU_MASK_ALL_PTR' undeclared (first use in this function)

Caused by commit b46586049330222ccab229a1a1e498e94c5fa5dc
("cpumask:remove-CPU_MASK_ALL_PTR") from the rr-latest-cpumask tree
interacting with commits 21bc149d59288fe43d1ba18a59d874ba6a5f1db9
("sparc64: Make mdesc_fill_in_cpu_data take a cpumask_t pointer") and
63750a3dc53a87a1f5ca42101ea88578b934ab52 ("sparc64: Defer cpu_data()
setup until end of per-cpu data initialization") from the sparc tree.

I applied this patch:

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Fri, 12 Jun 2009 18:43:54 +1000
Subject: [PATCH] sparc: replace uses of CPU_MASK_ALL_PTR

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
 arch/sparc/kernel/smp_64.c |    2 +-
 arch/sparc/mm/init_64.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/sparc/kernel/smp_64.c b/arch/sparc/kernel/smp_64.c
index 1de47d2..f3a83b0 100644
--- a/arch/sparc/kernel/smp_64.c
+++ b/arch/sparc/kernel/smp_64.c
@@ -1538,5 +1538,5 @@ void __init setup_per_cpu_areas(void)
 
 	of_fill_in_cpu_data();
 	if (tlb_type == hypervisor)
-		mdesc_fill_in_cpu_data(CPU_MASK_ALL_PTR);
+		mdesc_fill_in_cpu_data(cpu_all_mask);
 }
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
index b5a5932..ca92e2f 100644
--- a/arch/sparc/mm/init_64.c
+++ b/arch/sparc/mm/init_64.c
@@ -1799,7 +1799,7 @@ void __init paging_init(void)
 
 	if (tlb_type == hypervisor) {
 		sun4v_mdesc_init();
-		mdesc_populate_present_mask(CPU_MASK_ALL_PTR);
+		mdesc_populate_present_mask(cpu_all_mask);
 	}
 
 	/* Once the OF device tree and MDESC have been setup, we know
-- 
1.6.3.1


-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

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

* Re: linux-next: rr-latest-cpumask/sparc tree build failure
  2009-06-12  8:51 linux-next: rr-latest-cpumask/sparc tree build failure Stephen Rothwell
@ 2009-06-12 11:22   ` Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2009-06-12 11:10 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, David S. Miller, sparclinux

On Fri, 12 Jun 2009 06:21:02 pm Stephen Rothwell wrote:
> Hi Rusty,
>
> Today's linux-next build (sparc64 defconfig) failed like this:
>
> arch/sparc/mm/init_64.c: In function 'paging_init':
> arch/sparc/mm/init_64.c:1802: error: 'CPU_MASK_ALL_PTR' undeclared (first

OK, Dave could you take/fold Stephen's fix then?

FYI here's the patch explaining why we're CPU_MASK_ALL_PTR -> cpu_all_mask:

Subject: cpumask: remove dangerous CPU_MASK_ALL_PTR

(Thanks to Al Viro for reminding me of this, via Ingo)

CPU_MASK_ALL is the (deprecated) "all bits set" cpumask, defined as so:

	#define CPU_MASK_ALL (cpumask_t) { { ... } }

Taking the address of such a temporary is questionable at best,
unfortunately 321a8e9d (cpumask: add CPU_MASK_ALL_PTR macro) added
CPU_MASK_ALL_PTR:

	#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)

Which formalizes this practice.  One day gcc could bite us over this
usage (though we seem to have gotten away with it so far).

Now all callers are removed, we kill it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mike Travis <travis@sgi.com>
---
 include/linux/cpumask.h |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -324,8 +324,6 @@ static inline const struct cpumask *get_
 	[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD			\
 } }
 
-#define CPU_MASK_ALL_PTR	(&CPU_MASK_ALL)
-
 #else
 
 #define CPU_MASK_ALL							\
@@ -333,7 +331,6 @@ static inline const struct cpumask *get_
 
 /* cpu_mask_all is in init/main.c */
 extern cpumask_t cpu_mask_all;
-#define CPU_MASK_ALL_PTR	(&cpu_mask_all)
 
 #endif
 


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

* Re: linux-next: rr-latest-cpumask/sparc tree build failure
@ 2009-06-12 11:22   ` Rusty Russell
  0 siblings, 0 replies; 3+ messages in thread
From: Rusty Russell @ 2009-06-12 11:22 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: linux-next, linux-kernel, David S. Miller, sparclinux

On Fri, 12 Jun 2009 06:21:02 pm Stephen Rothwell wrote:
> Hi Rusty,
>
> Today's linux-next build (sparc64 defconfig) failed like this:
>
> arch/sparc/mm/init_64.c: In function 'paging_init':
> arch/sparc/mm/init_64.c:1802: error: 'CPU_MASK_ALL_PTR' undeclared (first

OK, Dave could you take/fold Stephen's fix then?

FYI here's the patch explaining why we're CPU_MASK_ALL_PTR -> cpu_all_mask:

Subject: cpumask: remove dangerous CPU_MASK_ALL_PTR

(Thanks to Al Viro for reminding me of this, via Ingo)

CPU_MASK_ALL is the (deprecated) "all bits set" cpumask, defined as so:

	#define CPU_MASK_ALL (cpumask_t) { { ... } }

Taking the address of such a temporary is questionable at best,
unfortunately 321a8e9d (cpumask: add CPU_MASK_ALL_PTR macro) added
CPU_MASK_ALL_PTR:

	#define CPU_MASK_ALL_PTR (&CPU_MASK_ALL)

Which formalizes this practice.  One day gcc could bite us over this
usage (though we seem to have gotten away with it so far).

Now all callers are removed, we kill it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Ingo Molnar <mingo@elte.hu>
Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mike Travis <travis@sgi.com>
---
 include/linux/cpumask.h |    3 ---
 1 file changed, 3 deletions(-)

diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -324,8 +324,6 @@ static inline const struct cpumask *get_
 	[BITS_TO_LONGS(NR_CPUS)-1] = CPU_MASK_LAST_WORD			\
 } }
 
-#define CPU_MASK_ALL_PTR	(&CPU_MASK_ALL)
-
 #else
 
 #define CPU_MASK_ALL							\
@@ -333,7 +331,6 @@ static inline const struct cpumask *get_
 
 /* cpu_mask_all is in init/main.c */
 extern cpumask_t cpu_mask_all;
-#define CPU_MASK_ALL_PTR	(&cpu_mask_all)
 
 #endif
 


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

end of thread, other threads:[~2009-06-12 11:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-12  8:51 linux-next: rr-latest-cpumask/sparc tree build failure Stephen Rothwell
2009-06-12 11:10 ` Rusty Russell
2009-06-12 11:22   ` Rusty Russell

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.