All of lore.kernel.org
 help / color / mirror / Atom feed
* [Adeos-main] [PATCH 3/5] avoid naming conflict around __ipipe_irq_handler
@ 2007-12-29 23:13 Jan Kiszka
  2007-12-30 10:46 ` Philippe Gerum
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2007-12-29 23:13 UTC (permalink / raw)
  To: adeos-main; +Cc: Philippe Gerum


[-- Attachment #1.1: Type: text/plain, Size: 293 bytes --]

There is already a definition of __ipipe_irq_handler. So, we either need
to more the real ipipe_irq_handler_t into ipipe_base.h, or rename this
local variant to __ipipe_irq_handler_t, or simple drop this refactoring.
This patch starts with applying the latter - the easiest one :->

Jan

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: avoid-naming-conflict.patch --]
[-- Type: text/x-patch; name="avoid-naming-conflict.patch", Size: 1028 bytes --]

---
 include/asm-x86/ipipe_32.h |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Index: linux-2.6.24-rc6-xeno/include/asm-x86/ipipe_32.h
===================================================================
--- linux-2.6.24-rc6-xeno.orig/include/asm-x86/ipipe_32.h
+++ linux-2.6.24-rc6-xeno/include/asm-x86/ipipe_32.h
@@ -125,11 +125,8 @@ static inline unsigned long __ipipe_ffnz
 
 DECLARE_PER_CPU(struct pt_regs, __ipipe_tick_regs);
 
-typedef void (__ipipe_irq_handler)(unsigned irq,
-				   void *cookie);
-
 static inline void __ipipe_call_root_xirq_handler(unsigned irq,
-						  __ipipe_irq_handler *handler)
+						  void (*handler)(unsigned, void *))
 {
 	struct pt_regs *regs = &__raw_get_cpu_var(__ipipe_tick_regs);
 
@@ -161,7 +158,7 @@ void irq_enter(void);
 void irq_exit(void);
 
 static inline void __ipipe_call_root_virq_handler(unsigned irq,
-						  __ipipe_irq_handler *handler,
+						  void (*handler)(unsigned, void *),
 						  void *cookie)
 {
 	irq_enter();

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 254 bytes --]

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

* Re: [Adeos-main] [PATCH 3/5] avoid naming conflict around __ipipe_irq_handler
  2007-12-29 23:13 [Adeos-main] [PATCH 3/5] avoid naming conflict around __ipipe_irq_handler Jan Kiszka
@ 2007-12-30 10:46 ` Philippe Gerum
  2007-12-30 17:15   ` Jan Kiszka
  0 siblings, 1 reply; 3+ messages in thread
From: Philippe Gerum @ 2007-12-30 10:46 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: adeos-main

Jan Kiszka wrote:
> There is already a definition of __ipipe_irq_handler. So, we either need
> to more the real ipipe_irq_handler_t into ipipe_base.h, or rename this
> local variant to __ipipe_irq_handler_t, or simple drop this refactoring.
> This patch starts with applying the latter - the easiest one :->
> 

There is no naming conflict, since they describe the same type with
different even if close names on purpose. __ipipe_irq_handler is only a
local short-hand to reduce visual pollution; as a matter of fact, the
assembly code itself depends on the handler prototype, despite it cannot
rely on any C-defined type, so the problem - if any - starts even before
this local definition, and if you happen to change ipipe_irq_handler_t,
then you could just not miss fixing __ipipe_irq_handler in the same move.

The only sane way to avoid defining this short-hand is indeed to move
ipipe_irq_handler_t to linux/ipipe_base.h.

-- 
Philippe.



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

* Re: [Adeos-main] [PATCH 3/5] avoid naming conflict around __ipipe_irq_handler
  2007-12-30 10:46 ` Philippe Gerum
@ 2007-12-30 17:15   ` Jan Kiszka
  0 siblings, 0 replies; 3+ messages in thread
From: Jan Kiszka @ 2007-12-30 17:15 UTC (permalink / raw)
  To: rpm; +Cc: adeos-main

[-- Attachment #1: Type: text/plain, Size: 1199 bytes --]

Philippe Gerum wrote:
> Jan Kiszka wrote:
>> There is already a definition of __ipipe_irq_handler. So, we either need
>> to more the real ipipe_irq_handler_t into ipipe_base.h, or rename this
>> local variant to __ipipe_irq_handler_t, or simple drop this refactoring.
>> This patch starts with applying the latter - the easiest one :->
>>
> 
> There is no naming conflict, since they describe the same type with
> different even if close names on purpose. __ipipe_irq_handler is only a

Sorry for remaining unclear: I was referring to the __ipipe_irq_handler
helper macro from linux/ipipe.h. They may happen to live happily side by
side, but it is far from being clean.

> local short-hand to reduce visual pollution; as a matter of fact, the
> assembly code itself depends on the handler prototype, despite it cannot
> rely on any C-defined type, so the problem - if any - starts even before
> this local definition, and if you happen to change ipipe_irq_handler_t,
> then you could just not miss fixing __ipipe_irq_handler in the same move.
> 
> The only sane way to avoid defining this short-hand is indeed to move
> ipipe_irq_handler_t to linux/ipipe_base.h.
> 

Jan


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

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

end of thread, other threads:[~2007-12-30 17:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-29 23:13 [Adeos-main] [PATCH 3/5] avoid naming conflict around __ipipe_irq_handler Jan Kiszka
2007-12-30 10:46 ` Philippe Gerum
2007-12-30 17:15   ` Jan Kiszka

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.