Module: xenomai-3
Branch: next
Commit: 2ed10a4e4b0ee8da4290fcb84575a0d5adf55f4a
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=2ed10a4e4b0ee8da4290fcb84575a0d5adf55f4a

Author: Philippe Gerum <r...@xenomai.org>
Date:   Wed Sep  9 16:17:15 2015 +0200

drivers/can/raw: use proper mechanism for detection of forced unblock

---

 kernel/drivers/can/rtcan_internal.h |    5 -----
 kernel/drivers/can/rtcan_raw.c      |    8 ++++----
 2 files changed, 4 insertions(+), 9 deletions(-)

diff --git a/kernel/drivers/can/rtcan_internal.h 
b/kernel/drivers/can/rtcan_internal.h
index b731e71..b290005 100644
--- a/kernel/drivers/can/rtcan_internal.h
+++ b/kernel/drivers/can/rtcan_internal.h
@@ -29,11 +29,6 @@
 #include <linux/module.h>
 #include <rtdm/driver.h>
 
-#ifndef LIST_POISON1
-/* 2.4 - 2.6 compatibility stuff */
-#define LIST_POISON1  ((void *) 0x0)
-#endif
-
 #ifdef CONFIG_XENO_DRIVERS_CAN_DEBUG
 #define RTCAN_ASSERT(expr, func) \
     if (!(expr)) { \
diff --git a/kernel/drivers/can/rtcan_raw.c b/kernel/drivers/can/rtcan_raw.c
index 9eb8531..708d506 100644
--- a/kernel/drivers/can/rtcan_raw.c
+++ b/kernel/drivers/can/rtcan_raw.c
@@ -888,9 +888,9 @@ ssize_t rtcan_raw_sendmsg(struct rtdm_fd *fd,
 
     tx_wait.rt_task = rtdm_task_current();
 
-    /* If socket was not closed recently, register the task at the
-     * socket's TX wait queue and decrement the TX semaphore. This must be
-     * atomic. Finally, the task must be deregistered again (also atomic). */
+    /* Register the task at the socket's TX wait queue and decrement
+     * the TX semaphore. This must be atomic. Finally, the task must
+     * be deregistered again (also atomic). */
     cobalt_atomic_enter(s);
 
     list_add(&tx_wait.tx_wait_list, &sock->tx_wait_head);
@@ -900,7 +900,7 @@ ssize_t rtcan_raw_sendmsg(struct rtdm_fd *fd,
 
     /* Only dequeue task again if socket isn't being closed i.e. if
      * this task was not unblocked within the close() function. */
-    if (likely(tx_wait.tx_wait_list.next != LIST_POISON1))
+    if (likely(ret != -EIDRM))
        /* Dequeue this task from the TX wait queue */
        list_del(&tx_wait.tx_wait_list);
     else


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://xenomai.org/mailman/listinfo/xenomai-git

Reply via email to