Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp6582113ybi; Wed, 5 Jun 2019 03:16:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqx9C6mUwePHIfxzLTNWs96ySrLyy2vQGAXPvlX7zFuTKfv6fWEqR7t9trA91nHCMQfIXw/O X-Received: by 2002:a17:90a:d3d7:: with SMTP id d23mr40918393pjw.26.1559729769397; Wed, 05 Jun 2019 03:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559729769; cv=none; d=google.com; s=arc-20160816; b=X8DHT5OygKc4arjUmgkrYvIL2vzU8y1CqZtEexgpcYULZoPoCmHlN07CzyyMGhH+KJ GLPjuXnvrJSH3F50RiqxOTyE3ZzqtZMVaG/merHLjsFRZ50xEm/YLns4VN6hDaQzXRTP PB6IrV0RSOQfJE/eEq+9yoyqsfVKn+soqbz0+43CgNaODuFAR4cvCoPS2BMKwh869Ofd Hc4Q1fO1Yv1I5XxRWuXMsE6us6tFDfGZrSwNtUsR+z4D6B3arBsJ4wqlJzeGCMPQ/gLy zGoG4UGxZDjrK0Fb9BUsMOFZSfb1rnm3igR4Oynmk6iv79dijSbZFAA5X6WNJIPid+Lz 0ByQ== 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:subject:cc:to:from:date :dkim-signature; bh=m0sIXLFzSAfIrEXaXFue9blbUsqtX9lLblTE1dAG10k=; b=t2k5QJYt1ir8nWX/X8Et9zWikOXhMcAnFrnj2HABFhzoyEyEjqcRlnIJ61CKlLu2BQ 2+Ix2mQxOhLgefj/dMJVuzCbqfwrkL1FNrJRw2FBb8hbvAwLBeTe/gRKd/TG9TnN5sYC Zrzo/DLxLpH5P43VlI4d84DLT4EXLuUnv4bIdv9cIjf+GMtPwcZDqdEWGoVrVdjtrnPG bYJ/jbaN6SNGJCF4LiYltIqSmQ1/ZICGBn/9knh30AQwtukHUyBFhvbRmZvAkY7nmt/u ee0KdBV2xAaPwZZ3pIfkhEiI6yUcQ9D73Z3lLQHtyheIR7dKiITQ1xmt6iGRIkBqgNGj QOVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=C4OhBAaL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s24si24935966pga.515.2019.06.05.03.15.51; Wed, 05 Jun 2019 03:16:09 -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; dkim=fail header.i=@infradead.org header.s=casper.20170209 header.b=C4OhBAaL; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727192AbfFEKOZ (ORCPT + 99 others); Wed, 5 Jun 2019 06:14:25 -0400 Received: from casper.infradead.org ([85.118.1.10]:43670 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbfFEKOZ (ORCPT ); Wed, 5 Jun 2019 06:14:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:Content-Type: MIME-Version:References:In-Reply-To:Message-ID:Subject:Cc:To:From:Date:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=m0sIXLFzSAfIrEXaXFue9blbUsqtX9lLblTE1dAG10k=; b=C4OhBAaLDWrRiLxo4cZx9Sz+lr c5XBP6tmeYcyBwSgOU0y//iH5IBy40CYjNcoNJ08jMz0sgg1ujjQjkrbdywwwBrwNAe5Vw80XjdWE Q7sbK7CQVQ64wrlbk2N0b6bxKTkfDUWZC+j13o5Ub8apmU7xQDTXRwiRarsjFnG0WxM5rMqlVMDSC l6r33NC2X0lAp7TCg0ebmB4FUKMRrTKkMqEYHroD8LXsdzg6CdiVQ+u2p+2NzZ0JBHLOwnueSsexu UHnZubC4750nf8zCCDFd+ot7HNH2Xl7uMuQe+Yb5KrrnbfSGMJaiWmKDenh4HRuG79/ohFtcn9x/e OtMZNOBQ==; Received: from [179.182.172.34] (helo=coco.lan) by casper.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1hYSvz-0001tS-17; Wed, 05 Jun 2019 10:14:19 +0000 Date: Wed, 5 Jun 2019 07:14:13 -0300 From: Mauro Carvalho Chehab To: Joe Perches Cc: Greg KH , Masahiro Yamada , Arnd Bergmann , Linux Media Mailing List , Thomas Gleixner , Randy Dunlap , Linux Kernel Mailing List Subject: Re: [PATCH] media: do not use C++ style comments in uapi headers Message-ID: <20190605071413.779bd821@coco.lan> In-Reply-To: References: <20190604111334.22182-1-yamada.masahiro@socionext.com> <8cf48e20064eabdfe150795365e6ca6f36032e9f.camel@perches.com> <20190604134213.GA26263@kroah.com> <20190605051040.GA22760@kroah.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, 04 Jun 2019 22:22:05 -0700 Joe Perches escreveu: > On Wed, 2019-06-05 at 07:10 +0200, Greg KH wrote: > > On Wed, Jun 05, 2019 at 01:10:41PM +0900, Masahiro Yamada wrote: > > > On Wed, Jun 5, 2019 at 3:21 AM Arnd Bergmann wrote: > [] > > > This means we cannot reliably use uint{8,16,32,64}_t in UAPI headers. > > > > We should not be doing that as they are in the userspace "namespace" of > > variables, not in the kernel namespace. We've been over this many times > > in the past :( > > Just not very successfully... > > $ git grep -w -P 'u?_?int(?:8|16|32|64)_t' include/uapi | wc -l > 342 > $ git grep -w -P --name-only 'u?_?int(?:8|16|32|64)_t' include/uapi | wc -l > 13 Out of curiosity, I decided to check those occurrences... About half of those 13 files are false-positives: - bpf.h, pps.h and amdgpu_drm.h use those int types only inside comments; - drm.h and coda.h have their own typedefs for those int types; - vmwgfx_drm.h includes drm.h (which has the typedefs). So, only 6 headers actually use posix types in a way that it seems that it would require including stdint.h: - include/uapi/linux/fuse.h This one explicitly includes stdint.h if !__KERNEL__ - include/uapi/linux/netfilter_bridge/ebtables.h, include/uapi/linux/sctp.h, include/uapi/scsi/scsi_netlink.h and include/uapi/scsi/scsi_netlink_fc.h They include linux/types.h unconditionally, relying on scripts/headers_install.sh to remove it; - include/uapi/scsi/scsi_bsg_fc.h It doesn't include anything. In other words, it assumes that the c file would include either linux/types.h or stdint.h. --- Not saying that this is a good idea, but, as we have already a script that it is meant to sanitize uAPI header files when installing them (scripts/headers_install.sh), one could modify it (or convert to perl/python) in a way that it would be doing something like[1]: sed -E ... -e 's,//(.*),/* \1 */,' [1] the actual rule should be more complex than that, in order to avoid replacing // inside /**/ comments. Thanks, Mauro