From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934954AbbEOWql (ORCPT ); Fri, 15 May 2015 18:46:41 -0400 Received: from www.linutronix.de ([62.245.132.108]:43476 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934194AbbEOWqh (ORCPT ); Fri, 15 May 2015 18:46:37 -0400 Date: Sat, 16 May 2015 00:46:44 +0200 (CEST) From: Thomas Gleixner To: Arnd Bergmann cc: y2038@lists.linaro.org, baolin.wang@linaro.org, albert.aribaud@3adev.fr, john.stultz@linaro.org, bamvor.zhangjian@linaro.org, ruchandani.tina@gmail.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH 13/19] y2038: add compat handling for sys_semtimedop In-Reply-To: <1430929826-318934-14-git-send-email-arnd@arndb.de> Message-ID: References: <1430929826-318934-1-git-send-email-arnd@arndb.de> <1430929826-318934-14-git-send-email-arnd@arndb.de> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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