Re: [PATCH v2] kernel/itimer.c: beautify code, not need check 'value',so save one instruction, simpler and easier for readers.t
From: Thomas Gleixner
Date: Mon Jun 24 2013 - 19:28:39 EST
On Fri, 21 Jun 2013, Chen Gang wrote:
> >> > Also can let code simpler and easier for readers: if checking parameter
> >> > 'value', it will easily lead readers to think about why not return
> >> > -EINVAL instead of -EFAULT, when checking parameter failed.
> > So you are seriously claiming, that the check for !value makes people
> > think that the return value should be -EINVAL?
> >
> > That's hillarious.
> >
> That seems not a quite polite word, is it ? ;-)
My apologies for being so impolite. Let me rephrase it. Here is a
"sample" changelog for your patch:
Subject: itimers: Remove bogus NULL pointer check in sys_getitimer()
People might be tricked into assuming that the return value for a
failed NULL pointer check should be -EINVAL instead of -EFAULT.
Remove the misleading NULL pointer check to fix this nuisance.
Aside of that this patch fixes the problem of NOMMU kernels, where
a NULL pointer dereference is a valid operation. This allows to
boot NOMMU kernels without working around the shortcomings of the
getitimer() system call, which have been ignored since this NULL
pointer check was introduced in Linux 0.96a.
Please resubmit.
Thanks,
tglx
--
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/