Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4437623ybp; Mon, 7 Oct 2019 08:26:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwGi3UJCxxAQ2MsoZM9zeyYXjt7sDGd+EgBBYphEhdBhKC4Fkpv5Z2PrtWetWEZh1L1n4ME X-Received: by 2002:a17:906:6c8:: with SMTP id v8mr24878969ejb.252.1570462004095; Mon, 07 Oct 2019 08:26:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570462004; cv=none; d=google.com; s=arc-20160816; b=Qx5OK7WezBUO7GihH8lE1uUvmFund+7YEdFHPkgXqm3DAe2Lb6thOQjt3D3+oB7PCE +Zqb/MSW6jMiVGjOd+ft0TCDLPyix69xxbh762cNK/FGk1O6X12LGpRh41uiGIfqgpJ+ HEhteP2fxhYdLEmZW9XMOLpEKkCGfd8RQkLKAYjtUKjWiV9D5fijMjbF6iz6uBudk6NS yDi5eTsv7zCDh9m3I57sal6BSpX+kpjcuHnODWnr42RMPcu2Gx3HWDh/43bzpRt0AG/J JjKwCzBeNui36msp5smkfvuCwtmMzaVIb7wvGuICtKHvvj1US8dgToMiJfJ5tO9vH6Bc aX4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=hRmOGZNk0NYT+fMDvkYsRiFnwMnhVC+gnIUxAp3rxvA=; b=zVXfe+RzGQYfISPSYGlCgxBD9P7jB3RNCotPVmOXApw/7kQM5/W+nrL6vn2zv/svqd l6NjSVz2CXptZwRiXWaAeZJG1fp6el10w4ip3JijwNlYPL6nqFLaC1cSr8kB58yyeDzG x6PYgiiQs4fld02Eb+1WhC7DZ0t/GRiHo1+hvjAerk3z2y52H3dWsc2LW5aYwXe1mWCE lTyjHb5XhMWM6gMnFPAQRlV3aujmAvr46Kl/+Ypazy6uikioMhYyTLVgdBvAl1G9hhEm ncqDmHA4drZ5NVknyS+FM4bqmp4qv1gRikXONBJcm1ZrxjRbJ+j8kYM8dU4fckgcxtKp oFOg== 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 h10si7198787ejf.371.2019.10.07.08.26.20; Mon, 07 Oct 2019 08:26:44 -0700 (PDT) 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 S1728059AbfJGP0J (ORCPT + 99 others); Mon, 7 Oct 2019 11:26:09 -0400 Received: from mail-qk1-f195.google.com ([209.85.222.195]:39737 "EHLO mail-qk1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727589AbfJGP0I (ORCPT ); Mon, 7 Oct 2019 11:26:08 -0400 Received: by mail-qk1-f195.google.com with SMTP id 4so12955364qki.6; Mon, 07 Oct 2019 08:26:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=hRmOGZNk0NYT+fMDvkYsRiFnwMnhVC+gnIUxAp3rxvA=; b=cEa/slRgbL1KiavJbV3A2W5023VI3OILGpSU7kVa2yCrB+n9XKv4hBVTvZb4t2qfn9 nUZukODprRWZiJe8L5Shkd/LVcvf8tfKG3y7sKbQOgr9eKJoRSx+yX2Snf1Cejx9ionu 7Vxgp3ZEZ6nHMupqlIZBMXmZpBjN1f+Tzqc+kJrcftVmbdeHYh2l5d0/e5ACSQxCZbRK ry2ydqN0E/v5d+HhBG3xUXWkTxYYfDRd+0xAQApm31Ue4TWgSMkWPVTl9BepxxX4YbDV E3qPufOqyWd4Mc3cPerOTcar7M9Ohth0Xjow7vFKBf4FcNctd91lS53+KHanXpKh/Hjh Cu8A== X-Gm-Message-State: APjAAAUf2UAHwmkI6l5jtiai4Ne56GRRtxRFnheN14hiXRxX1hBw0BBp 1MAqOwdlPmABcSv/B5JUXUEogs2YnuLnBufoTS8= X-Received: by 2002:ae9:c110:: with SMTP id z16mr24108618qki.352.1570461967381; Mon, 07 Oct 2019 08:26:07 -0700 (PDT) MIME-Version: 1.0 References: <20191007040935.23436-1-yamada.masahiro@socionext.com> In-Reply-To: <20191007040935.23436-1-yamada.masahiro@socionext.com> From: Arnd Bergmann Date: Mon, 7 Oct 2019 17:25:51 +0200 Message-ID: Subject: Re: [RFC PATCH] media: videodev2.h: include instead of To: Masahiro Yamada Cc: Mauro Carvalho Chehab , Linux Media Mailing List , Heiko Carstens , Pablo Neira Ayuso , Sam Ravnborg , "linux-kernel@vger.kernel.org" , Hans Verkuil Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 7, 2019 at 6:10 AM Masahiro Yamada wrote: > > Currently, linux/videodev.h is excluded from the UAPI header test since > it is not self-contained. Building it for user-space would fail. > > > Replacing with solves it, and allow more > headers to join the UAPI header test. > > Signed-off-by: Masahiro Yamada > --- > > I am not 100% sure about the compatibility > between and , hence RFC. > > But, if they were not compatible, > I guess it would have broken already. > > I CCed Arnd Bergmann, who might have a better insight. > > A related comment is here: > https://lkml.org/lkml/2019/6/4/1046 I don't think this can work, there are multiple problems here: * linux/time.h is still incompatible with sys/time.h, so any application tries to include both sys/time.h and linux/videodev2.h now also gets the compile-time error. * The definition of 'struct timespec' in the kernel headers may in fact be different from the one in the libc, and we do want to use the one from the C library here, otherwise different parts of the application may use incompatible struct layouts. Fixing this correctly depends on one of the remaining y2038 patches that we still have to revisit. There are two aspects that we should address: 1. The v4l subsystem needs to be changed to handle both the old and the new 32-bit layout for timespec (and timeval). Both Hans and I have created patches for this in the past, but they were never completed and merged. 2. The definition of 'struct timespec' in the kernel headers needs to be removed after every user of this struct is gone from the kernel. In internal kernel code, the replacement is timespec64 or ktime_t, and in user space interfaces, the correct replacement is one of __kernel_timespec (the 64-bit version), __kernel_old_timespec (the traditional layout) or timespec (from the libc headers). Arnd