[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.11.1505160041370.4225@nanos>
Date: Sat, 16 May 2015 00:46:44 +0200 (CEST)
From: Thomas Gleixner <tglx@...utronix.de>
To: Arnd Bergmann <arnd@...db.de>
cc: y2038@...ts.linaro.org, baolin.wang@...aro.org,
albert.aribaud@...ev.fr, john.stultz@...aro.org,
bamvor.zhangjian@...aro.org, ruchandani.tina@...il.com,
linux-api@...r.kernel.org, linux-kernel@...r.kernel.org,
libc-alpha@...rceware.org
Subject: Re: [PATCH 13/19] y2038: add compat handling for sys_semtimedop
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.
Thanks,
tglx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists