All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: adeos-main@gna.org, xenomai@xenomai.org
Subject: [Xenomai-core] Re: [Adeos-main] [PATCH] let ipipe_catch_event return old handler
Date: Fri, 21 Apr 2006 17:47:47 +0200	[thread overview]
Message-ID: <4448FEA3.8010303@domain.hid> (raw)
In-Reply-To: <4448FC77.5000608@domain.hid>

Jan Kiszka wrote:
> Philippe Gerum wrote:
> 
>>Jan Kiszka wrote:
>>
>><snip>
>>
>>Don't you mean this instead?
>>
>>
>>>-int ipipe_catch_event(struct ipipe_domain *ipd,
>>>-              unsigned event,
>>>-              int (*handler)(unsigned event, struct ipipe_domain
>>>*ipd, void *data))
>>>+ipipe_event_handler_t ipipe_catch_event(struct ipipe_domain *ipd,
>>>+                    unsigned event,
>>>+                    ipipe_event_handler_t handler)
>>> {
>>
>>+       ipipe_event_handler_t old_handler;
>>
>>>     int self = 0;
>>> 
>>>@@ -278,7 +278,7 @@
>>>     }
>>> 
>>>     if (event >= IPIPE_NR_EVENTS)
>>>-        return -EINVAL;
>>>+        return NULL;
>>> 
>>
>>-      if (!xchg(&ipd->evhand[event],handler))    {
>>+      if (!(old_handler = xchg(&ipd->evhand[event],handler)))    {
>>
>>>         if (handler) {
>>>@@ -301,7 +301,7 @@
>>>             ipd->evself |= (1LL << event);
>>>     }
>>> 
>>>-    return 0;
>>>+    return handler;
>>
>>-    return handler;
>>+    return old_handler;
>>
>>> }
>>> 
>>> cpumask_t ipipe_set_irq_affinity (unsigned irq, cpumask_t cpumask)
>>>
>>>
> 
> 
> Ouch, obviously. A quick hack which was only tested for not breaking
> existing software.
> 

Ok, will merge. Thanks.

-- 

Philippe.


      reply	other threads:[~2006-04-21 15:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-21 14:38 [Adeos-main] [PATCH] let ipipe_catch_event return old handler Jan Kiszka
2006-04-21 15:12 ` [Xenomai-core] " Philippe Gerum
2006-04-21 15:38   ` Jan Kiszka
2006-04-21 15:47     ` Philippe Gerum [this message]

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=4448FEA3.8010303@domain.hid \
    --to=rpm@xenomai.org \
    --cc=adeos-main@gna.org \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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.