summaryrefslogtreecommitdiffstats
path: root/sys/kern/p1003_1b.c
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2001-06-28 23:02:09 +0000
committerrwatson <rwatson@FreeBSD.org>2001-06-28 23:02:09 +0000
commit7c1e143aa8659680a2b7fde7a9f6ea37654beb3e (patch)
tree8f97c95e8e42b10293fd3b8d8a4cbd8f307ec2aa /sys/kern/p1003_1b.c
parentfc390727730fdda50e6ae75e5251f0d76eb76ad7 (diff)
downloadFreeBSD-src-7c1e143aa8659680a2b7fde7a9f6ea37654beb3e.zip
FreeBSD-src-7c1e143aa8659680a2b7fde7a9f6ea37654beb3e.tar.gz
Remove a fascinating but confusing construct involving chaining
conditional clauses in the following way: (0 || a || b); No functional change.
Diffstat (limited to 'sys/kern/p1003_1b.c')
-rw-r--r--sys/kern/p1003_1b.c64
1 files changed, 31 insertions, 33 deletions
diff --git a/sys/kern/p1003_1b.c b/sys/kern/p1003_1b.c
index 7ae378d..b0d8bc5 100644
--- a/sys/kern/p1003_1b.c
+++ b/sys/kern/p1003_1b.c
@@ -173,13 +173,12 @@ int sched_setparam(struct proc *p,
if (e)
return (e);
- (void) (0
- || (e = p31b_proc(p, uap->pid, &p))
- || (e = ksched_setparam(&p->p_retval[0], ksched, p,
- (const struct sched_param *)&sched_param))
- );
-
- return e;
+ e = p31b_proc(p, uap->pid, &p);
+ if (e)
+ return (e);
+ e = ksched_setparam(&p->p_retval[0], ksched, p,
+ (const struct sched_param *)&sched_param);
+ return (e);
}
int sched_getparam(struct proc *p,
@@ -188,15 +187,15 @@ int sched_getparam(struct proc *p,
int e;
struct sched_param sched_param;
- (void) (0
- || (e = p31b_proc(p, uap->pid, &p))
- || (e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param))
- );
-
- if (!e)
- copyout(&sched_param, uap->param, sizeof(sched_param));
+ e = p31b_proc(p, uap->pid, &p);
+ if (e)
+ return (e);
+ e = ksched_getparam(&p->p_retval[0], ksched, p, &sched_param);
+ if (e)
+ return (e);
- return e;
+ e = copyout(&sched_param, uap->param, sizeof(sched_param));
+ return (e);
}
int sched_setscheduler(struct proc *p,
struct sched_setscheduler_args *uap)
@@ -208,25 +207,25 @@ int sched_setscheduler(struct proc *p,
if (e)
return (e);
- (void) (0
- || (e = p31b_proc(p, uap->pid, &p))
- || (e = ksched_setscheduler(&p->p_retval[0],
- ksched, p, uap->policy,
- (const struct sched_param *)&sched_param))
- );
+ e = p31b_proc(p, uap->pid, &p);
+ if (e)
+ return (e);
+ e = ksched_setscheduler(&p->p_retval[0], ksched, p, uap->policy,
+ (const struct sched_param *)&sched_param);
- return e;
+ return (e);
}
int sched_getscheduler(struct proc *p,
struct sched_getscheduler_args *uap)
{
int e;
- (void) (0
- || (e = p31b_proc(p, uap->pid, &p))
- || (e = ksched_getscheduler(&p->p_retval[0], ksched, p))
- );
- return e;
+ e = p31b_proc(p, uap->pid, &p);
+ if (e)
+ return (e);
+ e = ksched_getscheduler(&p->p_retval[0], ksched, p);
+
+ return (e);
}
int sched_yield(struct proc *p,
struct sched_yield_args *uap)
@@ -250,13 +249,12 @@ int sched_rr_get_interval(struct proc *p,
{
int e;
- (void) (0
- || (e = p31b_proc(p, uap->pid, &p))
- || (e = ksched_rr_get_interval(&p->p_retval[0], ksched,
- p, uap->interval))
- );
+ e = p31b_proc(p, uap->pid, &p);
+ if (e)
+ return (e);
+ e = ksched_rr_get_interval(&p->p_retval[0], ksched, p, uap->interval);
- return e;
+ return (e);
}
#endif
OpenPOWER on IntegriCloud