lkml.org 
[lkml]   [2015]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 13/19] y2038: add compat handling for sys_semtimedop
Date
On Saturday 16 May 2015 00:46:44 Thomas Gleixner wrote:
> On Wed, 6 May 2015, Arnd Bergmann wrote:
> > +SYSCALL_DEFINE4(semtimedop, int, semid, struct sembuf __user *, tsops,
> > + unsigned, nsops,
> > + const struct __kernel_timespec __user *, timeout)
> > +{
> > + unsigned long jiffies_left = 0;
> > +
> > + if (timeout) {
> > + struct timespec64 _timeout;
> > + if (get_timespec64(&_timeout, timeout))
>
> Moo. I had to look 3 times to get not confused by the extra
> underscore. What's wrong with a proper variable name which is easy to
> distinguish?
>
> > + return -EFAULT;
>
> > + if (_timeout.tv_sec < 0 || _timeout.tv_nsec < 0 ||
> > + _timeout.tv_nsec >= 1000000000L)
> > + return -EINVAL;
>
> We have proper helper functions to validate time specs.

I tried to change the existing code as little as possible, but I agree
with your points here. I'll add a cleanup patch to fix the current code
before my own patches.

Arnd


\
 
 \ /
  Last update: 2015-05-16 10:21    [W:0.189 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site