mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* local_softirq_pending()
@ 2008-04-10  2:27 Andrew Morton
  2008-04-10  8:08 ` local_softirq_pending() Heiko Carstens
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2008-04-10  2:27 UTC (permalink / raw)
  To: Martin Schwidefsky, Heiko Carstens
  Cc: Thomas Gleixner, Ingo Molnar, linux-kernel

kernel/time/tick-sched.c: In function 'tick_nohz_stop_sched_tick':
kernel/time/tick-sched.c:229: warning: format '%02x' expects type 'unsigned int', but argument 2 has type '__u64'

I don't think the architecture's local_softirq_pending() should return u64.
This is the sort of thing which should be consistent across architectures.

Problem is, we've made such a complete mess of everything that this is a
bitch to fix.

The obvious and moderately clean fix is:

--- a/include/asm-s390/hardirq.h~a
+++ a/include/asm-s390/hardirq.h
@@ -25,10 +25,24 @@ typedef struct {
 	unsigned int __softirq_pending;
 } irq_cpustat_t;
 
-#define local_softirq_pending() (S390_lowcore.softirq_pending)
+static inline unsigned int local_softirq_pending(void)
+{
+	return S390_lowcore.softirq_pending;
+}
+
+static inline void set_softirq_pending(unsigned int val)
+{
+	S390_lowcore.softirq_pending = val;
+}
+
+static inline void or_softirq_pending(unsigned int val)
+{
+	S390_lowcore.softirq_pending |= val;
+}
 
 #define __ARCH_IRQ_STAT
 #define __ARCH_HAS_DO_SOFTIRQ
+#define __ARCH_SET_SOFTIRQ_PENDING
 
 #define HARDIRQ_BITS	8
 

But that doesn't work because sometimes this 'orrible crap from
linux/interrupt.h:

#ifndef __ARCH_SET_SOFTIRQ_PENDING
#define set_softirq_pending(x) (local_softirq_pending() = (x))
#define or_softirq_pending(x)  (local_softirq_pending() |= (x))
#endif

gets included first, which screws up include/asm-s390/hardirq.h.

So I'll cheerfully drop it into someone else's lap.  A sensible fix would
be to remove that nonsense from linux/interrupt.h (which appears to have
been added for x86) and give each architecture its own
local_softirq_pending(), set_softirq_pending() and or_softirq_pending(). 
Very much preferably for avoiding any ^+#define...


btw, there's a naming inconsistency here.  Shouldn't they be

local_softirq_pending
set_local_softirq_pending
or_local_softirq_pending

?


btw2, why do we need a per-arch or_softirq_pending()?  Can't that just be
built from set_softirq_pending() and local_softirq_pending() in generic code?


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

* Re: local_softirq_pending()
  2008-04-10  2:27 local_softirq_pending() Andrew Morton
@ 2008-04-10  8:08 ` Heiko Carstens
  0 siblings, 0 replies; 2+ messages in thread
From: Heiko Carstens @ 2008-04-10  8:08 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Martin Schwidefsky, Thomas Gleixner, Ingo Molnar, linux-kernel

On Wed, Apr 09, 2008 at 07:27:08PM -0700, Andrew Morton wrote:
> kernel/time/tick-sched.c: In function 'tick_nohz_stop_sched_tick':
> kernel/time/tick-sched.c:229: warning: format '%02x' expects type 'unsigned int', but argument 2 has type '__u64'
> 
> I don't think the architecture's local_softirq_pending() should return u64.
> This is the sort of thing which should be consistent across architectures.
> 
> Problem is, we've made such a complete mess of everything that this is a
> bitch to fix.
> 
> The obvious and moderately clean fix is:

I think I will just change the type of softirq_pending in s390's struct lowcore
from __u64 to __u32. That should be the least intrusive "fix" for this problem.

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

end of thread, other threads:[~2008-04-10  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-10  2:27 local_softirq_pending() Andrew Morton
2008-04-10  8:08 ` local_softirq_pending() Heiko Carstens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome