Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1049863pxk; Thu, 1 Oct 2020 22:52:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUwSvibML5iwBt0/8KLSL/A0wE5I+5O3nqCr5gNSfz9uOXGPao1Zd1rPPYbVt/LUu43VAS X-Received: by 2002:a05:6402:17fc:: with SMTP id t28mr568711edy.244.1601617967125; Thu, 01 Oct 2020 22:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601617967; cv=none; d=google.com; s=arc-20160816; b=qZQ1l7aulZsTGup0TJ5WJLOYIFul6nrGD4/fMjf99SW78gqQ0RUKwUH4wk2F9LqygW 3b97P6J3JBpZk2fDKDlSbNRZ9CxROaDTrJy6gvS03FtElNjEWXc3wVI7dkNl2/Pr/1pF YtbikI1wSPdpuErVXa45eclDbWF17+YgBdTo/EmK0nDaQtcgbBKoDwTrxo290NA308z9 L+aHRaOXyXx3xmqdcmh14wWBxELZ1kIWpQo/voIbCfNZLZDQDFSn+QbFnHlK1x7EBJWv i40AsKKuA0grwhXTNWPPcA00g4TruZvejfOAkVV+2nr8bR3n4xgVB60q7+uVcHzyoqc3 Jnhg== 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:date:subject:cc:to:from :dkim-signature; bh=5uvTmZrcn7g9P3v2ILhi/KNFbLgQXVOe0AfILd85lmE=; b=bC31HzYNDWx4b+/53K1mOW77hGJXzRcB2LkcO4LAS0o8N7tKXfMW3dZ3rf7u0XPAHU tM243DBwdurusw1BIVifT5L0g4NyWTeGxvuMPKsnkQPqd5nys8EF1kkB3FzAJwq+mHGe uE3iHqKwKtvIhfbkQQ1ZBe1c6xPSpU8t9f2YqaOnGRygtdk/bt4r7L3N3/3AE4w0J9FB sgnJT5GAOJQLFg4olvJRtCo9UTQa5dFz9DgYs2WyCT5ISkXlWsq+mjUdkzmGklnqLP4U Tidiob9M3wP+u9FPxGtnmWQOHs9l8g+55CbOufRGJEjDCtKISaQu+iCklFFgdl+sRY4H S2vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="LO/yhVjp"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w20si369935ejz.72.2020.10.01.22.52.24; Thu, 01 Oct 2020 22:52:47 -0700 (PDT) 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; dkim=pass header.i=@kernel.org header.s=default header.b="LO/yhVjp"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726223AbgJBFuW (ORCPT + 99 others); Fri, 2 Oct 2020 01:50:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:59758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbgJBFt7 (ORCPT ); Fri, 2 Oct 2020 01:49:59 -0400 Received: from mail.kernel.org (ip5f5ad59f.dynamic.kabel-deutschland.de [95.90.213.159]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 75CED20796; Fri, 2 Oct 2020 05:49:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601617798; bh=sTwGnquoE6P2N3xCIRO9CZ2Os6A80mTdNqw5RZU1SyA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LO/yhVjpcKKYyooCaLTv+Auj+IRmFi1qXp6f+Nlpzm4Dl0nWPYW5Qw0Rk/AFH0e0u JAdr2UncxBX6V0kfPK5Br6yHvCdLGxK7bHA+/Dw/GONDcggVRXpK8G+vZf+Bf11lOr fum2cdAd3wNLjAcbamr47ooKDjH2QZVemXVPmApA= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kODx6-006hit-By; Fri, 02 Oct 2020 07:49:56 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "David S. Miller" , "Jonathan Corbet" , Andrew Lunn , linux-kernel@vger.kernel.org Subject: [PATCH 5/6] scripts: kernel-doc: add support for typedef enum Date: Fri, 2 Oct 2020 07:49:49 +0200 Message-Id: X-Mailer: git-send-email 2.26.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: Mauro Carvalho Chehab Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The PHY kernel-doc markup has gained support for documenting a typedef enum. However, right now the parser was not prepared for it. So, add support for parsing it. Fixes: 4069a572d423 ("net: phy: Document core PHY structures") Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d94e28fcead0..5ac3749905e5 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1339,14 +1339,22 @@ sub show_warnings($$) { sub dump_enum($$) { my $x = shift; my $file = shift; + my $members; + $x =~ s@/\*.*?\*/@@gos; # strip comments. # strip #define macros inside enums $x =~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; - if ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) { + if ($x =~ /typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;/) { + $declaration_name = $2; + $members = $1; + } elsif ($x =~ /enum\s+(\w*)\s*\{(.*)\}/) { $declaration_name = $1; - my $members = $2; + $members = $2; + } + + if ($declaration_name) { my %_members; $members =~ s/\s+$//; @@ -1381,8 +1389,7 @@ sub dump_enum($$) { 'sections' => \%sections, 'purpose' => $declaration_purpose }); - } - else { + } else { print STDERR "${file}:$.: error: Cannot parse enum!\n"; ++$errors; } -- 2.26.2