Module: xenomai-forge
Branch: next
Commit: 978da9cd100befa2e09b63143c32234c94d5844e
URL:    
http://git.xenomai.org/?p=xenomai-forge.git;a=commit;h=978da9cd100befa2e09b63143c32234c94d5844e

Author: Philippe Gerum <r...@xenomai.org>
Date:   Thu Apr 24 14:51:24 2014 +0200

cobalt/bufd: drop obsolete sanity checks

With kernel-based Xenomai threads now underlaid by regular kernel task
contexts, those checks have become useless/redundant.

---

 kernel/cobalt/bufd.c |    8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/kernel/cobalt/bufd.c b/kernel/cobalt/bufd.c
index d05b238..cea140f 100644
--- a/kernel/cobalt/bufd.c
+++ b/kernel/cobalt/bufd.c
@@ -235,8 +235,6 @@ EXPORT_SYMBOL_GPL(xnbufd_map_kmem);
 
 void xnbufd_map_umem(struct xnbufd *bufd, void __user *ptr, size_t len)
 {
-       XENO_BUGON(NUCLEUS, !xnthread_test_state(xnsched_current_thread(),
-                                                XNROOT|XNUSER));
        bufd->b_ptr = ptr;
        bufd->b_len = len;
        bufd->b_mm = current->mm;
@@ -330,8 +328,7 @@ ssize_t xnbufd_copy_to_kmem(void *to, struct xnbufd *bufd, 
size_t len)
         * here, since the source buffer would live in kernel space in
         * such a case.
         */
-       if (xnthread_test_state(xnsched_current_thread(), XNROOT|XNUSER) &&
-           !xnsched_interrupt_p() && current->mm == bufd->b_mm) {
+       if (!xnsched_interrupt_p() && current->mm == bufd->b_mm) {
                preemptible_only();
                if (__xn_safe_copy_from_user(to, (void __user *)from, len))
                        return -EFAULT;
@@ -436,8 +433,7 @@ ssize_t xnbufd_copy_from_kmem(struct xnbufd *bufd, void 
*from, size_t len)
         * here: feeding a RT activity with data from a non-RT context
         * is wrong in the first place, so never mind.
         */
-       if (xnthread_test_state(xnsched_current_thread(), XNROOT|XNUSER) &&
-           !xnsched_interrupt_p() && current->mm == bufd->b_mm) {
+       if (!xnsched_interrupt_p() && current->mm == bufd->b_mm) {
                preemptible_only();
                if (__xn_safe_copy_to_user((void __user *)to, from, len))
                        return -EFAULT;


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

Reply via email to