From patchwork Thu Mar 7 18:11:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 778512 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:47:b0:33e:474f:8c56 with SMTP id k7csp944466wrx; Thu, 7 Mar 2024 10:12:33 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUaL2uAkkgA45R5h7lRnnGrEWwwqpoUqy3jhYrT4gmGIhnh/IW6Vx5VDRvMceeLaOZtLWeCccsTrx55Ga1tyQUw X-Google-Smtp-Source: AGHT+IHvRO6O67IMw3F4KLdanjpzt042d/rWtV42OqrSlH2xwDnkZESDZE0DrRyYn38qx3I1udno X-Received: by 2002:a81:a183:0:b0:608:c73e:cbaa with SMTP id y125-20020a81a183000000b00608c73ecbaamr18228483ywg.6.1709835152793; Thu, 07 Mar 2024 10:12:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709835152; cv=none; d=google.com; s=arc-20160816; b=Xf1EMdN4fb6ZmsS4pf1027XmEijSoALe3do/9NjunaBuKPPgos/0/NzCZCUKtSiVC0 HV+GXnvxEUlZylIBG70JSWKW6UtZHSC0GtWK56GSOqeMnpedZ2jXphqNB8p48av9H/Oo jBe46aE2IyQiQQnxxvZ5tswb1LB+SLewORrgiOmFUyBaCRFzefjC2DtE25IUjUvFqNmL oSYV1e1rfkQKjiU8pjpz4s+DlGqRWwdo9uMfyc8buOyMLPKRFT1Tp0koiMqQiANS4Rhf aRolrdo0QyXS3PLMcJ8BmsHnm0agFACuQ82W7nqx7Fd6C41AM0ZQKcRvf2HwJvQOUK5X N4sA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=FP1Q7CJ3ufIn91uB7tqy2T7aeez+sSRO3vzBm+o+KRQ=; fh=58GrqNPmWxcKasqIC/eaOBnUs8d0lJZe3QlwbsxpY5w=; b=C+50DNlOeyja79LvnmBgGpfVd8T7iGdtdAaUzOK3qqSFlEt5U127/vTQfc1D9Mnz3R izmvzJCmDRAz8gvIlrxWNzE7NViQEULToC7F5T4IMN5WHInJs+/pUiyRwP2gkeuYZXeI ksN1iKr4YQbCKHx9uNbcvrViKT+1Xgv1eTZ/x2FHx0GMaahI4hd9lVCGK7dIy6jzk0le VHVIlxF7MdJPfl20oqmhUO8IeSSaAuk+FJRIGYFOmL1mz5btQ0TIHQNilrwiqOCmVhz0 1mMi5o7bjWyvS5mp53USavBDgCvXJ4KXt0eT4373ISmCG79P5ZELLWBzs/fQbyGjr9Lq vpkw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PF3E3R6+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id y7-20020a05612211a700b004c94c12bc7asi2684570vkn.100.2024.03.07.10.12.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2024 10:12:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PF3E3R6+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1riID3-0002SH-FI; Thu, 07 Mar 2024 13:11:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1riID1-0002RU-R6 for qemu-devel@nongnu.org; Thu, 07 Mar 2024 13:11:11 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1riICy-0004RI-PT for qemu-devel@nongnu.org; Thu, 07 Mar 2024 13:11:10 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-33e2774bdc7so926148f8f.0 for ; Thu, 07 Mar 2024 10:11:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709835066; x=1710439866; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FP1Q7CJ3ufIn91uB7tqy2T7aeez+sSRO3vzBm+o+KRQ=; b=PF3E3R6+j6VLY6Jl+W7pE1u4PqpvsI1BONH18gTe9NfNs1/DvDKobIA2E2i5kydQUI +NJAQcg8iNtvnAzaeoEijg5EFQiqebmEf/w1gr1ESOIrn4bb8K2rjn36eNqFFDUnBHYS owE9WMUwe7C6Evz6IE6oaCajU96qwD2IFpJmoS1VkcB/Cu0TlPhCSw2dQynpwkVZNnpg 8otjnl/o693NAE+fJK4lq1Z/Mh9igEvHRvQ14iIpsSSW/L2Fxzli3Wf9f14vxXgARN+w rqJ8cCnnIJQEK8fj1CIOUMZKM0X09xZi4rUPn30+4FKqocue6Wu0oAoB3V/mIeD4Lud9 j7jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709835066; x=1710439866; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FP1Q7CJ3ufIn91uB7tqy2T7aeez+sSRO3vzBm+o+KRQ=; b=ciTps+SD5xo876v5CDJoXG4LJX1WwDpHYRanBfKGbIe6NkoFNGe3WAszzrmMlGvHz9 XIEKlwB5pJ6g5EUc7vkp6rZI6S8JxgSPu8p3Gznd1a9GRq38N4H5xd/0lTyD4Ik1WTJ6 v1kR2W42moVCIpMgO4UiNQGF1cgfC2HLIukiBgGhB77qVjZoc+R39lTSJTw0q5yXfsAg 3lyu4WNqUwKFyiMzXtgphun+9MuCA+chtI8SMSp8OQSG49c77li5BSHbR6HImVuqh47w v18+IMG0J9UyEj5PYLA3W0uMnNEufmTfVnVavpp514IhrgPqGxobTJpEKMR0j5MaE1rF MHmw== X-Gm-Message-State: AOJu0YwKe1svzlksAb2H6A1LGlgLlRhS00zr6N+WOrd/rPCUTIujdVpy uSS7AgiQ+HQZ6jAA9dDNjGq9xzQHEVMOrr3ZGW1A/dDly9K8vkLi5781m3v8bOg= X-Received: by 2002:adf:f584:0:b0:33e:726d:e963 with SMTP id f4-20020adff584000000b0033e726de963mr656930wro.17.1709835066451; Thu, 07 Mar 2024 10:11:06 -0800 (PST) Received: from draig.lan ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id v9-20020adfedc9000000b0033e712b1d9bsm713243wro.77.2024.03.07.10.11.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 10:11:06 -0800 (PST) Received: from draig.lan (localhost [IPv6:::1]) by draig.lan (Postfix) with ESMTP id 8CBEB5F8E1; Thu, 7 Mar 2024 18:11:05 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Cc: Elena Ufimtseva , John G Johnson , Jagannathan Raman , Mahmoud Mandour , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= , Paolo Bonzini , Alexandre Iooss , Peter Xu , Manos Pitsidianakis , Markus Armbruster , Eduardo Habkost , Juan Quintela , Thomas Huth , Richard Henderson , peter.maydell@linaro.org, David Hildenbrand Subject: [PATCH 1/5] scripts/kernel-doc: teach kdoc about QLIST_ macros Date: Thu, 7 Mar 2024 18:11:01 +0000 Message-Id: <20240307181105.4081793-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240307181105.4081793-1-alex.bennee@linaro.org> References: <20240307181105.4081793-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x434.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org The kernel-doc script does some pre-processing on structure definitions before parsing for names. Teach it about QLIST and replace with simplified structures representing the base type. Signed-off-by: Alex Bennée --- scripts/kernel-doc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 240923d509a..26c47562e79 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1226,7 +1226,14 @@ sub dump_struct($$) { # replace DECLARE_KFIFO_PTR $members =~ s/DECLARE_KFIFO_PTR\s*\(([^,)]+),\s*([^,)]+)\)/$2 \*$1/gos; - my $declaration = $members; + # QEMU Specific Macros + + # replace QLIST_ENTRY with base type and variable name + $members =~ s/QLIST_ENTRY\(([^)]+)\)\s+([^;]+)/$1 \*$2/gos; + # replace QLIST_HEAD, optionally capturing an anonymous struct marker, and capture type and variable name + $members =~ s/QLIST_HEAD\(\s*,\s*([^)]+)\)\s+([^;]+)/struct { $1 *lh_first; } $2/gos; + + my $declaration = $members; # Split nested struct/union elements as newer ones while ($members =~ m/(struct|union)([^\{\};]+)\{([^\{\}]*)\}([^\{\}\;]*)\;/) {