lkml.org 
[lkml]   [2009]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RESEND][RFC PATCH v2] waitfd

* Casey Dahlin <cdahlin@redhat.com> 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


\
 
 \ /
  Last update: 2009-01-07 16:03    [W:0.192 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site