Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1578400pxb; Thu, 4 Mar 2021 15:20:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDdTq/2FosSHRQHobRYK4cn8fLog3iu0A4V9bxcFnQrylMmp1UzBwTqisAjtDWQFAaiBvl X-Received: by 2002:a05:6402:1853:: with SMTP id v19mr6707489edy.179.1614900018373; Thu, 04 Mar 2021 15:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614900018; cv=none; d=google.com; s=arc-20160816; b=ajKLiDSROHAq7R39F1mmY0Gn1tOr/pdvWphBO4RozIIUSQ3QgIKj/WUg+mNU5Q0m/J EIIZXsIfVoDdbG8Uh1Zcw+a3q9rULe2dZo6oq50UUtTsdomAGyPKsz4Ey9RrZnNxPNba zUk0ExEI2b/Rf3kI9L07ArtB4BlEqQ1U950sw+MmGroe3rlZ+7tzX8wWG80ReoFhk89N w4StnbuhN86txl4wEfItFka+bOCijay1aPwBuDcm4LgY2DlQpqRuTClsvfAEXawlbuBd 7BjoF6q2EU/fTmyFDIcE7ibTOs2yaCX6BAr+uYvFTNkfPHiTlaaFWCN8pypHMA+5YskO 7vOw== 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=uPaOe2N4X+pi7of2cnaGDnaa5s64Ci51u8+P+0CojOs=; b=XMZd56LAD4N6w56t9hjPOxp5wDEnFaW7DoOZAkM8/hCZMAZgWSRnWRF5Tc/NceP7/k uzfKfdMV7uUagS1CzVHsHa4zqXqmXlAt2p7TiwfkujTHY1AjewgYPb7Se1BA8DmQYgV7 AvwdlA/r8iWXRYSH+PiwSStOwB2CjmHpzYEs1l7iFsdTfLPIdax+iryui96t65/Sy3UJ GbGY/O5t4OK2Pv+G4qgg1gNfhCpDlTp52DuZ+RPa8ZqtIoJpy/l2l5gPm2Mz9uNx8BB3 E2JtuG5idcJKx+vhxvj/bmySOW2ibHwKJ64X55Pip5Qt+JfpGrbZyZhGXvrcFpd4GXhF YZtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=piRHX4X9; 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 t14si338030ejr.191.2021.03.04.15.19.54; Thu, 04 Mar 2021 15:20:18 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=piRHX4X9; 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 S1444292AbhCCQuY (ORCPT + 99 others); Wed, 3 Mar 2021 11:50:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:47158 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350209AbhCCMWJ (ORCPT ); Wed, 3 Mar 2021 07:22:09 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 9A2A164DF2; Wed, 3 Mar 2021 08:42:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614760942; bh=FRgMk+OAmFAEpU9UR2Llp/Xzz5XikkDKRFOVhCQLfOM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=piRHX4X9mqP8OhBnzoEcWJnGVjmsF3VKwjWy/H6p/jP0BVsAXbbR+a8JrSQsB5OVe EYSHmrQtZ6KgHH4dbID61DeG9ubb1A1+O1urXd8g2oLusGHgpoDL+OyA/ZMs86WdIs wvZktXeijQSTqiKjim7b/fBIJDjHt5Qx3xoK7MdhFD8rYqG6KQQ8DqF8xazonPnHgQ +8WjH4TFmho3rfHZWvXyV5ieOnLoglKsXCJt4kwg+wleoXTF3Il7hLH8KNUdCdI+rQ +B2GY8XDkoiu0TYaeV9/N6AOKvDLIrpOdvxlh96FLs32atLdLs6HQTkHTTI+l/jCrt TBVQQTOJBv3vg== Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1lHN5I-000rIv-2x; Wed, 03 Mar 2021 09:42:20 +0100 From: Mauro Carvalho Chehab To: Jonathan Corbet , Linux Doc Mailing List Cc: Mauro Carvalho Chehab , "Andy Shevchenko" , linux-kernel@vger.kernel.org Subject: [PATCH] scripts/kernel-doc: ignore identifier on anonymous enums Date: Wed, 3 Mar 2021 09:42:14 +0100 Message-Id: <055ad57879f1b9381b90879e00f72fde1c3a5647.1614760910.git.mchehab+huawei@kernel.org> X-Mailer: git-send-email 2.29.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 When anonymous enums are used, the identifier is empty. While, IMO, it should be avoided the usage of such enums, adding support for it is not hard. So, postpone the check for empty identifiers to happen only at the dump phase. Signed-off-by: Mauro Carvalho Chehab --- scripts/kernel-doc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 68df17877384..f8ebbf5e9f12 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1412,9 +1412,14 @@ sub dump_enum($$) { if ($members) { if ($identifier ne $declaration_name) { - print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n"; + if ($identifier eq "") { + print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n"; + } else { + print STDERR "${file}:$.: warning: expecting prototype for enum $identifier. Prototype was for enum $declaration_name instead\n"; + } return; } + $declaration_name = "(anonymous)" if ($declaration_name eq ""); my %_members; @@ -2132,7 +2137,7 @@ sub process_name($$) { ++$warnings; } - if ($identifier eq "") { + if ($identifier eq "" && $decl_type ne "enum") { print STDERR "${file}:$.: warning: wrong kernel-doc identifier on line:\n"; print STDERR $_; ++$warnings; -- 2.29.2