This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH v8 2/3] y2038: Provide conversion helpers for struct __timespec64
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Lukasz Majewski <lukma at denx dot de>
- Cc: Alistair Francis <alistair23 at gmail dot com>, Alistair Francis <alistair dot francis at wdc dot com>, Zack Weinberg <zackw at panix dot com>, Arnd Bergmann <arnd at arndb dot de>, GNU C Library <libc-alpha at sourceware dot org>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Carlos O'Donell <carlos at redhat dot com>, Stepan Golosunov <stepan at golosunov dot pp dot ru>
- Date: Thu, 19 Sep 2019 20:17:49 +0000
- Subject: Re: [PATCH v8 2/3] y2038: Provide conversion helpers for struct __timespec64
- Ironport-sdr: 6EZLO71bTA9IAOEjN8C4Y+QM7OLSzUGrTsx4sE6a3UXwH9BiRyg2/vTYqNwXTxQHqqrSP001bB 2qWE1BjCWR0NkpJ5Gvq9LdpFGZogpA6xUS/Qwp7ihymI9/fgvVnP3z3P2MCGL4vkXReP0e8bsA kAkuq1Xl/K/a65f10BuszXC1H5PN72jNYN+8M7Sm1QKlwgOwpwLo3En9L8PF0rh9nDfCMCuC3j s0wn2gy11y9P9zurAzhwKS9HG6OvoM8fHwtf2WJ++zSpuPCCPUWd4MZxPaXmgy7YxUX8qPaSay 7Q8=
- Ironport-sdr: +QXTIy3nRSWcMxVPpXVsEGud3d2+42OidR2F9ir/zK7P5EvkcGJDu1gXWy0UFSaH1FSMZz+e09 xDlQn2LI+QdPBqfvsf3mDrb8I4n2+o3Yzb4qIHt+ExljGrNSZmcpGdXiL1HFpkncSlCbkXdhHU tRCXI1IoZjUUmxAIowFBJM4uD2ed11IFSxy7ZTwuK7FWH2lqn9sWkUIzxFZEbKenuv8QRuQ1fF TBVdXTb+OMw6stPynnHkPtllHydvx+N8M4VWGluJuPvxd9ZvWNVeK3tYOt4X9Ex2J8qDMkxeEn odg=
- References: <20190918211603.8444-1-lukma@denx.de> <20190918211603.8444-3-lukma@denx.de>
On Wed, 18 Sep 2019, Lukasz Majewski wrote:
> +/* Convert a known valid struct __timespec64 into a struct timespec. */
It's not just "valid", it's valid *and within range of struct timespec*.
(That is, I think the comment needs to be expanded.)
> +/* Convert a known valid struct __timespec64 into a struct timeval. */
Likewise.
> +/* Check and convert a struct timespec into a struct __timespec64. */
> +static inline bool
> +timespec_to_timespec64 (const struct timespec *ts32,
> + struct __timespec64 *ts64)
The comment on the function needs to say what the return value means.
> +/* Check and convert a struct __timespec64 into a struct timespec. */
> +static inline bool
> +timespec64_to_timespec (const struct __timespec64 *ts64,
> + struct timespec *ts32)
Likewise.
> +/* Check and convert a struct __timespec64 into a struct timeval. */
> +static inline bool
> +timespec64_to_timeval (const struct __timespec64 *ts64,
> + struct timeval *tv32)
Likewise.
--
Joseph S. Myers
joseph@codesourcery.com