Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2554933pxb; Tue, 9 Mar 2021 05:40:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJyuF+QMEMWgqWWE2tw8BvUF32cRTGtIOkDxui/8jEiATLvK4jMNKKi7zhAN8Fg60AHx4JiT X-Received: by 2002:a05:6402:b41:: with SMTP id bx1mr4221555edb.69.1615297209388; Tue, 09 Mar 2021 05:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615297209; cv=none; d=google.com; s=arc-20160816; b=pJ0bwlx2BephF4Ca1hOKNp/E4vtP3z+P+8lDq3uhm1Vw3F2WFbVyVU7GZxlo53TmGK +bkZi1MbJdwh7RyHfR8Pz2Evvl6w1FrookzcATXsmhIU3HTZEUxaf7V6rdKj/koIj14x Y3PrYZZnmMXq1/+vS8NvessBhsPLZtHH37dhWauJZh3F0jAA3fagXQtTBKvafD5NcOSs 8FztlBOTcUxpbR0IXwK/dh2xIeWlPDAQXOsGpy4+3Buo6kKb9pb3/LnagE3AboSFAHXU ElM2O1zi8HWT6jdscgruTqOcCOzf9kSp721XRnPZIKWCCjH2B8CHD8C90I9Si8yUfG+x I+Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=iEj+0jxkZHHw5D2YohUtFNuJCE11yw0NoSlrr1inejc=; b=PCri1q0rNqe4ZtSKnVeNGuIWVzDaI0iqxRdSdlveXKtV15eoJMbiTD8TEt33NWVsJr yap9+3CQfMCdzixeRkNQTFkiGlQ5Vua+mMDGfbwDjeEP4c0IkGdbE8GxBmDh7qUd5eG4 lDujYwT6RjH/88Ew1aoylVeFQkujAWhA5R3ZiQ6b4PRxsVp39b5lFV52e2M1aw6tnxFe QLiKICHkGEB97z27ceuYz3H2uC+SLSgo8b8YO0MQuU6WZdbis8CXz1clup3wDuCyDi68 GSNXV2xF2MIMcFoFHFup1mpJU71GbIXA2Xuico2yIDrFtqpS6hZXcYd4ERg6Mg/DoiJq K6Lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g12si8958651ejd.256.2021.03.09.05.39.46; Tue, 09 Mar 2021 05:40:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230502AbhCINij (ORCPT + 99 others); Tue, 9 Mar 2021 08:38:39 -0500 Received: from smtp1.goneo.de ([85.220.129.30]:55954 "EHLO smtp1.goneo.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231175AbhCINiU (ORCPT ); Tue, 9 Mar 2021 08:38:20 -0500 X-Greylist: delayed 449 seconds by postgrey-1.27 at vger.kernel.org; Tue, 09 Mar 2021 08:38:19 EST Received: from [192.168.1.127] (dyndsl-085-016-044-246.ewe-ip-backbone.de [85.16.44.246]) by smtp1.goneo.de (Postfix) with ESMTPSA id 5F1452038178; Tue, 9 Mar 2021 14:30:48 +0100 (CET) Subject: Re: [RFC] scripts: kernel-doc: avoid warnings due to initial commented lines in file To: Aditya Srivastava , corbet@lwn.net Cc: lukas.bulwahn@gmail.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel-mentees@lists.linuxfoundation.org References: <20210309125324.4456-1-yashsri421@gmail.com> From: Markus Heiser Message-ID: <8959bf29-9ee1-6a1d-da18-f440232864f3@darmarit.de> Date: Tue, 9 Mar 2021 14:30:48 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210309125324.4456-1-yashsri421@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: de-DE Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 09.03.21 um 13:53 schrieb Aditya Srivastava: > Starting commented lines in a file mostly contains comments describing > license, copyright or general information about the file. > > E.g., in sound/pci/ctxfi/ctresource.c, initial comment lines describe > its copyright and other related file informations. The opening comment mark /** is used for kernel-doc comments [1] [1] https://www.kernel.org/doc/html/latest/doc-guide/kernel-doc.html#how-to-format-kernel-doc-comments -- Markus -- > > But as kernel-doc reads these lines, it results in ineffective warnings by > kernel-doc, related to these. > > Provide a simple fix by skipping first three lines in a file for checking > kernel-doc comments. > > Suggested-by: Lukas Bulwahn > Signed-off-by: Aditya Srivastava > --- > scripts/kernel-doc | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/scripts/kernel-doc b/scripts/kernel-doc > index e1e562b2e2e7..431add05248e 100755 > --- a/scripts/kernel-doc > +++ b/scripts/kernel-doc > @@ -2375,6 +2375,7 @@ sub process_file($) { > my $file; > my $initial_section_counter = $section_counter; > my ($orig_file) = @_; > + my $lineno = 0; # to maintain the count of line number in a file > > $file = map_filename($orig_file); > > @@ -2388,13 +2389,16 @@ sub process_file($) { > > $section_counter = 0; > while () { > + $lineno++; > while (s/\\\s*$//) { > $_ .= ; > + $lineno++; > } > # Replace tabs by spaces > while ($_ =~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; > # Hand this line to the appropriate state handler > - if ($state == STATE_NORMAL) { > + if ($state == STATE_NORMAL > + && $lineno > 3) { # to avoid starting comment lines describing the file > process_normal(); > } elsif ($state == STATE_NAME) { > process_name($file, $_); >