From nobody Mon Feb 9 20:35:01 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606901375; cv=none; d=zohomail.com; s=zohoarc; b=g8/GWWxDq/INaFBP7vTu1mbynYGZLgo0UFqcmbKkR0Rzf3qCPKljWpS1y9ADY+/EhSPxp5rlh2jhvjuHBX0ljy5ReXIUjqEXRLa/BB2mt1aLNLG8Thl55eLInd3Fg50dsAWkUlreyHPDCkGRkVaaPTLadBUXQplEp+c5RHE+onM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606901375; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aRud3jdLb9FJvuGehd6OGDqI+KIpo1xj4TsOlXShFvA=; b=XtS8X6Hz0qkx49LMgRgsi1o9YcdAdBCoCa6VHCPp0D38QKt9OJyqq/5T6ouNIG5rZUqPefuf1RWIHna174IOcVrMXh1xUFfXlzg7wutQLUNZP9oSkRpeSDypFS4hhqarXcog+KD2AWU7o9gzVvUAlfMgLSI6phPvUMkjPHjXYRw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606901375576562.1917336592196; Wed, 2 Dec 2020 01:29:35 -0800 (PST) Received: from localhost ([::1]:44288 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kkOS5-0001Pn-1c for importer@patchew.org; Wed, 02 Dec 2020 04:29:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40950) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kkNDP-000419-W3 for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54319) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kkNCe-0003rc-BV for qemu-devel@nongnu.org; Wed, 02 Dec 2020 03:10:19 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-356-1lynP_x0Mdy-Oi6Wgml5AA-1; Wed, 02 Dec 2020 03:09:28 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 98FCA5708A for ; Wed, 2 Dec 2020 08:09:27 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5DB4260854 for ; Wed, 2 Dec 2020 08:09:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606896571; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aRud3jdLb9FJvuGehd6OGDqI+KIpo1xj4TsOlXShFvA=; b=QxlTvWcv7L8IK8+U8quFJME/OaAEbValeHrjRyi68M3onvqxSfQ5TDtfpmnuuPXkQIXoVd gqNuf1N9bsvtekZ3b2IWLRkYR7nVq7x35JYRFdmE8FOSaAVQWMnuvzrmJ6kXsAA4QEPvf/ lF/ZkbRQa9euE40kqn00VRwJo75BUtk= X-MC-Unique: 1lynP_x0Mdy-Oi6Wgml5AA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 100/113] scripts: kernel-doc: fix troubles with line counts Date: Wed, 2 Dec 2020 03:08:36 -0500 Message-Id: <20201202080849.4125477-101-pbonzini@redhat.com> In-Reply-To: <20201202080849.4125477-1-pbonzini@redhat.com> References: <20201202080849.4125477-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.497, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There's currently a bug with the way kernel-doc script counts line numbers that can be seen with: $ ./scripts/kernel-doc -rst -enable-lineno include/linux/math64.h >all &&= ./scripts/kernel-doc -rst -internal -enable-lineno include/linux/math64.h = >int && diff -U0 int all --- int 2020-09-28 12:58:08.927486808 +0200 +++ all 2020-09-28 12:58:08.905486845 +0200 @@ -1 +1 @@ -#define LINENO 27 +#define LINENO 26 @@ -3 +3 @@ -#define LINENO 16 +#define LINENO 15 @@ -9 +9 @@ -#define LINENO 17 +#define LINENO 16 ... This is happening with perl version 5.30.3, but I'm not so sure if this is a perl bug, or if this is due to something else. In any case, fixing it is easy. Basically, when "-internal" parameter is used, the process_export_file() function opens the handle "IN". This makes the line number to be incremented, as the handler for the main open is also "IN". Fix the problem by using a different handler for the main open(). While here, add a missing close for it. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-19-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini --- scripts/kernel-doc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 75ddd3b5e6..f33a4b1cc7 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2268,7 +2268,7 @@ sub process_file($) { =20 $file =3D map_filename($orig_file); =20 - if (!open(IN,"<$file")) { + if (!open(IN_FILE,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; @@ -2277,9 +2277,9 @@ sub process_file($) { $. =3D 1; =20 $section_counter =3D 0; - while () { + while () { while (s/\\\s*$//) { - $_ .=3D ; + $_ .=3D ; } # Replace tabs by spaces while ($_ =3D~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; @@ -2311,6 +2311,7 @@ sub process_file($) { print STDERR "${file}:1: warning: no structured comments found\n"; } } + close IN_FILE; } =20 =20 --=20 2.26.2