From patchwork Fri Nov 8 21:12:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 178974 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp3289333ilf; Fri, 8 Nov 2019 13:15:33 -0800 (PST) X-Google-Smtp-Source: APXvYqw96zzHm8yXoPCSFJMomkUExCDf5KUYnyRaPH6k+o0eLS2rMxzonB65Fw6Z0Jclz8/oCSq3 X-Received: by 2002:a50:f403:: with SMTP id r3mr8210644edm.275.1573247733015; Fri, 08 Nov 2019 13:15:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573247733; cv=none; d=google.com; s=arc-20160816; b=FgQVK9TUU9urPngtUcCu4fxcNxuLNxslNoJo8MskkB3nQXuw0S6aT0+MEf0rt0f4Ph G9LlKYg/pM4PTljgvHbl82duPOEGPxuhNgnXpbRFwb1Wz6vlKOq6sOUn+KoP1fWFz1vN HzIiXWgvex0Wr3TEgpp+AHOh71E+74IauLhFyjr8epddbMxN56WNNs5v7tpS1I18yy2D JlvoR9aiYa8coVroac4VkIbr2/DfrubsGbSN/x5Lw83ceKvWCUnk8UdXTg92yLVnMW0n WGrt7/UAbq3Lfn6ZfbL0XK6KJs+JN+jGtJvSyboRh4ZMpL5OgyBDg//1jU6IkiDSLjQ7 3/EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=tiep25j4BmxLrRocudG1TvmUh1G+D3OO7kQbcf388A0=; b=NztonzYtX6to5eAku8LUv6kpU/773U9Dmbg5iI/1gg4pW2htjpdfkEBAQ0FnZzfjMa SOT06sL4kkHN/wJ2786403kPz4koSp+qvQHPNrHHGzUCG2FBXukVxH/uNP0wnDt0ba49 V6yZDJBKP9fl0bNwaLAJDASdRXjZKBJfae9Od5eAgO1eWrtPDAfGmnDoKMfxU+zoIePd LPJbjPLrYvgIt8RCvuwdpgnIFHK0WU9RBLQRE0qayPFGmWFpUAZXcWsJfaifZUPPXHSU S9a/8YwGgkahjFWVzF7B7McNfAMvwexPdBkI0BVd43D/kMCiIdjqW5ogcYqlA4x8OcYO Q+ig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b27si5291428ede.48.2019.11.08.13.15.32; Fri, 08 Nov 2019 13:15:33 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732887AbfKHVPa (ORCPT + 26 others); Fri, 8 Nov 2019 16:15:30 -0500 Received: from mout.kundenserver.de ([217.72.192.75]:46059 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732425AbfKHVP3 (ORCPT ); Fri, 8 Nov 2019 16:15:29 -0500 Received: from threadripper.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.145]) with ESMTPA (Nemesis) id 1MWjUc-1iQvSV0sdk-00X7z7; Fri, 08 Nov 2019 22:15:15 +0100 From: Arnd Bergmann To: y2038@lists.linaro.org, "David S. Miller" Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Deepa Dinamani , Willem de Bruijn , Thomas Gleixner , netdev@vger.kernel.org Subject: [PATCH 13/23] y2038: socket: remove timespec reference in timestamping Date: Fri, 8 Nov 2019 22:12:12 +0100 Message-Id: <20191108211323.1806194-4-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20191108210236.1296047-1-arnd@arndb.de> References: <20191108210236.1296047-1-arnd@arndb.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:IYjzYvve4HwgUd3LWF3hcYp3XGsNmdTj+aFo75G76y0fsDG/owT ArX9Fi9VGH6tv0x2woDwVeV2R1dyaK92WLIrAqWENK5veUYsaDwJLWeK+JhypYxcISRcRJC cjsePdvza6eEmh7shkRvT11+XeE7Jl86ZUT3hXuYyPzgHwwInuDwicN5DrCsWFhJKtCuPjh Lj4cBfFfvsY9G33VIjgMg== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1; V03:K0:JlPu9h1gens=:OPJRztXUGTZz2MC1IDn4A0 suSnrJB6u9/B1GtIPFzBJHmgAdvL1Ct0kLw5rVLgbNe47vdnDYTiED7S0hvkBpgaiQzWUt9Ip ArswN/3rSOq7zFwVqlEVHIbP8d1BuiAHsyN8e5RindxJOiycaVSaS5Y1oi32Os/qbDSIkkuyK sjRLh0S4aQrFAqwpgD/7HZ31JUu+hXWwpuQmgYDFO+5Oq2fQTaiIDPJKbcnwBUfzbPIpEQGvO +FhnKSj8eztpH5p5pZ8YqN8n7PrVujwmZ/xWiV3ZVLFUaN5Z8H7RDPq8+KaXaCyWR1inurjel qfA9vXCz7LaCygipg5Mu6BQNgHEkyr2ykhEYce7S3bd0fQdlvRQsrWBf54nRfGnAfuv1QzPSn IQnplaQckYXxGOp7fAXNZHyND4yIGxQsOiBmKpShA4rbqt2xnUt4N6o9mp1eaQ6L6SrKcUCCZ 8cy5eeTJypxnGCop2Q7rR8oKvS3WGPBfiNifrh+hLaeYFQLAiuHeUQnAwUj2oKFkNyhZqswTk driyMfXxKWergCWqDajaV4fEwBIiay2ni+WsHR5BMPVxguf7j9YhQE3Qg2u5gSKWl2N/1JKYj r/VPkNJXvNAoqY2eDo04u4k9QjOW5nabavScLniw7jFoH9rtmDQ/XpyKX2CVmD4vSvux2fl2V PAQL+KTlL3Dqaa0gijc2BT2Aw1RHLMexVwKfAaHELJj5dH0p3V6hndkwLHoUjnRVQeEZIeuj8 DNrnzhYmF0hLP4xMa375H6hJeDfTtbeHQzNltykTUCMTaRo/aii/4J4tLhM7seeBDbGA8ag+p RPvMp7BA6rRrvkZRXDcmQkb6omOI8f/hRxqsxjnXZfzNB8LKJI5oRPfP/tyZKC6FccGPlUMll 1f4KMOnfZr+BcbtIkimw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In order to remove the 'struct timespec' definition and the timespec64_to_timespec() helper function, change over the in-kernel definition of 'struct scm_timestamping' to use the __kernel_old_timespec replacement and open-code the assignment. Signed-off-by: Arnd Bergmann --- include/uapi/linux/errqueue.h | 7 +++++++ net/core/scm.c | 6 ++++-- 2 files changed, 11 insertions(+), 2 deletions(-) -- 2.20.0 Acked-by: Deepa Dinamani diff --git a/include/uapi/linux/errqueue.h b/include/uapi/linux/errqueue.h index 28491dac074b..0cca19670fd2 100644 --- a/include/uapi/linux/errqueue.h +++ b/include/uapi/linux/errqueue.h @@ -37,9 +37,16 @@ struct sock_extended_err { * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_* * communicate network timestamps by passing this struct in a cmsg with * recvmsg(). See Documentation/networking/timestamping.txt for details. + * User space sees a timespec definition that matches either + * __kernel_timespec or __kernel_old_timespec, in the kernel we + * require two structure definitions to provide both. */ struct scm_timestamping { +#ifdef __KERNEL__ + struct __kernel_old_timespec ts[3]; +#else struct timespec ts[3]; +#endif }; struct scm_timestamping64 { diff --git a/net/core/scm.c b/net/core/scm.c index 31a38239c92f..dc6fed1f221c 100644 --- a/net/core/scm.c +++ b/net/core/scm.c @@ -268,8 +268,10 @@ void put_cmsg_scm_timestamping(struct msghdr *msg, struct scm_timestamping_inter struct scm_timestamping tss; int i; - for (i = 0; i < ARRAY_SIZE(tss.ts); i++) - tss.ts[i] = timespec64_to_timespec(tss_internal->ts[i]); + for (i = 0; i < ARRAY_SIZE(tss.ts); i++) { + tss.ts[i].tv_sec = tss_internal->ts[i].tv_sec; + tss.ts[i].tv_nsec = tss_internal->ts[i].tv_nsec; + } put_cmsg(msg, SOL_SOCKET, SO_TIMESTAMPING_OLD, sizeof(tss), &tss); }