From 48c79c95214764bef303766598d6d6a9991e67e2 Mon Sep 17 00:00:00 2001 From: tjr Date: Thu, 3 Jun 2004 10:22:47 +0000 Subject: [PATCH] Remove checks for curthread == NULL - it can't happen. --- sys/alpha/alpha/uio_machdep.c | 8 +++----- sys/amd64/amd64/uio_machdep.c | 8 +++----- sys/arm/arm/uio_machdep.c | 8 +++----- sys/i386/i386/uio_machdep.c | 8 +++----- sys/ia64/ia64/uio_machdep.c | 8 +++----- sys/kern/kern_subr.c | 8 +++----- sys/powerpc/aim/uio_machdep.c | 8 +++----- sys/powerpc/powerpc/uio_machdep.c | 8 +++----- sys/sparc64/sparc64/uio_machdep.c | 8 +++----- 9 files changed, 27 insertions(+), 45 deletions(-) diff --git a/sys/alpha/alpha/uio_machdep.c b/sys/alpha/alpha/uio_machdep.c index 656c5b6202d3..7116364f3db7 100644 --- a/sys/alpha/alpha/uio_machdep.c +++ b/sys/alpha/alpha/uio_machdep.c @@ -70,10 +70,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -117,7 +115,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/amd64/amd64/uio_machdep.c b/sys/amd64/amd64/uio_machdep.c index dfa11ab5364c..81c74924d90e 100644 --- a/sys/amd64/amd64/uio_machdep.c +++ b/sys/amd64/amd64/uio_machdep.c @@ -70,10 +70,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -116,7 +114,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/arm/arm/uio_machdep.c b/sys/arm/arm/uio_machdep.c index 2fe374f8c38b..764305bfff92 100644 --- a/sys/arm/arm/uio_machdep.c +++ b/sys/arm/arm/uio_machdep.c @@ -74,10 +74,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -120,7 +118,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/i386/i386/uio_machdep.c b/sys/i386/i386/uio_machdep.c index 5e32ad91b1a5..27408c3a2e84 100644 --- a/sys/i386/i386/uio_machdep.c +++ b/sys/i386/i386/uio_machdep.c @@ -70,10 +70,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -117,7 +115,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/ia64/ia64/uio_machdep.c b/sys/ia64/ia64/uio_machdep.c index b6241b9062ed..b6c530cd0857 100644 --- a/sys/ia64/ia64/uio_machdep.c +++ b/sys/ia64/ia64/uio_machdep.c @@ -70,10 +70,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -117,7 +115,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/kern/kern_subr.c b/sys/kern/kern_subr.c index 880b5ee0a831..d662f5e284db 100644 --- a/sys/kern/kern_subr.c +++ b/sys/kern/kern_subr.c @@ -139,10 +139,8 @@ uiomove(void *cp, int n, struct uio *uio) KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove proc")); - if (td) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; @@ -185,7 +183,7 @@ uiomove(void *cp, int n, struct uio *uio) n -= cnt; } out: - if (td && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/powerpc/aim/uio_machdep.c b/sys/powerpc/aim/uio_machdep.c index bd1663fc8859..473cb01719db 100644 --- a/sys/powerpc/aim/uio_machdep.c +++ b/sys/powerpc/aim/uio_machdep.c @@ -70,10 +70,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -116,7 +114,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/powerpc/powerpc/uio_machdep.c b/sys/powerpc/powerpc/uio_machdep.c index bd1663fc8859..473cb01719db 100644 --- a/sys/powerpc/powerpc/uio_machdep.c +++ b/sys/powerpc/powerpc/uio_machdep.c @@ -70,10 +70,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -116,7 +114,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); } diff --git a/sys/sparc64/sparc64/uio_machdep.c b/sys/sparc64/sparc64/uio_machdep.c index 8aef4fa960e4..c9e3b6c90149 100644 --- a/sys/sparc64/sparc64/uio_machdep.c +++ b/sys/sparc64/sparc64/uio_machdep.c @@ -76,10 +76,8 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) ("uiomove_fromphys: mode")); KASSERT(uio->uio_segflg != UIO_USERSPACE || uio->uio_td == curthread, ("uiomove_fromphys proc")); - if (td != NULL) { - save = td->td_pflags & TDP_DEADLKTREAT; - td->td_pflags |= TDP_DEADLKTREAT; - } + save = td->td_pflags & TDP_DEADLKTREAT; + td->td_pflags |= TDP_DEADLKTREAT; while (n > 0 && uio->uio_resid) { iov = uio->uio_iov; cnt = iov->iov_len; @@ -131,7 +129,7 @@ uiomove_fromphys(vm_page_t ma[], vm_offset_t offset, int n, struct uio *uio) n -= cnt; } out: - if (td != NULL && save == 0) + if (save == 0) td->td_pflags &= ~TDP_DEADLKTREAT; return (error); }