Re: [RESEND][RFC PATCH v2] waitfd

From: Ingo Molnar
Date: Wed Jan 07 2009 - 10:00:46 EST



* Casey Dahlin <cdahlin@xxxxxxxxxx> wrote:

> >> +asmlinkage long sys_waitfd(int which, pid_t upid, int options, int unused)
> >> +{
> >> + int ufd;
> >> + struct waitfd_ctx *ctx;
> >> +
> >> + /* Just to make sure we don't end up with a sys_waitfd4 */
> >> + (void)unused;
> >
> > looks a bit silly ...
>
>
> Do you mean the principle of having an unused argument around for future
> use or the cast to void? The cast to void is there to suppress the
> "Waning: unused argument" messages and make gcc happy.

gcc will not warn about unused function arguments - only about unused
local variables. The 'unused' argument should either be removed
altogether, or replaced with a properly named parameter and a check
returning -ENOSYS if the argument is not zero (or something like that).

(It's generally better to keep such syscalls extensible via such trivial
means, if there's a remote chance for ever needing to extend that
syscall.)

Ingo
--
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/