Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4572482pxk; Wed, 30 Sep 2020 06:33:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwlx1NJL0gZYz8XNPYkitJfZcPShus006HAY5pfpNvJE7WemIkOiu3+G3kI7wHOHMGSQhRb X-Received: by 2002:a17:906:7f15:: with SMTP id d21mr2880401ejr.470.1601472802672; Wed, 30 Sep 2020 06:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601472802; cv=none; d=google.com; s=arc-20160816; b=02iuIHGPm+hqwr4B1eXK3BmGg/rsY6Khlo39kdPKn4zGcnxZ4jptHwmS9MAZb3FMSw B+tHOdNJIjhuLGeMl0ZANA+XdSK7dO36KZnb9MDhACdBJ90nmL51alXfNG77B4rcn4sZ zsFj4uKJiDR1p+mBKHrNhElHgnNqRBhCN2WXe58fP3w5C0xxub5gJHO4nIclGyQnNrv5 qOo2Z4YeVLrtDl1Mr0HFbxqzesc2kurmG5i+zBzzuARO2hIBWZvIeKVEs2HlQ8Fnfkk5 mcRc8HJD3umEpVSSweOTir9DKzRNWztb6EzHvApSEZuVLBYTJ4IfSWXO3EdJyNrRcN64 7Wuw== 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=wnM4iaijazcx5so0QBjXA/3ULgQjb10FDMTqg5llgPI=; b=GYbAsLpIeER/CGZyQa/22TqnhZM00zrjBz7owiOzIcQde6mJ7vrnsm6wPTbdA0gx1c IB6ThgX31ONpXOTiWDpLMAlxmIHntnTrzoVOrVl3wc23rDd+/9NQJVGxAjSWI8ssyFj9 +1cm/NhEiDnrb5oKduSEuDQZ9BuvE/gv0mvwkupvIVSpKLhvcs6tfLKZrap/gHzJSdbH sgBb+KCpi32UHBXDfsmfBwVIB9d4moBGOgqfPtZB7lEoQUBQ8+eu+Tki8NoJgDEq/cs4 J/daqXi0iKla122mVPSeAcl+ye6NOYkUekxSfX6QD/A2wWDsMgqSBXkZVfehQ7zK0epn X19A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R57g7AaM; 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 f17si1038219edq.587.2020.09.30.06.33.00; Wed, 30 Sep 2020 06:33:22 -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=R57g7AaM; 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 S1730304AbgI3N2w (ORCPT + 99 others); Wed, 30 Sep 2020 09:28:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:38572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728232AbgI3NZU (ORCPT ); Wed, 30 Sep 2020 09:25:20 -0400 Received: from mail.kernel.org (unknown [95.90.213.196]) (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 A311520759; Wed, 30 Sep 2020 13:25:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601472319; bh=pjtLSShGVJ4I7BmxpKk6Me+K3EVo/+mLjtcA7g+j7Yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=R57g7AaMmZxV6Fk3hYcYEse3OV9eItrHtNoG9aZ5fDR4iTcb9cErZBfCFuE4kVSZk lmnPuIWDtzpGvN4PcCqtf3exxIl7sIcfnDHJuWOnPQRqw4eh+Dp5/+GrD7LGCajG9R DnMIAxyvDMZLDUW9zYXOplQw9ooS2MQporC0zbdc= Received: from mchehab by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1kNc6f-001XJ8-Q2; Wed, 30 Sep 2020 15:25:17 +0200 From: Mauro Carvalho Chehab To: Linux Doc Mailing List , Jonathan Corbet Cc: Mauro Carvalho Chehab , linux-kernel@vger.kernel.org Subject: [PATCH v4 08/52] scripts: kernel-doc: fix typedef identification Date: Wed, 30 Sep 2020 15:24:31 +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 Some typedef expressions are output as normal functions. As we need to be clearer about the type with Sphinx 3.x, detect such cases. While here, fix a wrongly-indented block. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc | 62 ++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 22 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 6588a0d27fe4..a0344c78c641 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1741,30 +1741,48 @@ sub dump_function($$) { return; } - my $prms = join " ", @parameterlist; - check_sections($file, $declaration_name, "function", $sectcheck, $prms); + my $prms = join " ", @parameterlist; + check_sections($file, $declaration_name, "function", $sectcheck, $prms); - # This check emits a lot of warnings at the moment, because many - # functions don't have a 'Return' doc section. So until the number - # of warnings goes sufficiently down, the check is only performed in - # verbose mode. - # TODO: always perform the check. - if ($verbose && !$noret) { - check_return_section($file, $declaration_name, $return_type); - } + # This check emits a lot of warnings at the moment, because many + # functions don't have a 'Return' doc section. So until the number + # of warnings goes sufficiently down, the check is only performed in + # verbose mode. + # TODO: always perform the check. + if ($verbose && !$noret) { + check_return_section($file, $declaration_name, $return_type); + } - output_declaration($declaration_name, - 'function', - {'function' => $declaration_name, - 'module' => $modulename, - 'functiontype' => $return_type, - 'parameterlist' => \@parameterlist, - 'parameterdescs' => \%parameterdescs, - 'parametertypes' => \%parametertypes, - 'sectionlist' => \@sectionlist, - 'sections' => \%sections, - 'purpose' => $declaration_purpose - }); + # The function parser can be called with a typedef parameter. + # Handle it. + if ($return_type =~ /typedef/) { + output_declaration($declaration_name, + 'function', + {'function' => $declaration_name, + 'typedef' => 1, + 'module' => $modulename, + 'functiontype' => $return_type, + 'parameterlist' => \@parameterlist, + 'parameterdescs' => \%parameterdescs, + 'parametertypes' => \%parametertypes, + 'sectionlist' => \@sectionlist, + 'sections' => \%sections, + 'purpose' => $declaration_purpose + }); + } else { + output_declaration($declaration_name, + 'function', + {'function' => $declaration_name, + 'module' => $modulename, + 'functiontype' => $return_type, + 'parameterlist' => \@parameterlist, + 'parameterdescs' => \%parameterdescs, + 'parametertypes' => \%parametertypes, + 'sectionlist' => \@sectionlist, + 'sections' => \%sections, + 'purpose' => $declaration_purpose + }); + } } sub reset_state { -- 2.26.2