Re: [2.6 patch] fix sched_setscheduler semantics

From: Alan Cox
Date: Mon Jan 16 2006 - 17:52:55 EST


On Maw, 2006-01-17 at 01:52 +0300, Alexey Dobriyan wrote:
> On Mon, Jan 16, 2006 at 05:17:55PM -0500, Jason Baron wrote:
> > --- linux-2.6/kernel/sched.c.bak
> > +++ linux-2.6/kernel/sched.c
> > @@ -3824,6 +3824,10 @@ do_sched_setscheduler(pid_t pid, int pol
> > asmlinkage long sys_sched_setscheduler(pid_t pid, int policy,
> > struct sched_param __user *param)
> > {
> > + /* negative values for policy are not valid */
> > + if (policy < 0)
> > + return -EINVAL;
>
> Classical redundant comment.

Disagree. A pointless comment would be "if policy is negative return
-EINVAL". The comment makes it clear that policy < 0 is *invalid* as a
syscall argument rather than just something not currently handled, or
being done for algorithmic reasons

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/