From nobody Sun Feb 8 17:03:25 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7506724502E; Mon, 24 Feb 2025 09:09:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740388143; cv=none; b=boj20LlHZvgHgSLhZRQCJ7uuwH+Nu+w36IEGSR745cvIPQMZpq7/BkV2jMvnRbERXUg6MF3DHFfAPaTOEsrOBM3E/O5pwYpAe+mqMdhJFg4Djc8JPQWjZvfN6k4oSne5/2rvAxqQOV1MgpWa61mCog9LOGuTekJlC2aS8bYfdVw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740388143; c=relaxed/simple; bh=o+1xc6xKU/lADwcvw9syISNuAVlcBEcy5nbY0N3w4kc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aDYWv8L8+fFp2sQc3vd1JabBrSpwKQYBJejEfIFFRQZCSUB7eO+ZWOgN8PR2jrMr/McWXGNeshJ4tB7HSPfQYhGyKFqvjWe0Fm5C5xq9QiK9V5tpfviX8MchiTirQ/cL8ZHZwybigaU/mE1odkbzfD9m+dwF9Ntr6QkqbXoIscw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=d2r7O0oW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="d2r7O0oW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2923C4CEED; Mon, 24 Feb 2025 09:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1740388142; bh=o+1xc6xKU/lADwcvw9syISNuAVlcBEcy5nbY0N3w4kc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d2r7O0oWeInb6b4ufMZt2RTSkkEqMALf9aH9Gp9F3HbTf5JWVMLj2QkMY79pAQ6wV kB47vnkGkxz7YnHbnhsH7XWEjqsC3+lDdGkUjHBYfiII21hbDJb2HroiiSjO3JXI6i xYtl3V1pRllhgwOAlFPMtbrkTxo4Hn2dWP6AP6v9IaK4Gr7o7H8ljE8WtdL1RYzwXZ aKAwXDZl+7VmkPBV0a1tsLqbQSpq9QWisaKcOf077diMwVFW/ypk416GKsN3g8+HS8 F6y0yLOmm7YTbh3qO/hXLB6AG/TG0b7Ct5A3cgQxKNw3GW+Bs4LvB7ybgcaUSQCCfn BxPnG/6L3WbDQ== Received: from mchehab by mail.kernel.org with local (Exim 4.98) (envelope-from ) id 1tmUSS-00000003p3o-3zXF; Mon, 24 Feb 2025 10:09:00 +0100 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , "Mauro Carvalho Chehab" , linux-kernel@vger.kernel.org Subject: [PATCH v2 06/39] scripts/kernel-doc: drop dead code for Wcontents_before_sections Date: Mon, 24 Feb 2025 10:08:12 +0100 Message-ID: <174a15607fd057c736dc9123c53d0835ce20e68b.1740387599.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab Content-Type: text/plain; charset="utf-8" There is a warning about contents before sections, which doesn't work, since in_doc_sect variable is always true at the point it is checked. Drop the dead code. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d59552e1a31d..af6cf408b96d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -137,7 +137,6 @@ my $verbose =3D 0; my $Werror =3D 0; my $Wreturn =3D 0; my $Wshort_desc =3D 0; -my $Wcontents_before_sections =3D 0; my $output_mode =3D "rst"; my $output_preformatted =3D 0; my $no_doc_sections =3D 0; @@ -223,7 +222,6 @@ use constant { STATE_INLINE =3D> 7, # gathering doc outside main block }; my $state; -my $in_doc_sect; my $leading_space; =20 # Inline documentation state @@ -332,12 +330,9 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $Wreturn =3D 1; } elsif ($cmd eq "Wshort-desc" or $cmd eq "Wshort-description") { $Wshort_desc =3D 1; - } elsif ($cmd eq "Wcontents-before-sections") { - $Wcontents_before_sections =3D 1; } elsif ($cmd eq "Wall") { $Wreturn =3D 1; $Wshort_desc =3D 1; - $Wcontents_before_sections =3D 1; } elsif (($cmd eq "h") || ($cmd eq "help")) { pod2usage(-exitval =3D> 0, -verbose =3D> 2); } elsif ($cmd eq 'no-doc-sections') { @@ -1963,7 +1958,6 @@ sub process_export_file($) { sub process_normal() { if (/$doc_start/o) { $state =3D STATE_NAME; # next line is always the function n= ame - $in_doc_sect =3D 0; $declaration_start_line =3D $. + 1; } } @@ -2068,7 +2062,6 @@ sub process_body($$) { } =20 if (/$doc_sect/i) { # case insensitive for supported section names - $in_doc_sect =3D 1; $newsection =3D $1; $newcontents =3D $2; =20 @@ -2085,14 +2078,10 @@ sub process_body($$) { } =20 if (($contents ne "") && ($contents ne "\n")) { - if (!$in_doc_sect && $Wcontents_before_sections) { - emit_warning("${file}:$.", "contents before sections\n"); - } dump_section($file, $section, $contents); $section =3D $section_default; } =20 - $in_doc_sect =3D 1; $state =3D STATE_BODY; $contents =3D $newcontents; $new_start_line =3D $.; --=20 2.48.1