Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3050274ybx; Fri, 8 Nov 2019 13:16:54 -0800 (PST) X-Google-Smtp-Source: APXvYqzosk8uvXeox2pFYJJP3eW+UbaRiiTBN8wlbu+KcAqJHeScY9ngifkBHYckJ5MSgoxdWHjt X-Received: by 2002:a17:906:1ed7:: with SMTP id m23mr2560024ejj.326.1573247814421; Fri, 08 Nov 2019 13:16:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573247814; cv=none; d=google.com; s=arc-20160816; b=pvmczIZN2OshzZvNzarsiNObq9SqbZnm2i51/p928a8VTP8M9KegL6bcypcb+p19Sk pzZGcka32GbdaD7MP4jl8I4ubHTMAJv58TgqN4PwtaNj6h8sUsaBaT41Wn9zSsrSd6S0 PgBXzoC5CU4lM9eKWxOz9G9kX8pEzzeUHV41ic2DWsYjmlBUCW18x+R4ui03yI1ir1jT W7W1tNyjqkZccUgczvs0o6LAYUidjTJPMTBXlMg4ag1RL+ekt8ii/Ue2HCt6olx3Rc8b tLHJONJGcozyKWm6Smr4o4+bQPZDB/t8h9eNur+OILdZROHGs2Snfq7xeeyUI4VzCArp MZKg== 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 b10si4703323eda.160.2019.11.08.13.16.31; Fri, 08 Nov 2019 13:16:54 -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 S1732881AbfKHVP3 (ORCPT + 99 others); Fri, 8 Nov 2019 16:15:29 -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-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YmF0hLP4xMa375H6hJeDfTtbeHQzNltykTUCMTaRo/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(-) 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); } -- 2.20.0