From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753247AbeAEWsK (ORCPT + 1 other); Fri, 5 Jan 2018 17:48:10 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:41222 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752743AbeAEWsI (ORCPT ); Fri, 5 Jan 2018 17:48:08 -0500 X-Google-Smtp-Source: ACJfBovf5mh3kblU3FYSAIYJZ19F1fuzrvAXgFLexQJiWTXj/4MNPyZD0J2peMV5WP5XGaC41PLJ5g== Subject: Re: [V4, 01/11] Documentation: Add license-rules.rst to describe how to properly identify file licenses To: Alexandre Belloni , Thomas Gleixner Cc: LKML , Linus Torvalds , Andrew Morton , Jonathan Corbet , Kate Stewart , Philippe Ombredanne , Greg Kroah-Hartman , Christoph Hellwig , Russell King , Rob Herring , Jonas Oberg , Joe Perches , linux-xfs@vger.kernel.org, Charlemagne Lasse , Carmen Bianca Bakker References: <20180105130526.GA31648@piout.net> From: Frank Rowand Message-ID: <7769bd49-146b-ea8c-3b2c-b5987653a665@gmail.com> Date: Fri, 5 Jan 2018 14:48:04 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20180105130526.GA31648@piout.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On 01/05/18 05:05, Alexandre Belloni wrote: > Hi, > > I'm definitively late to the party but... > > On 17/11/2017 at 11:00:33 +0100, Thomas Gleixner wrote: >> +2. Style: >> + >> + The SPDX license identifier is added in form of a comment. The comment >> + style depends on the file type:: >> + >> + C source: // SPDX-License-Identifier: >> + C header: /* SPDX-License-Identifier: */ >> + ASM: /* SPDX-License-Identifier: */ >> + scripts: # SPDX-License-Identifier: >> + .rst: .. SPDX-License-Identifier: >> + .dts{i}: // SPDX-License-Identifier: > > dtc doesn't handle // comments. This works in the kernel tree because dtc does handle // comments. $ cat test_comment.dts /dts-v1/; // this is comment 1 /* this is comment 2 */ / { #address-cells = < 1 >; #size-cells = < 1 >; // this is comment 3 tree_1: soc@0 { reg = <0x0 0x0>; }; }; Using the dtc version in linux v4.14: $ dtc -v Version: DTC 1.4.4-g756ffc4f $ dtc -O dts test_comment.dts /dts-v1/; / { #address-cells = <0x1>; #size-cells = <0x1>; tree_1: soc@0 { reg = <0x0 0x0>; }; }; Using the latest dtc version in the git_dtc repo: $ dtc -v Version: DTC 1.4.6-ge5438801 $ dtc -O dts test_comment.dts /dts-v1/; / { #address-cells = <0x1>; #size-cells = <0x1>; tree_1: soc@0 { reg = <0x0 0x0>; }; }; -Frank > dts files are preprocessed by CPP. But this doesn't work when using dtc > directly (most likely when compiling DT overlays). So, the choice is > between making dtc handle // comments or changing the documentation. > > I don't have an opinion and Rob doesn't seem to care but I think we need > to do something now instead of letting each maintainer have to handle > this issue. > >> + If a specific tool cannot handle the standard comment style, then the >> + appropriate comment mechanism which the tool accepts shall be used. This >> + is the reason for having the "/\* \*/" style comment in C header >> + files. There was build breakage observed with generated .lds files where >> + 'ld' failed to parse the C++ comment. This has been fixed by now, but >> + there are still older assembler tools which cannot handle C++ style >> + comments. >> +