Messages in this thread | | | Date | Wed, 7 Jan 2009 16:00:25 +0100 | From | Ingo Molnar <> | Subject | Re: [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
| |