From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819063; cv=none; d=zohomail.com; s=zohoarc; b=g6sKgA94Y2tz5TypTTmkwsrg6vT8g7mLa2gRrv234fD43Y4o4h9S28UMce/AXQJ+KlOnenzFIOwIxwCS/tKoDvqixe4Y2suRVIaz+Wh1gCZuIaeJcCI5MA/dIS/buekCgSmruPSpTMShMmuxwhFsOlSBRx5EJn6FmRokPIDeqaU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819063; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ORkokebyZd7uYE6EL+PNhLAzVgs7mxSX6u3wc+B7flk=; b=S7vCxUZ/GmnPhIHeHUZQAkznDonAs65DxHNNCd6cP2qXJ3+5ucxR2JB9Jq9imofOKb42UDrQIb9hPZd9M5H81GKKGr7xAmgMmVYx4pcqBpY9zQ5yVhZUxp+RPAkxwLpOMYYJZy3A/6wP8jeJWx5PIqb36DtBd7AZqU0gQga0NQM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819063323182.42543338645748; Tue, 1 Dec 2020 02:37:43 -0800 (PST) Received: from localhost ([::1]:49236 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk32U-0004BS-4e for importer@patchew.org; Tue, 01 Dec 2020 05:37:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk300-0002BB-0R for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:08 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39439) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk2zy-0003nQ-9h for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:07 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-296-XMcN9pScPlOCjO3S4kzbug-1; Tue, 01 Dec 2020 05:35:04 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 309F28558EB; Tue, 1 Dec 2020 10:35:03 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CD3CA10013C1; Tue, 1 Dec 2020 10:35:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818905; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ORkokebyZd7uYE6EL+PNhLAzVgs7mxSX6u3wc+B7flk=; b=RloYF+d+YMDRR/yF5+Q/0XMZ1MpxXmkH6yjJ6iCpFQREHpklF7ZTJ3pd8JZ0o6Z+luSKNp /L3Se7nxg+BeyRmvbcLZHvJ5VktKXSpXWy+ZNr5aggznpAn+XRI1YCV3U4++20kL2hFAwk 1JBU0/1elBqa09OgFc8Tq5yHahsnRBI= X-MC-Unique: XMcN9pScPlOCjO3S4kzbug-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 01/32] docs: temporarily disable the kernel-doc extension Date: Tue, 1 Dec 2020 05:34:31 -0500 Message-Id: <20201201103502.4024573-2-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Preserve bisectability while we update scripts/kernel-doc from Linux. Without this patch, building with Sphinx 3 would break while we revert our own Sphinx 3 support and replace it with Linux's. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell Tested-by: Peter Maydell --- docs/sphinx/kerneldoc.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 3ac277d162..9124fcbff1 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -75,6 +75,9 @@ class KernelDocDirective(Directive): # Tell sphinx of the dependency env.note_dependency(os.path.abspath(filename)) =20 + # Disabled temporarily while scripts/kernel-doc is updated + return [] + tab_width =3D self.options.get('tab-width', self.state.document.se= ttings.tab_width) =20 # FIXME: make this nicer and more robust against errors --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819812; cv=none; d=zohomail.com; s=zohoarc; b=XAk9klbll4olgJlCZ0WAkYIz9KsMwCMNTZJ+G4HC92E1eFv4lgcj/+uznCYh8yarQwX1XyOXGlL9Z50SBjSfNIWUUbwFaP7LlhI97tF5TNL5AIHF8TE0rWr+4guiOpP4bRXSvOuVOdIAxlntOWPCx39OwuvBi4sak2jBWChe5eg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819812; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uQMQmygVLLo56KizHbgMm/0357/uoLkrergt4oaKiKI=; b=QVw3WNCIKxOcRAEQa5FsdlEGHA1dCuMDtWlYAziff1pUKxlk4NasHEMOfIuBjuBAe/X38p9qdZhluWqEdsb2nQnFWCDV3Qh1T3vXErKaB1HwYor5nnuV4Hq6fbEPJLFB1kTuX2CSgg+4JnPSsPkiYrx5hfxSwGMRCuUHOElyC5E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160681981259195.43375290204756; Tue, 1 Dec 2020 02:50:12 -0800 (PST) Received: from localhost ([::1]:35182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3EZ-00054y-Cl for importer@patchew.org; Tue, 01 Dec 2020 05:50:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41880) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk305-0002LS-FL for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:28719) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk301-0003os-40 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:13 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-121-QrzqBSW4Ov63hf8cappePA-1; Tue, 01 Dec 2020 05:35:04 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 85351190A7B4; Tue, 1 Dec 2020 10:35:03 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F54410023B1; Tue, 1 Dec 2020 10:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uQMQmygVLLo56KizHbgMm/0357/uoLkrergt4oaKiKI=; b=BcLiDwi8ioyJvgIiO7sjIkk4XwJW6uilNCHt4ozI3RTfiadu5Pa3mPlYeYwqMEL1dzJ+/k v/v5vtpMCv3/Cu7/Y0p1pE+N3wbETe+YcbjU0yo9Zf4dkR+S/UzRmG4QvMWkQezqsCM6kB UY8o5nnNPewLXIRue9FhJnMqM2AZzA8= X-MC-Unique: QrzqBSW4Ov63hf8cappePA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 02/32] kernel-doc: fix processing nested structs with attributes Date: Tue, 1 Dec 2020 05:34:32 -0500 Message-Id: <20201201103502.4024573-3-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Andr=C3=A9 Almeida The current regular expression for strip attributes of structs (and for nested ones as well) also removes all whitespaces that may surround the attribute. After that, the code will split structs and iterate for each symbol separated by comma at the end of struct definition (e.g. "} alias1, alias2;"). However, if the nested struct does not have any alias and has an attribute, it will result in a empty string at the closing bracket (e.g "};"). This will make the split return nothing and $newmember will keep uninitialized. Fix that, by ensuring that the attribute substitution will leave at least one whitespace. Signed-off-by: Andr=C3=A9 Almeida Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-2-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4fbaaa05e3..d6bdb77ceb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1103,10 +1103,10 @@ sub dump_struct($$) { # strip comments: $members =3D~ s/\/\*.*?\*\///gos; # strip attributes - $members =3D~ s/\s*__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)//gi; - $members =3D~ s/\s*__aligned\s*\([^;]*\)//gos; - $members =3D~ s/\s*__packed\s*//gos; - $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR//gos; + $members =3D~ s/\s*__attribute__\s*\(\([a-z0-9,_\*\s\(\)]*\)\)/ /gi; + $members =3D~ s/\s*__aligned\s*\([^;]*\)/ /gos; + $members =3D~ s/\s*__packed\s*/ /gos; + $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; # replace DECLARE_BITMAP $members =3D~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $= 1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819197; cv=none; d=zohomail.com; s=zohoarc; b=a2GYdtINlOtrxljEWV774QhUGq/OFy+mKJH+nsPQ/5hZmUQ0bI4qpmqAk69GSybBr9dKEqNfJLQWskLPg4eI6+lLFd8uYawW9s7DQLoqaKrmE+S0WE2P3jc5GlxpnmCd1i7EUN2UyxekXoe+4huiUiQRhbXnyXMpITAEkLY7gO4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819197; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=WZYXKzO00JVUutQHmW9BkONu+EccXzcyR5d1oJJtjkE=; b=ZoTJjbOaN6h1hWSacxqCvilSWDkgP7j/OBcSBXDExLUOrM0Yry0ptSSDTyHtdVXyOad4lBhODa6KN7RKdFC5i8AI749h7Kz7cn5lmeT7Wb3jPcwZ95RH0WFbxGjJUidi0ZFjFtz50jRPVLttCjAqGJuG3CJ39x1pkLGl0cNTg3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819197910778.1969530785473; Tue, 1 Dec 2020 02:39:57 -0800 (PST) Received: from localhost ([::1]:57714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk34e-0007hE-Pa for importer@patchew.org; Tue, 01 Dec 2020 05:39:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk301-0002Dx-H5 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:09 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:26219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk2zz-0003nf-T3 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:09 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-35-EM7CAT3-PACRfdnVtYkFuQ-1; Tue, 01 Dec 2020 05:35:05 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E61399A242; Tue, 1 Dec 2020 10:35:03 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9FDE110013C1; Tue, 1 Dec 2020 10:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818906; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=WZYXKzO00JVUutQHmW9BkONu+EccXzcyR5d1oJJtjkE=; b=iYIpKmgORPSpcowK7EvL7HLfA/U1mdjYRFgcCUQSx/oJJ3M1NPsxFptGIaet8lhgY1uX/u +XU6BsT0xh72B7Y8U7ZbkVxzEdKdNRxAsMh8o8cRfXP67yZL8wLZ6kDe8CqxIrnRNEaTXI a1iNYt0YF8/hKuVavaSt3up0FeCaXew= X-MC-Unique: EM7CAT3-PACRfdnVtYkFuQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 03/32] kernel-doc: add support for ____cacheline_aligned_in_smp attribute Date: Tue, 1 Dec 2020 05:34:33 -0500 Message-Id: <20201201103502.4024573-4-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Andr=C3=A9 Almeida Subroutine dump_struct uses type attributes to check if the struct syntax is valid. Then, it removes all attributes before using it for output. `____cacheline_aligned_in_smp` is an attribute that is not included in both steps. Add it, since it is used by kernel structs. Signed-off-by: Andr=C3=A9 Almeida Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-3-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d6bdb77ceb..2f421b7313 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1092,7 +1092,7 @@ sub dump_struct($$) { my $x =3D shift; my $file =3D shift; =20 - if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= __attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/) { + if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= ____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/)= { my $decl_type =3D $1; $declaration_name =3D $2; my $members =3D $3; @@ -1107,6 +1107,7 @@ sub dump_struct($$) { $members =3D~ s/\s*__aligned\s*\([^;]*\)/ /gos; $members =3D~ s/\s*__packed\s*/ /gos; $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; + $members =3D~ s/\s*____cacheline_aligned_in_smp/ /gos; # replace DECLARE_BITMAP $members =3D~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $= 1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819518; cv=none; d=zohomail.com; s=zohoarc; b=PK//RRxB5L5bSGMNjD+S1fr+VJd/vW63uQZnFVbnWk1KvHO/Z3GrK0IVvg0K0MN6Z7w4y2Xo609M9rBDdehZlquHUxEn7Fk8vWfDQm1CpTYIUrXFyONpIl7zH6OHwV12Rbwl1snOwfIgRNR7Qir/LxZOyD++Kei4qXpBW/WsazU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819518; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lTbNvUmcxZxw5oB2uz5Cuhkq6SClsJLpylk8edw4H+k=; b=kox30uXiU8W+rM6K1/2KfgNz2N7XWU5rGcH2TUE40HPmz0XXoZTJ+NZ9ZwSmQL3py1n/kveW+1acKbHeEvUPJgbF+p9ocSGFIcryzHTTrk7976xm/A9Is0O5rRSTRoanRnR6f0QmrsiAUsXiZcvwJJHN+h2iO4JqZ8D3kp1KDpg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819518039696.594411115577; Tue, 1 Dec 2020 02:45:18 -0800 (PST) Received: from localhost ([::1]:46330 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk39o-0006N6-Gs for importer@patchew.org; Tue, 01 Dec 2020 05:45:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk303-0002In-DI for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:31290) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk300-0003oV-SD for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-591-0zsXgIfKOzyox2dgK1xjWA-1; Tue, 01 Dec 2020 05:35:05 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 50A8A100C61A; Tue, 1 Dec 2020 10:35:04 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C89E10013C1; Tue, 1 Dec 2020 10:35:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lTbNvUmcxZxw5oB2uz5Cuhkq6SClsJLpylk8edw4H+k=; b=Whf+kr2mgIDrOKliJgeKgef3XffAlMaTwgPVB8ZUbT0GZs0pjFCtjr43Wk7WvHoDNxgP0o 1egpqJIbLHd5PvVW7yC73fZ/0Qsi0AgTXG/O0rMev/Xh+jKnWSKUvqJQF10TT1sWKKi41j t5p6Q3rahYT/cmJxnk4jr1OlsBR69sA= X-MC-Unique: 0zsXgIfKOzyox2dgK1xjWA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 04/32] scripts/kernel-doc: Add support for named variable macro arguments Date: Tue, 1 Dec 2020 05:34:34 -0500 Message-Id: <20201201103502.4024573-5-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) From: Jonathan Neusch=C3=A4fer Currently, when kernel-doc encounters a macro with a named variable argument[1], such as this: #define hlist_for_each_entry_rcu(pos, head, member, cond...) ... it expects the variable argument to be documented as `cond...`, rather than `cond`. This is semantically wrong, because the name (as used in the macro body) is actually `cond`. With this patch, kernel-doc will accept the name without dots (`cond` in the example above) in doc comments, and warn if the name with dots (`cond...`) is used and verbose mode[2] is enabled. The support for the `cond...` syntax can be removed later, when the documentation of all such macros has been switched to the new syntax. Testing this patch on top of v5.4-rc6, `make htmldocs` shows a few changes in log output and HTML output: 1) The following warnings[3] are eliminated: ./include/linux/rculist.h:374: warning: Excess function parameter 'cond' description in 'list_for_each_entr= y_rcu' ./include/linux/rculist.h:651: warning: Excess function parameter 'cond' description in 'hlist_for_each_ent= ry_rcu' 2) For list_for_each_entry_rcu and hlist_for_each_entry_rcu, the correct description is shown 3) Named variable arguments are shown without dots [1]: https://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html [2]: scripts/kernel-doc -v [3]: See also https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux= -rcu.git/commit/?h=3Ddev&id=3D5bc4bc0d6153617eabde275285b7b5a8137fdf3c Signed-off-by: Jonathan Neusch=C3=A4fer Tested-by: Paul E. McKenney Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-4-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2f421b7313..0f67664165 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1480,6 +1480,10 @@ sub push_parameter($$$$) { # handles unnamed variable parameters $param =3D "..."; } + elsif ($param =3D~ /\w\.\.\.$/) { + # for named variable parameters of the form `x...`, remove the dots + $param =3D~ s/\.\.\.$//; + } if (!defined $parameterdescs{$param} || $parameterdescs{$param} eq ""= ) { $parameterdescs{$param} =3D "variable arguments"; } @@ -1967,6 +1971,18 @@ sub process_name($$) { sub process_body($$) { my $file =3D shift; =20 + # Until all named variable macro parameters are + # documented using the bare name (`x`) rather than with + # dots (`x...`), strip the dots: + if ($section =3D~ /\w\.\.\.$/) { + $section =3D~ s/\.\.\.$//; + + if ($verbose) { + print STDERR "${file}:$.: warning: Variable macro arguments should be= documented without dots\n"; + ++$warnings; + } + } + if (/$doc_sect/i) { # case insensitive for supported section names $newsection =3D $1; $newcontents =3D $2; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819196; cv=none; d=zohomail.com; s=zohoarc; b=jFd7/JMOC87ZgUes2gSsozPokcXdzsXmYDWrWhpAnLpqM5BXIJVRdL0C8/sINmrmepfweQZZiQzwQ7Svp/NA8bQOWO7cJsQNu/t1La2uEsH2IspwNH9to2y9aZLyASBJoHMDMXMqeBGpxk4TiEJCRvQnkVVrpmT+aZxvF+LPPio= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819196; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fa85XuODKeELysHalEXDYFyhkK3TZ2Sm3iaRM4QBWm8=; b=Powt4qapI9T8tjCLobFmXrewGpDYfyQruywEYKacHtLVQW2R/PdV1uzmo7BWbgJ86Zcc9tD+dvlnOd8mDKSxFC1h4SG6g6auPluTWJRmtKuOilHx8qlcD6v6qcVcm1RPii/AI0Cszy5CCZshlTlgEvPsBCbpykgJVGan54S58UE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819196015602.9300048386838; Tue, 1 Dec 2020 02:39:56 -0800 (PST) Received: from localhost ([::1]:57636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk34c-0007fH-Sc for importer@patchew.org; Tue, 01 Dec 2020 05:39:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41798) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk302-0002G9-Er for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:22390) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk300-0003nv-Fa for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-482-sBylG4phNFm2SglZHobMiw-1; Tue, 01 Dec 2020 05:35:05 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AF8BF1092BBD; Tue, 1 Dec 2020 10:35:04 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6C3F210023B1; Tue, 1 Dec 2020 10:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818907; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fa85XuODKeELysHalEXDYFyhkK3TZ2Sm3iaRM4QBWm8=; b=FAYBmjHTBYby0aNTpABsuMM5EEMMvvBhPNJW3PSsoyBecxX8ypjVUqOg0wqa0k9Yqlzy+I 8LPBh4WvxxEOCA3JCZbo6vn16JxV0t7suqe7rjKgLNwaNGc8uZFr4LGIJiCHKOmQA4cz81 UQgRGct1EQpA/ICHzTMs07AZ/IckHf0= X-MC-Unique: sBylG4phNFm2SglZHobMiw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 05/32] scripts: kernel-doc: proper handle @foo->bar() Date: Tue, 1 Dec 2020 05:34:35 -0500 Message-Id: <20201201103502.4024573-6-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The pattern @foo->bar() is valid, as it can be used by a function pointer inside a struct passed as a parameter. Right now, it causes a warning: ./drivers/firewire/core-transaction.c:606: WARNING: Inline strong start-st= ring without end-string. In this specific case, the kernel-doc markup is: /** * fw_core_remove_address_handler() - unregister an address handler * @handler: callback * * To be called in process context. * * When fw_core_remove_address_handler() returns, @handler->callback() is * guaranteed to not run on any CPU anymore. */ With seems valid on my eyes. So, instead of trying to hack the kernel-doc markup, let's teach it about how to handle such things. This should likely remove lots of other similar warnings as well. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/48b46426d7bf6ff7529f20e5718fbf4e9758e62c.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-5-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0f67664165..99530fb08b 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -216,6 +216,7 @@ my $type_constant2 =3D '\%([-_\w]+)'; my $type_func =3D '(\w+)\(\)'; my $type_param =3D '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; my $type_fp_param =3D '\@(\w+)\(\)'; # Special RST handling for func ptr = params +my $type_fp_param2 =3D '\@(\w+->\S+)\(\)'; # Special RST handling for str= ucts with func ptr params my $type_env =3D '(\$\w+)'; my $type_enum =3D '#(enum\s*([_\w]+))'; my $type_struct =3D '#(struct\s*([_\w]+))'; @@ -251,6 +252,7 @@ my @highlights_rst =3D ( [$type_member_func, "\\:c\\:type\\:`\$1\$2\$3\\\\(\= \\\) <\$1>`"], [$type_member, "\\:c\\:type\\:`\$1\$2\$3 <\$1>`"], [$type_fp_param, "**\$1\\\\(\\\\)**"], + [$type_fp_param2, "**\$1\\\\(\\\\)**"], [$type_func, "\$1()"], [$type_enum, "\\:c\\:type\\:`\$1 <\$2>`"], [$type_struct, "\\:c\\:type\\:`\$1 <\$2>`"], --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819362; cv=none; d=zohomail.com; s=zohoarc; b=c7c2LL7XYkz/L+ye93jZm6+bLC+zeeQecp2wCLqMt/m+GpTAvM5fmvaCrtN2d0O2i1LshQD9AuYJWE88btuFi3bOMQt0p/0RUJ/cH8RJGky7lAhmmx38R5RTho6tkHYn85f5MH8vF24FenSa5HjvcBY6uMmqBc3e6OabQqgjHHw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819362; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=xGyWuyk96qqKzEbfJ4PiZWk+a4+54l1Ti4T2Ca7YwMM=; b=LRnNAegho21g8vIq//6ZjRbdVXolgzhdeK/gXYvnOifagZt4jN9r3SVlEPzyjhQK9GJAS8aJ0svGmzdDjpf78yH4sIoddX5DCTTUdIrL2V43KsfWp7zvrdg4Ph/VpF0uZyfXJJyNrJLWlEc1b/LkmOrj6EcXaYD/rMPmfkSVIJI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819362598491.6632118936093; Tue, 1 Dec 2020 02:42:42 -0800 (PST) Received: from localhost ([::1]:37866 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk37J-0002pv-Gg for importer@patchew.org; Tue, 01 Dec 2020 05:42:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk303-0002IB-7c for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:11 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:34885) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk300-0003oR-RT for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:10 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-536-u9KUJCYyMIKpvJRBmyKtaA-1; Tue, 01 Dec 2020 05:35:06 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1FA56190A7A1; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAF2A10023B1; Tue, 1 Dec 2020 10:35:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xGyWuyk96qqKzEbfJ4PiZWk+a4+54l1Ti4T2Ca7YwMM=; b=Dr9ID2OPdBcvY7T2UR38bFhdBNd/0rQ2BbZBiLrOgQnQP0pxWb0GqHJij7u3Bp4KS8rSOx dqLFsisXMMH8vdLIrMVyqk8n6TjL4bTLfq3hQC/FX6MhEnQXX9hlg1QnNKppb1D81Nrucj Rn5i2hOK1RJ9TGeFkGD5hIvKL8NZrio= X-MC-Unique: u9KUJCYyMIKpvJRBmyKtaA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 06/32] scripts: kernel-doc: accept negation like !@var Date: Tue, 1 Dec 2020 05:34:36 -0500 Message-Id: <20201201103502.4024573-7-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab On a few places, it sometimes need to indicate a negation of a parameter, like: !@fshared This pattern happens, for example, at: kernel/futex.c and it is perfectly valid. However, kernel-doc currently transforms it into: !**fshared** This won't do what it would be expected. Fortunately, fixing the script is a simple matter of storing the "!" before "@" and adding it after the bold markup, like: **!fshared** Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/0314b47f8c3e1f9db00d5375a73dc3cddd8a21f2.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-6-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 99530fb08b..e4b3cd486f 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -215,6 +215,7 @@ my $type_constant =3D '\b``([^\`]+)``\b'; my $type_constant2 =3D '\%([-_\w]+)'; my $type_func =3D '(\w+)\(\)'; my $type_param =3D '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; +my $type_param_ref =3D '([\!]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; my $type_fp_param =3D '\@(\w+)\(\)'; # Special RST handling for func ptr = params my $type_fp_param2 =3D '\@(\w+->\S+)\(\)'; # Special RST handling for str= ucts with func ptr params my $type_env =3D '(\$\w+)'; @@ -239,6 +240,7 @@ my @highlights_man =3D ( [$type_typedef, "\\\\fI\$1\\\\fP"], [$type_union, "\\\\fI\$1\\\\fP"], [$type_param, "\\\\fI\$1\\\\fP"], + [$type_param_ref, "\\\\fI\$1\$2\\\\fP"], [$type_member, "\\\\fI\$1\$2\$3\\\\fP"], [$type_fallback, "\\\\fI\$1\\\\fP"] ); @@ -260,7 +262,7 @@ my @highlights_rst =3D ( [$type_union, "\\:c\\:type\\:`\$1 <\$2>`"], # in rst this can refer to any type [$type_fallback, "\\:c\\:type\\:`\$1`"], - [$type_param, "**\$1**"] + [$type_param_ref, "**\$1\$2**"] ); my $blankline_rst =3D "\n"; =20 --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819364; cv=none; d=zohomail.com; s=zohoarc; b=R6RAhJfVMEbMvFlDsWAiWvQ11mpzEsZQG6EA80KWp6UuJQ8cl/8hXCxCtmSWqosIL+N+2q0YK4T31ihH1KFgUEF7JLJdCFShFaBA1DNYYQGEhSjIGk2LoZczRr7abYKVyja4IEQ4YfYMmU1lR1pvV9XeZ/J7u5YqYkvzev05+nc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819364; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2u5vWAM3QV1XtIiQ8u3LMQS/2hhuLS683irIASUSqOA=; b=AxqXkYLG6tILxqBVZ2YbXUDcibcGbD+EGjFhJyXTokNeY5qc1Bl4W2rvPWmGNGT5vo/xm41GeFzS9OSge64qUVef6hhDMxDIYD/S1ck6MvWG1JtbnQvZYEHgCl24/qciOqyyT9UgH1WH/FHS/kmUR/Wac9Sqklo7iIEyrr45I7s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819364443775.7524642201431; Tue, 1 Dec 2020 02:42:44 -0800 (PST) Received: from localhost ([::1]:38020 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk37L-0002ty-9u for importer@patchew.org; Tue, 01 Dec 2020 05:42:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41836) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk303-0002J5-Pr for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39142) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk301-0003ox-7R for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:11 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-224-QeppF_ZPMFqfjCXvV6gBOg-1; Tue, 01 Dec 2020 05:35:06 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 7E24C190A7A5; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A8DB10013C1; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818908; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2u5vWAM3QV1XtIiQ8u3LMQS/2hhuLS683irIASUSqOA=; b=bnIThSQX3dSkNO2iHLkjK1QpFfFoEw7stmlN+eQNmSkOpOHeyydjrG6eKHqb094Xlf9Tc3 DEyFtXJCd15ysinTB6UxZ3VL38gjVNNhVLteYwpe2+27TlV7mclACQDke/66y14JBim44N iGUYbFy+ClTs2QSx06dFCgY7dshr51U= X-MC-Unique: QeppF_ZPMFqfjCXvV6gBOg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 07/32] scripts: kernel-doc: accept blank lines on parameter description Date: Tue, 1 Dec 2020 05:34:37 -0500 Message-Id: <20201201103502.4024573-8-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Sphinx is very pedantic with respect to blank lines. Sometimes, in order to make it to properly handle something, we need to add a blank line. However, currently, any blank line inside a kernel-doc comment like: /* * @foo: bar * * foobar * * some description will be considered as if "foobar" was part of the description. This patch changes kernel-doc behavior. After it, foobar will be considered as part of the parameter text. The description will only be considered as such if it starts with: zero spaces after asterisk: *foo one space after asterisk: * foo or have a explicit Description section: * Description: Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/c07d2862792d75a2691d69c9eceb7b89a0164cc0.15= 86881715.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-7-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index e4b3cd486f..95f2d7adcf 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -334,13 +334,14 @@ my $lineprefix=3D""; =20 # Parser states use constant { - STATE_NORMAL =3D> 0, # normal code - STATE_NAME =3D> 1, # looking for function name - STATE_BODY_MAYBE =3D> 2, # body - or maybe more description - STATE_BODY =3D> 3, # the body of the comment - STATE_PROTO =3D> 4, # scanning prototype - STATE_DOCBLOCK =3D> 5, # documentation block - STATE_INLINE =3D> 6, # gathering documentation outside main blo= ck + STATE_NORMAL =3D> 0, # normal code + STATE_NAME =3D> 1, # looking for function name + STATE_BODY_MAYBE =3D> 2, # body - or maybe more description + STATE_BODY =3D> 3, # the body of the comment + STATE_BODY_WITH_BLANK_LINE =3D> 4, # the body, which has a blank line + STATE_PROTO =3D> 5, # scanning prototype + STATE_DOCBLOCK =3D> 6, # documentation block + STATE_INLINE =3D> 7, # gathering doc outside main block }; my $state; my $in_doc_sect; @@ -1987,6 +1988,12 @@ sub process_body($$) { } } =20 + if ($state =3D=3D STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) { + dump_section($file, $section, $contents); + $section =3D $section_default; + $contents =3D ""; + } + if (/$doc_sect/i) { # case insensitive for supported section names $newsection =3D $1; $newcontents =3D $2; @@ -2040,18 +2047,21 @@ sub process_body($$) { $state =3D STATE_PROTO; $brcount =3D 0; } elsif (/$doc_content/) { - # miguel-style comment kludge, look for blank lines after - # @parameter line to signify start of description if ($1 eq "") { - if ($section =3D~ m/^@/ || $section eq $section_context) { + if ($section eq $section_context) { dump_section($file, $section, $contents); $section =3D $section_default; $contents =3D ""; $new_start_line =3D $.; + $state =3D STATE_BODY; } else { + if ($section ne $section_default) { + $state =3D STATE_BODY_WITH_BLANK_LINE; + } else { + $state =3D STATE_BODY; + } $contents .=3D "\n"; } - $state =3D STATE_BODY; } elsif ($state =3D=3D STATE_BODY_MAYBE) { # Continued declaration purpose chomp($declaration_purpose); @@ -2203,7 +2213,8 @@ sub process_file($) { process_normal(); } elsif ($state =3D=3D STATE_NAME) { process_name($file, $_); - } elsif ($state =3D=3D STATE_BODY || $state =3D=3D STATE_BODY_MAYBE) { + } elsif ($state =3D=3D STATE_BODY || $state =3D=3D STATE_BODY_MAYBE || + $state =3D=3D STATE_BODY_WITH_BLANK_LINE) { process_body($file, $_); } elsif ($state =3D=3D STATE_INLINE) { # scanning for inline parameters process_inline($file, $_); --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819523; cv=none; d=zohomail.com; s=zohoarc; b=hObHlx/RaKe0+8DMXvd4ntI7CsbyiYQIGT/cddGv0sbd9brJojEq6vDwRJuIvintO8JAia97DjDtFMrdZZmNiGQkanUEoPArQfrYo7OekYbsPBhfNtlJoUyU7frMDMQ4gWLXLKch178R3LfwzRxUj28MGhILJcE+RP9UHrV6Zpc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819523; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mnDt9dCJFmP8E0DM2A3oLfqLSGXZccI9gx1KuDRb0Zs=; b=hOpso6p/PaxmW9ynuLJ5DcBXAyhmNBhfJakDyiCq8LKnfceAfbsIl832b1S9YgSJurVJ9xyXAs01aohdS+RxHoLHMJWbEtUiHdqsoEyfQJcG0bGucn/Jm2bhGcvPd3GOmFodt0Od/kzaG5/XQhcqJ7LP6mlJCiK+8WaSCNVZAcE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819523397387.13679037077907; Tue, 1 Dec 2020 02:45:23 -0800 (PST) Received: from localhost ([::1]:46516 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk39u-0006Ro-AJ for importer@patchew.org; Tue, 01 Dec 2020 05:45:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41850) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk304-0002KG-N4 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:12 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45592) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk302-0003pJ-IH for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-85-hRTBQIEIPMaHNKXXIX37TQ-1; Tue, 01 Dec 2020 05:35:06 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DD8691092BA0; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 995C410023B1; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mnDt9dCJFmP8E0DM2A3oLfqLSGXZccI9gx1KuDRb0Zs=; b=OFbSXawa8f053qZk9hbWbCKIU4Ml7EINLq88bqTotiL6qDpMbGqTwErlRqj+yY1BacZsny jpv8vTFrQU7e3PwbSS4yEs0lc8/JawQ/QvdS3bKwMv9fcAn5V1yHFm+xnINOlyt42S0F79 IO25Rf//hn5f2lU9AYVtLNkcoFxoGt0= X-MC-Unique: hRTBQIEIPMaHNKXXIX37TQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 08/32] Replace HTTP links with HTTPS ones: documentation Date: Tue, 1 Dec 2020 05:34:38 -0500 Message-Id: <20201201103502.4024573-9-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: "Alexander A. Klimov" Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: For each line: If doesn't contain `\bxmlns\b`: For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov Link: https://lore.kernel.org/r/20200526060544.25127-1-grandmaster@al2klimo= v.de Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-8-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 95f2d7adcf..fadc2f5b86 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -324,7 +324,7 @@ if (defined($ENV{'KBUILD_VERBOSE'})) { =20 # Generated docbook code is inserted in a template at a point where # docbook v3.1 requires a non-zero sequence of RefEntry's; see: -# http://www.oasis-open.org/docbook/documentation/reference/html/refentry.= html +# https://www.oasis-open.org/docbook/documentation/reference/html/refentry= .html # We keep track of number of generated entries and generate a dummy # if needs be to ensure the expanded template can be postprocessed # into html. --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819281; cv=none; d=zohomail.com; s=zohoarc; b=YMouupVLZPtDPKcAf6U3H1Zvgv4Yf6RzlCUIzjPl7u2wVuJ4hlFnibsv7C3pPq9/fJ3025CKweEAZKnkIYPeseWsJahrReRSX1z6Fttr2WTHc5+KEtKmBUewocjGDINq5P6vKeJNG7vYazW2QC8EjHqEBzXX6fVhwCsDEDKCfdQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819281; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=63F4hjsPgY3g+SgiHAsRKv4smSA5qlvgJjHWOrAc6a8=; b=DPs8GrED2FgGjyfa+rkMgxmGIgxqOGevBcRhkHqaYrRuSSmJCx1KuxNBdnNdcA92UGU79yiMpIZyCXMDQHaG7jbqv25cZcIumI64X8estA9iRMacNRaJqSazT/nSFMKcm9t8YnKQuZyOBeRflJxqj6OWYw+5sWJjVJbHon2LNEM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819281456309.6792854766935; Tue, 1 Dec 2020 02:41:21 -0800 (PST) Received: from localhost ([::1]:34832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk360-0001Ze-CI for importer@patchew.org; Tue, 01 Dec 2020 05:41:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41860) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk305-0002Ks-2L for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:13 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk302-0003pH-JZ for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:12 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-221-dZMN4633OKa8Qc7Iiuqvhw-1; Tue, 01 Dec 2020 05:35:07 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4A5E7805BE0; Tue, 1 Dec 2020 10:35:06 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 04E5F10013C1; Tue, 1 Dec 2020 10:35:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818909; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=63F4hjsPgY3g+SgiHAsRKv4smSA5qlvgJjHWOrAc6a8=; b=YY9Mzxg5ufee6+NV5Q/7H6en+mNsb2neuZke9S1s+fr7NYxzfqdUeS1iQkSdj3o0sJs/uW 0LA6GwXzvjvtPFnL2bNEz4hZ8DWkozLZfOMcw6q1MKv28Lx2Hn7sfw+j87/HYdYDdZuZEc 49bwctPU3PZkIZKnJ1o70Mmq2VLzltk= X-MC-Unique: dZMN4633OKa8Qc7Iiuqvhw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 09/32] scripts/kernel-doc: parse __ETHTOOL_DECLARE_LINK_MODE_MASK Date: Tue, 1 Dec 2020 05:34:39 -0500 Message-Id: <20201201103502.4024573-10-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The __ETHTOOL_DECLARE_LINK_MODE_MASK macro is a variant of DECLARE_BITMAP(), used by phylink.h. As we have already a parser for DECLARE_BITMAP(), let's add one for this macro, in order to avoid such warnings: ./include/linux/phylink.h:54: warning: Function parameter or member '__ETH= TOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_sta= te' ./include/linux/phylink.h:54: warning: Function parameter or member '__ETH= TOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_= state' Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/d1d1dea67a28117c0b0c33271b139c4455fef287.15= 92895969.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-9-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index fadc2f5b86..e8fff6a525 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1113,7 +1113,9 @@ sub dump_struct($$) { $members =3D~ s/\s*__packed\s*/ /gos; $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =3D~ s/\s*____cacheline_aligned_in_smp/ /gos; + # replace DECLARE_BITMAP + $members =3D~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_B= ITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos; $members =3D~ s/DECLARE_BITMAP\s*\(([^,)]+),\s*([^,)]+)\)/unsigned long $= 1\[BITS_TO_LONGS($2)\]/gos; # replace DECLARE_HASHTABLE $members =3D~ s/DECLARE_HASHTABLE\s*\(([^,)]+),\s*([^,)]+)\)/unsigned lon= g $1\[1 << (($2) - 1)\]/gos; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819486; cv=none; d=zohomail.com; s=zohoarc; b=DalUd1zXHqb9dSTnU9bxmmrWwt5oYaZjDTCBTwuk+RQTZ6C1FnkvIrLUHI1hvuV3AbeZx5xJZj+tz4oy0BajrAFjuEeCdy6znCFs/0rXnwdFmLjsDkqfnyJ8QzYq8KXOiTpdUbPXUNRcQJtpyx/FPdJGk/eXA+gWTv1d26ceZG4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819486; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O9hSD6aXz202BRQxQakOz7bqCncJQ7SCRZireavH59k=; b=WPnNylHfIQn3nPg6ztJg6rKJbDRpYIm+fxwrK/nRRNGpJBHGWsyDMSww1+N+vw1B+APtLaAJtzYUkbYrL8TV1QIrL78/YBkftKsenPpFAFcaueMRI1g+ZgThaZAwIP5+OJbfjgsQ4S3tU1JPrXNkCrFwlh6QdxQONVkjNjzUzZo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160681948618370.5102733260137; Tue, 1 Dec 2020 02:44:46 -0800 (PST) Received: from localhost ([::1]:43498 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk39J-0005DC-1r for importer@patchew.org; Tue, 01 Dec 2020 05:44:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42038) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30I-0002Nw-IN for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:45867) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk304-0003py-TA for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-EkQUPawBOuOJDCgTxL20oA-1; Tue, 01 Dec 2020 05:35:08 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1CAA9190A7A6; Tue, 1 Dec 2020 10:35:07 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id C0AD810013C1; Tue, 1 Dec 2020 10:35:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9hSD6aXz202BRQxQakOz7bqCncJQ7SCRZireavH59k=; b=AgGOa0vtjVnpTYUv8llUM4QLZTGeXfA/71Ta5DpzS2r+Z6/jTu7rojXqxEssQzG9fz3GIV iRiVXFaHV7UaoJk28VjWRDiVfTvYC1UyFhPlSJDNqAwSG42a8y3JkELFjUU+eSMMJkC8f7 Db9LZCP0dw9CXxixPZzVJDLd6TGh82g= X-MC-Unique: EkQUPawBOuOJDCgTxL20oA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 10/32] scripts/kernel-doc: handle function pointer prototypes Date: Tue, 1 Dec 2020 05:34:40 -0500 Message-Id: <20201201103502.4024573-11-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There are some function pointer prototypes inside the net includes, like this one: int (*pcs_config)(struct phylink_config *config, unsigned int mode, phy_interface_t interface, const unsigned long *advertising); There's nothing wrong using it with kernel-doc, but we need to add a rule for it to parse such kind of prototype. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/fec520dd731a273013ae06b7653a19c7d15b9562.15= 92895969.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-10-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index e8fff6a525..1cdece23fb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1801,6 +1801,11 @@ sub process_proto_function($$) { $prototype =3D~ s@/\*.*?\*/@@gos; # strip comments. $prototype =3D~ s@[\r\n]+@ @gos; # strip newlines/cr's. $prototype =3D~ s@^\s+@@gos; # strip leading spaces + + # Handle prototypes for function pointers like: + # int (*pcs_config)(struct foo) + $prototype =3D~ s@^(\S+\s+)\(\s*\*(\S+)\)@$1$2@gos; + if ($prototype =3D~ /SYSCALL_DEFINE/) { syscall_munge(); } --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819655; cv=none; d=zohomail.com; s=zohoarc; b=ECUs+htn/ptls1hufdRiG1wxfDG0foXYZ89Q4qeCaaPY0fykOrdWlPfxSwYnG/yxPLUUACV60dw6l/nj8gSlRd17GeWK5/e0lsD6qQjBXTNXIYlm1TsPYJHWzLe93JAj07b+NxxRF96Kx+XD2AjzUCw3fJVKYt5ppKDmpKxPvCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819655; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=S1wx4TC4FJnM01CiYUL9Na+v5QgrCrPNyRPcarA1104=; b=VfZehQ4jk+yvU5WXUgFY5VymEzVcnb6yamQA7P1Mw+YjWGkfXO/GIjV6dHnE8MR7bvPgpYEqSr8UsUX2C8WbrL2dHgE0LuGzswKbgs0AaZ9Cu1apF98xCERlDYx4E1CvNiBdLxLU92KJRgaYNuNC4OzwNuBl3Rl674Nwt9F3FVg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819655352984.8231448568029; Tue, 1 Dec 2020 02:47:35 -0800 (PST) Received: from localhost ([::1]:54914 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3C2-0001Yb-8I for importer@patchew.org; Tue, 01 Dec 2020 05:47:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41934) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk309-0002MD-9I for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:47285) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk304-0003pf-5F for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:15 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-548-tVhhE7gNPzO8UNcP0xdkMw-1; Tue, 01 Dec 2020 05:35:08 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8E41E2FD0B; Tue, 1 Dec 2020 10:35:07 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D72A10023B1; Tue, 1 Dec 2020 10:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=S1wx4TC4FJnM01CiYUL9Na+v5QgrCrPNyRPcarA1104=; b=hBInYGNMM8fKzTcHTLpgo71ZTxVsOwHGx2u8nHj9B9lFEga9fHjY8NJyPeV2OwrCjxsTzP iPe6abs1S7QlkLevok6hNImoZBlDDQ6hRfP1TDz3XSeq0p+2YwsdX/NQVY+2mBH1Z21E16 /0ZxoxiioUq0V5zNRBtViX/urdbiZN4= X-MC-Unique: tVhhE7gNPzO8UNcP0xdkMw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 11/32] scripts/kernel-doc: optionally treat warnings as errors Date: Tue, 1 Dec 2020 05:34:41 -0500 Message-Id: <20201201103502.4024573-12-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Pierre-Louis Bossart The kbuild bot recently added the W=3D1 option, which triggered documentation cleanups to squelch hundreds of kernel-doc warnings. To make sure new kernel contributions don't add regressions to kernel-doc descriptors, this patch suggests an option to treat warnings as errors in CI/automated tests. A -Werror command-line option is added to the kernel-doc script. When this option is set, the script will return the number of warnings found. The caller can then treat this positive return value as an error and stop the build. Using this command line option is however not straightforward when the kernel-doc script is called from other scripts. To align with typical kernel compilation or documentation generation, the Werror option is also set by checking the KCFLAGS environment variable, or if KDOC_WERROR is defined, as in the following examples: KCFLAGS=3D"-Wall -Werror" make W=3D1 sound/ KCFLAGS=3D"-Wall -Werror" make W=3D1 drivers/soundwire/ KDOC_WERROR=3D1 make htmldocs Note that in the last example the documentation build does not stop, only an additional log is provided. Credits to Randy Dunlap for suggesting the use of environment variables. Suggested-by: Randy Dunlap Signed-off-by: Pierre-Louis Bossart Link: https://lore.kernel.org/r/20200728162040.92467-1-pierre-louis.bossart= @linux.intel.com Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-11-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 1cdece23fb..eb635eb94c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -83,6 +83,7 @@ Output selection modifiers: Other parameters: -v Verbose output, more warnings and other information. -h Print this help. + -Werror Treat warnings as errors. =20 EOF print $message; @@ -275,6 +276,7 @@ my $kernelversion; my $dohighlight =3D ""; =20 my $verbose =3D 0; +my $Werror =3D 0; my $output_mode =3D "rst"; my $output_preformatted =3D 0; my $no_doc_sections =3D 0; @@ -322,6 +324,18 @@ if (defined($ENV{'KBUILD_VERBOSE'})) { $verbose =3D "$ENV{'KBUILD_VERBOSE'}"; } =20 +if (defined($ENV{'KDOC_WERROR'})) { + $Werror =3D "$ENV{'KDOC_WERROR'}"; +} + +if (defined($ENV{'KCFLAGS'})) { + my $kcflags =3D "$ENV{'KCFLAGS'}"; + + if ($kcflags =3D~ /Werror/) { + $Werror =3D 1; + } +} + # Generated docbook code is inserted in a template at a point where # docbook v3.1 requires a non-zero sequence of RefEntry's; see: # https://www.oasis-open.org/docbook/documentation/reference/html/refentry= .html @@ -436,6 +450,8 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { push(@export_file_list, $file); } elsif ($cmd eq "v") { $verbose =3D 1; + } elsif ($cmd eq "Werror") { + $Werror =3D 1; } elsif (($cmd eq "h") || ($cmd eq "help")) { usage(); } elsif ($cmd eq 'no-doc-sections') { @@ -2292,4 +2308,9 @@ if ($verbose && $warnings) { print STDERR "$warnings warnings\n"; } =20 -exit($output_mode eq "none" ? 0 : $errors); +if ($Werror && $warnings) { + print STDERR "$warnings warnings as Errors\n"; + exit($warnings); +} else { + exit($output_mode eq "none" ? 0 : $errors) +} --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820235; cv=none; d=zohomail.com; s=zohoarc; b=Io6dHRA5M5ETis28SRELqNnCQaBHaWJAHV0BrCxsSTom77mwU5vto/gvvxdLIRjLLyh5Rc2Up9fKw4pk7ILt/orbyu8F74WgZuc7lh8crmLMLJoKqR66rdRzHmGvyfHEL1pcilzVxGdYvJFdGcGz6mpB4KYCwKaIMbU07xsV6K0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820235; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=w5+i7WtTOWFay7Bbldi9tvqw4ql3MDE7bXj9l/6PVIE=; b=hK7sSqt1G0kFj2FKOJepBCs5kSN4HIMLf/MexyCbihoasGHZIidDH5ji5jR/usKCLwpwXJsj9Vs/+u1gS9ax1MBMVp2MookmC5+kuVrc1BVe42DZmWYV9ZUfS4oAR7oVZzQqnPhu3sxIUeMIdPSrPjehA9LDdL0wPxuzoNgUFA8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820235790164.6962592333541; Tue, 1 Dec 2020 02:57:15 -0800 (PST) Received: from localhost ([::1]:60690 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3LO-0007Q1-O5 for importer@patchew.org; Tue, 01 Dec 2020 05:57:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30I-0002Nt-BR for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:21017) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk307-0003r3-At for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:24 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-79-o-pnQ8WNO6WR7zpafBpp2g-1; Tue, 01 Dec 2020 05:35:09 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0935039344; Tue, 1 Dec 2020 10:35:08 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id AEACC10023B1; Tue, 1 Dec 2020 10:35:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818913; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=w5+i7WtTOWFay7Bbldi9tvqw4ql3MDE7bXj9l/6PVIE=; b=PtqdChHbRftRgdHf5hIT5Aev8wlUw6qZ31AMgGVb3TEY1ps6Ul4gDuMgnh/0IvSkjmI1rr 6m++QG00gMeFgN7REsbXDA5lDMej0zJiyJ3UvSmaJzzSvDtVZ6yN2rahnrAWjS4AhRnViC d+K0W4r93DcVsWJ+E9mFzCt81fqQNAg= X-MC-Unique: o-pnQ8WNO6WR7zpafBpp2g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 12/32] kernel-doc: include line numbers for function prototypes Date: Tue, 1 Dec 2020 05:34:42 -0500 Message-Id: <20201201103502.4024573-13-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab This should solve bad error reports like this one: ./include/linux/iio/iio.h:0: WARNING: Unknown target name: "devm". Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/56eed0ba50cd726236acd12b11b55ce54854c5ea.15= 99660067.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-12-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index eb635eb94c..3fd6f3925e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1624,6 +1624,8 @@ sub dump_function($$) { my $file =3D shift; my $noret =3D 0; =20 + print_lineno($.); + $prototype =3D~ s/^static +//; $prototype =3D~ s/^extern +//; $prototype =3D~ s/^asmlinkage +//; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819113; cv=none; d=zohomail.com; s=zohoarc; b=EmZuHX+aIRR2PF80mlf7GUpaqiETDbQcCqwENj6uHFthbVbYjCoN/fmBUq6dSfM/AEvZ0u8ePGJpd25qj7L1eDwpfWONGab7QMd9MqR60200UzPEMO4rWBWNkiuLijqWnMEmVYg5G1EHP6Vu/6RsF962g5hz4Ny3EQ6fY/PLp9s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819113; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Cu74eGbX1Pzti3T+9FIBrGUXU++sBJFK1SRMc5dwyjo=; b=evJvZnFcPTi0Cab878B9gA7FASzfInsQtwQf7jvzabHGxZOkA7960wJPPgNvVLHfYkL/7u4kHleAByiNLSI4xJ1B76uZ2S/FoSp5UnqphPnFWzHiCSE49XpjtxLwCAGenckfe+7NQGeEFU4G++RRxdNq802LNaMKzFGtwCzOyuc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819113005212.03446926535776; Tue, 1 Dec 2020 02:38:33 -0800 (PST) Received: from localhost ([::1]:51298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk33H-000538-OX for importer@patchew.org; Tue, 01 Dec 2020 05:38:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41936) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk309-0002ME-B1 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:18 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55927) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk305-0003qG-0C for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:17 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-YHzHarA0MYW4Y6CwAh1k0A-1; Tue, 01 Dec 2020 05:35:09 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 789EE100C600; Tue, 1 Dec 2020 10:35:08 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 29A0C10023B1; Tue, 1 Dec 2020 10:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cu74eGbX1Pzti3T+9FIBrGUXU++sBJFK1SRMc5dwyjo=; b=cekmJKos00zu+IMgOAp2/VHFfoktPo2sl8n5s7pjpvwbbOhSKBJehpKn89vXicH/AWSp3C J+DcFOUQvtDcVCEqL4C+QCFG3ux3Ngrj7zCaU3r/mVStOQP3p6PDABzJNkiht29TSPFMnV ErkQT7OY8VeOp0UJanGP7rrRU10iWJo= X-MC-Unique: YHzHarA0MYW4Y6CwAh1k0A-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 13/32] kernel-doc: add support for ____cacheline_aligned attribute Date: Tue, 1 Dec 2020 05:34:43 -0500 Message-Id: <20201201103502.4024573-14-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Jonathan Cameron Subroutine dump_struct uses type attributes to check if the struct syntax is valid. Then, it removes all attributes before using it for output. `____cacheline_aligned` is an attribute that is not included in both steps. Add it, since it is used by kernel structs. Based on previous patch to add ____cacheline_aligned_in_smp. Motivated by patches to reorder this attribute to before the variable name. Whilst we could do that in all cases, that would be a massive change and it is more common in the kernel to place this particular attribute after the variable name. A quick grep suggests approximately 400 instances of which 341 have this attribute just before a semicolon and hence after the variable name. Signed-off-by: Jonathan Cameron Cc: Lee Jones Link: https://lore.kernel.org/r/20200910185415.653139-1-jic23@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-13-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 3fd6f3925e..c4c5640ded 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1113,7 +1113,7 @@ sub dump_struct($$) { my $x =3D shift; my $file =3D shift; =20 - if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= ____cacheline_aligned_in_smp|__attribute__\s*\(\([a-z0-9,_\s\(\)]*\)\)))*/)= { + if ($x =3D~ /(struct|union)\s+(\w+)\s*\{(.*)\}(\s*(__packed|__aligned|= ____cacheline_aligned_in_smp|____cacheline_aligned|__attribute__\s*\(\([a-z= 0-9,_\s\(\)]*\)\)))*/) { my $decl_type =3D $1; $declaration_name =3D $2; my $members =3D $3; @@ -1129,6 +1129,7 @@ sub dump_struct($$) { $members =3D~ s/\s*__packed\s*/ /gos; $members =3D~ s/\s*CRYPTO_MINALIGN_ATTR/ /gos; $members =3D~ s/\s*____cacheline_aligned_in_smp/ /gos; + $members =3D~ s/\s*____cacheline_aligned/ /gos; =20 # replace DECLARE_BITMAP $members =3D~ s/__ETHTOOL_DECLARE_LINK_MODE_MASK\s*\(([^\)]+)\)/DECLARE_B= ITMAP($1, __ETHTOOL_LINK_MODE_MASK_NBITS)/gos; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820044; cv=none; d=zohomail.com; s=zohoarc; b=GXylghuk6+nrZUxPMKmCUQlMvwGSfiReSyJiQ1Y7JNR1FvsT8GXrT9O18el8eEyZpGLuh0Xeqqf6Vz43uhA0LrdTrM4u0bZVktLliAidJ+b5cIRVNi6PWPz4O07+pnVpoKlxM6ZpCidixaoiiT5uBBecQPkkn319jrFGmeyszBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820044; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eg1UCSP6TBFRjWh8o362r/gExEhG9FGt2zB8v+faRZc=; b=kIk0FvqaAvCniHIc/l7LiwJBHcv/L1/93kqXJZFPvjOVLXshecdJxFbF5AB0fUfEZHZ7CpDTcz+marNLuZsuf5GjBFhLpKtxYwI5l1Fw9wJGbxBAfSjg3JFyGD1pkNCXdfk+47vMCyZyx3CLvsYZcldfTKrneeYtPVDgbZckWgY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820044466471.38947604682403; Tue, 1 Dec 2020 02:54:04 -0800 (PST) Received: from localhost ([::1]:52132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3IJ-0003ir-8T for importer@patchew.org; Tue, 01 Dec 2020 05:54:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30G-0002NW-MI for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:25 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57595) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk304-0003pt-OZ for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:23 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-447-AMG37k7NM7KFW4YgbGAxQA-1; Tue, 01 Dec 2020 05:35:09 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEEC58558EB; Tue, 1 Dec 2020 10:35:08 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 99A7310023B1; Tue, 1 Dec 2020 10:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818911; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eg1UCSP6TBFRjWh8o362r/gExEhG9FGt2zB8v+faRZc=; b=Kf1aGm+UkQC7Y+e2G9z6zA/JMiroctTRJbr5Zo8Qyzjjmar9OY0raq134aN7rxBRKfgSfi blSMpulH2af2wmdxDyE+zvyFvMpiDeq31drWuP6dBIRQMogCxo8Vw9pij430z4uQT7PVlw ZhZ3fpydDXx+AAQXZh9Em38hJrQDbLA= X-MC-Unique: AMG37k7NM7KFW4YgbGAxQA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 14/32] scripts: kernel-doc: add support for typedef enum Date: Tue, 1 Dec 2020 05:34:44 -0500 Message-Id: <20201201103502.4024573-15-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab 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 Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-14-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c4c5640ded..073f72c7da 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1295,14 +1295,22 @@ sub show_warnings($$) { sub dump_enum($$) { my $x =3D shift; my $file =3D shift; + my $members; + =20 $x =3D~ s@/\*.*?\*/@@gos; # strip comments. # strip #define macros inside enums $x =3D~ s@#\s*((define|ifdef)\s+|endif)[^;]*;@@gos; =20 - if ($x =3D~ /enum\s+(\w*)\s*\{(.*)\}/) { + if ($x =3D~ /typedef\s+enum\s*\{(.*)\}\s*(\w*)\s*;/) { + $declaration_name =3D $2; + $members =3D $1; + } elsif ($x =3D~ /enum\s+(\w*)\s*\{(.*)\}/) { $declaration_name =3D $1; - my $members =3D $2; + $members =3D $2; + } + + if ($declaration_name) { my %_members; =20 $members =3D~ s/\s+$//; @@ -1337,8 +1345,7 @@ sub dump_enum($$) { 'sections' =3D> \%sections, 'purpose' =3D> $declaration_purpose }); - } - else { + } else { print STDERR "${file}:$.: error: Cannot parse enum!\n"; ++$errors; } --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819933; cv=none; d=zohomail.com; s=zohoarc; b=GZTCkNiuJ6tu3LIW2KBCwdbglk1/sSItQjLztsuoKG6MzE5P7mlk/wsjjkM1yrjOKe2TpQyW8BZacWpgQTn3nMTOaUF+ECVYWdXPThCQlJu0kx/7l1Tqwk0BzYkk0gBMFcZuIgFR7ijtTI/Q1E9Ox18eSwGKzLWQSwgo1jClfgQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819933; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=eCs0riI9kHM//7BOaTOgwbI1V82e+fKC6hbIAxErEfY=; b=V61PGCYmhC13uB4BWYioldqWFZpxWVBdbT9btfhfM8s5JiM2GYy76JoJW2gzd+PF4UUfVYrDa6a78Rufl+HsCjjUC21dQXbthzfwD8p9dU7VKE6w9px0Ej36BGsq0T3Up2/mpqSFSWFnFJEFyIBXBr3JEiimbLyxxLAG7S2OOPs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160681993340813.02276569870969; Tue, 1 Dec 2020 02:52:13 -0800 (PST) Received: from localhost ([::1]:43652 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3GW-0000Ds-9O for importer@patchew.org; Tue, 01 Dec 2020 05:52:12 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:41954) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30A-0002Ms-Fa for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:20 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:33448) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk305-0003qq-9H for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:18 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-152-Pd7JQbKXPXSNAyfkHWVpfA-1; Tue, 01 Dec 2020 05:35:10 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 761A6393BB; Tue, 1 Dec 2020 10:35:09 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 18B611042A40; Tue, 1 Dec 2020 10:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eCs0riI9kHM//7BOaTOgwbI1V82e+fKC6hbIAxErEfY=; b=b6rbdNKIUqVU4ECv/Ok1lqG+wmhjbSOYQNbqsH7PovXE8Url/0Zg8/+THeHR+yXR6mY0f8 pOkFWjjBMV0cTrGQmDJafM+GcYlVbfHSOJFhfdi8aH/Y/0eL4qYiaUKZivzaZD7ujhqK1Y lXER24RCUz3t0JKZhfbZgd3y/RW4xjs= X-MC-Unique: Pd7JQbKXPXSNAyfkHWVpfA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 15/32] Revert "scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments" Date: Tue, 1 Dec 2020 05:34:45 -0500 Message-Id: <20201201103502.4024573-16-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 92bb29f9b2c3d4a98eef5f0db935d4be291eec72. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-15-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 073f72c7da..cb603532ed 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -860,23 +860,7 @@ sub output_function_rst(%) { output_highlight_rst($args{'purpose'}); $start =3D "\n\n**Syntax**\n\n ``"; } else { - if ((split(/\./, $sphinx_version))[0] >=3D 3) { - # Sphinx 3 and later distinguish macros and functions and - # complain if you use c:function with something that's not - # syntactically valid as a function declaration. - # We assume that anything with a return type is a function - # and anything without is a macro. - if ($args{'functiontype'} ne "") { - print ".. c:function:: "; - } else { - print ".. c:macro:: "; - } - } else { - # Older Sphinx don't support documenting macros that take - # arguments with c:macro, and don't complain about the use - # of c:function for this. - print ".. c:function:: "; - } + print ".. c:function:: "; } if ($args{'functiontype'} ne "") { $start .=3D $args{'functiontype'} . " " . $args{'function'} . " ("; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819276; cv=none; d=zohomail.com; s=zohoarc; b=PLwg3LZxhfOGr8cwiMYEybJvwT2PwLykigP3T9ShdzJqHYZOd/bWkvSRfGLGGwJUFj+9tG3fQMWwUAoWg27wStC9l1zHFaB4QJPaUCTgZL2mdyu0RR+4AtDA3Si/9jpRWcC1N4lEXMvvdFhEs7U4VlPAGFZUPc90qUUhDvMj3MA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819276; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2xQpkPILcilVjGBJAZDcOXL4fhbJFhBizJguZe8vEgc=; b=NwoRvSY86h6TGATNLhON5r/1+PVqWD3wc+EFkpXkeP+hgE8Nwsmun4t//D76JpMV/r5Kz44F1D7MLgPBvqHxpdrYGofj21zgZAB04KGCgGLvVhA77PV7rQuGFLbWP6gNOrW0gSP5GQpbzB6hSR+fSin/gjEpchKsGuAUQ5DvzPk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819276933274.53120829110514; Tue, 1 Dec 2020 02:41:16 -0800 (PST) Received: from localhost ([::1]:34508 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk35v-0001Rj-Oq for importer@patchew.org; Tue, 01 Dec 2020 05:41:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42040) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30I-0002Nx-KT for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53621) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk307-0003rC-BM for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:26 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-363-XWtjqS1aP4uY8ruSGwGWxw-1; Tue, 01 Dec 2020 05:35:10 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D7239805BE3; Tue, 1 Dec 2020 10:35:09 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 881CA1042A40; Tue, 1 Dec 2020 10:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2xQpkPILcilVjGBJAZDcOXL4fhbJFhBizJguZe8vEgc=; b=Qixs/2V3Hw5OB2xsOG2qRuyErV4tODMnfg/xp0jnfh+8TvoML7ySGIK/3s7pMZq2yy3ZWq 0Mzh/xNqfwjyqgt3UD+m6NgoHvJ3DF9yJ3ILGSfntt9DWoHK3NGDVskrRHytffHTWneyQJ T6R6XjFQUy6mUVEAYqaKR1rjTcHUopc= X-MC-Unique: XWtjqS1aP4uY8ruSGwGWxw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 16/32] Revert "kernel-doc: Use c:struct for Sphinx 3.0 and later" Date: Tue, 1 Dec 2020 05:34:46 -0500 Message-Id: <20201201103502.4024573-17-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 152d1967f650f67b7ece3a5dda77d48069d72647. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-16-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- docs/sphinx/kerneldoc.py | 1 - scripts/kernel-doc | 16 +--------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 9124fcbff1..c0180e02a2 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -102,7 +102,6 @@ class KernelDocDirective(Directive): env.note_dependency(os.path.abspath(f)) cmd +=3D ['-export-file', f] =20 - cmd +=3D ['-sphinx-version', sphinx.__version__] cmd +=3D [filename] =20 try: diff --git a/scripts/kernel-doc b/scripts/kernel-doc index cb603532ed..60f75cd176 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -71,8 +71,6 @@ Output selection (mutually exclusive): DOC: sections. May be specified multiple times. =20 Output selection modifiers: - -sphinx-version VER Generate rST syntax for the specified Sphinx versi= on. - Only works with reStructuredTextFormat. -no-doc-sections Do not output DOC: sections. -enable-lineno Enable output of #define LINENO lines. Only works = with reStructuredText format. @@ -294,7 +292,6 @@ use constant { }; my $output_selection =3D OUTPUT_ALL; my $show_not_found =3D 0; # No longer used -my $sphinx_version =3D "0.0"; # if not specified, assume old =20 my @export_file_list; =20 @@ -460,8 +457,6 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $enable_lineno =3D 1; } elsif ($cmd eq 'show-not-found') { $show_not_found =3D 1; # A no-op but don't fail - } elsif ($cmd eq 'sphinx-version') { - $sphinx_version =3D shift @ARGV; } else { # Unknown argument usage(); @@ -989,16 +984,7 @@ sub output_struct_rst(%) { my $oldprefix =3D $lineprefix; my $name =3D $args{'type'} . " " . $args{'struct'}; =20 - # Sphinx 3.0 and up will emit warnings for "c:type:: struct Foo". - # It wants to see "c:struct:: Foo" (and will add the word 'struct' in - # the rendered output). - if ((split(/\./, $sphinx_version))[0] >=3D 3) { - my $sname =3D $name; - $sname =3D~ s/^struct //; - print "\n\n.. c:struct:: " . $sname . "\n\n"; - } else { - print "\n\n.. c:type:: " . $name . "\n\n"; - } + print "\n\n.. c:type:: " . $name . "\n\n"; print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820389; cv=none; d=zohomail.com; s=zohoarc; b=SP7GEwao1o00gplWkd9nj2C+f14Ceux0DSZEn6Ufp0RV+NDFPuAAfzpzF6PUiFOWoWLVheZ6S5nuggdKKemiu/1nU7e7z8P4V0np0WtVD3tYlUbDk+zGsNpEYCioumTXlJLPAm8qn1JOv/VxuCk3K4lCEawHYQAixsBZyCWqOm0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820389; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YRIkoNqZeWXHR0EnZtaHGymS/XZpyIR+HCZcqdjuTu0=; b=Wn4NveBfDNybRrYxyJRfGBK1dt/K1tjrwNTAaVrYhob70QbvOMD4880YZED5gg5EOnp4sZKiH88xUJscgfzjqjqdTNZY2RJx3fclNcRJUS53WA+G9XmQbqKFdzWvX100X8h6A4GZt7up+eq8QJi0TXUz355/G+KV9UCAlEG6kJs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820389419704.3751635806999; Tue, 1 Dec 2020 02:59:49 -0800 (PST) Received: from localhost ([::1]:40278 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3Ns-0002Dy-BW for importer@patchew.org; Tue, 01 Dec 2020 05:59:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42096) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30N-0002U9-SO for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35096) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk308-0003rO-QO for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:31 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-172-wsjMW5P2OzWJ19SuNZLWig-1; Tue, 01 Dec 2020 05:35:11 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 51E2E8558E7; Tue, 1 Dec 2020 10:35:10 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 038DD1042A40; Tue, 1 Dec 2020 10:35:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YRIkoNqZeWXHR0EnZtaHGymS/XZpyIR+HCZcqdjuTu0=; b=bSK2pUyhUlFdsl7qjpBofp2AwnUQTiAn6LZPZn/EcjzpFvmNKyvbf+9csPliq22OeWeuLV DnGygIkzOpOej32MjORykqicLE6mPa4Phv3iR9srK2fM7g4KLfYychPA4OoxgQktA2YgK8 jBycid4BA98JOtY4l9dgrZ2/gh1RIvg= X-MC-Unique: wsjMW5P2OzWJ19SuNZLWig-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 17/32] scripts: kernel-doc: make it more compatible with Sphinx 3.x Date: Tue, 1 Dec 2020 05:34:47 -0500 Message-Id: <20201201103502.4024573-18-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab With Sphinx 3.x, the ".. c:type:" tag was changed to accept either: .. c:type:: typedef-like declaration .. c:type:: name Using it for other types (including functions) don't work anymore. So, there are newer tags for macro, enum, struct, union, and others, which doesn't exist on older versions. Add a check for the Sphinx version and change the produced tags accordingly. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-17-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 71 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 65 insertions(+), 6 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 60f75cd176..771367a6ab 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -271,6 +271,8 @@ if ($#ARGV =3D=3D -1) { } =20 my $kernelversion; +my $sphinx_major; + my $dohighlight =3D ""; =20 my $verbose =3D 0; @@ -465,6 +467,43 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { =20 # continue execution near EOF; =20 +# The C domain dialect changed on Sphinx 3. So, we need to check the +# version in order to produce the right tags. +sub findprog($) +{ + foreach(split(/:/, $ENV{PATH})) { + return "$_/$_[0]" if(-x "$_/$_[0]"); + } +} + +sub get_sphinx_version() +{ + my $ver; + my $major =3D 1; + + my $cmd =3D "sphinx-build"; + if (!findprog($cmd)) { + my $cmd =3D "sphinx-build3"; + return $major if (!findprog($cmd)); + } + + open IN, "$cmd --version 2>&1 |"; + while () { + if (m/^\s*sphinx-build\s+([\d]+)\.([\d\.]+)(\+\/[\da-f]+)?$/) { + $major=3D$1; + last; + } + # Sphinx 1.2.x uses a different format + if (m/^\s*Sphinx.*\s+([\d]+)\.([\d\.]+)$/) { + $major=3D$1; + last; + } + } + close IN; + + return $major; +} + # get kernel version from env sub get_kernel_version() { my $version =3D 'unknown kernel version'; @@ -848,7 +887,11 @@ sub output_function_rst(%) { my $start =3D ""; =20 if ($args{'typedef'}) { - print ".. c:type:: ". $args{'function'} . "\n\n"; + if ($sphinx_major < 3) { + print ".. c:type:: ". $args{'function'} . "\n\n"; + } else { + print ".. c:function:: ". $args{'function'} . "\n\n"; + } print_lineno($declaration_start_line); print " **Typedef**: "; $lineprefix =3D ""; @@ -938,9 +981,14 @@ sub output_enum_rst(%) { my ($parameter); my $oldprefix =3D $lineprefix; my $count; - my $name =3D "enum " . $args{'enum'}; =20 - print "\n\n.. c:type:: " . $name . "\n\n"; + if ($sphinx_major < 3) { + my $name =3D "enum " . $args{'enum'}; + print "\n\n.. c:type:: " . $name . "\n\n"; + } else { + my $name =3D $args{'enum'}; + print "\n\n.. c:enum:: " . $name . "\n\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); @@ -966,8 +1014,13 @@ sub output_typedef_rst(%) { my %args =3D %{$_[0]}; my ($parameter); my $oldprefix =3D $lineprefix; - my $name =3D "typedef " . $args{'typedef'}; + my $name; =20 + if ($sphinx_major < 3) { + $name =3D "typedef " . $args{'typedef'}; + } else { + $name =3D $args{'typedef'}; + } print "\n\n.. c:type:: " . $name . "\n\n"; print_lineno($declaration_start_line); $lineprefix =3D " "; @@ -982,9 +1035,14 @@ sub output_struct_rst(%) { my %args =3D %{$_[0]}; my ($parameter); my $oldprefix =3D $lineprefix; - my $name =3D $args{'type'} . " " . $args{'struct'}; =20 - print "\n\n.. c:type:: " . $name . "\n\n"; + if ($sphinx_major < 3) { + my $name =3D $args{'type'} . " " . $args{'struct'}; + print "\n\n.. c:type:: " . $name . "\n\n"; + } else { + my $name =3D $args{'struct'}; + print "\n\n.. c:struct:: " . $name . "\n\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); @@ -2242,6 +2300,7 @@ sub process_file($) { } =20 =20 +$sphinx_major =3D get_sphinx_version(); $kernelversion =3D get_kernel_version(); =20 # generate a sequence of code that will splice in highlighting information --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820181; cv=none; d=zohomail.com; s=zohoarc; b=Li0l2o7NhaMmyopqshx/8YqFcjPDOyuJcxef/91FHo2gIRupfnmQWu1Y3s6tT33f3lHUUj0/CLiCvgfIFPOGNFxSOxKyep2u3MdSxa71wKaS/eU3gG9Xg3oxHmLtzUt/RPvRaQjSSsbkzd7rjRLbIibhK11r6EhQToaQDtciRQ4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820181; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=e8hnoZGivgr313ZDbOqA0Nv2kwefhhsEAfF44TGY+aU=; b=EGivSV/3hnH2RJlX/nzL7gM2S8nq+ekvPnsQ/WMeOYPvwHy8zlyFKWKAmObQEVaE6h1Flj9mcSaKBSEhGpmq6LGBn7OC0lcJ/vNd5CKv1quFKzUe2d5XxMYRxrjY3PxL5/izg5AxX01N26JC9NIo8BTJ0POdctNC3ViG+QWfVNI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820181775245.19527625957232; Tue, 1 Dec 2020 02:56:21 -0800 (PST) Received: from localhost ([::1]:57304 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3KW-0005pp-Df for importer@patchew.org; Tue, 01 Dec 2020 05:56:20 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30V-0002eL-8F for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:53875) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30B-0003sA-TN for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:38 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-566-EiECavmrOSe02oylLQ3oMg-1; Tue, 01 Dec 2020 05:35:12 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C01D4190A7C5; Tue, 1 Dec 2020 10:35:10 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7206A1042A40; Tue, 1 Dec 2020 10:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e8hnoZGivgr313ZDbOqA0Nv2kwefhhsEAfF44TGY+aU=; b=GPIPmWLcAkyUdrmrrC5aWaO5TURHE+AxaZkaQGMeqv/x+RHsJruCy/LoAvjE6dLocXjFJp VeOwyBfPBxqLtezm13mzkHnF3biDnoDQ92zkuB8kNI34ntWrp3jRIm2QeLjNvkfun/HT2I TuZK//Lt7Hsjs2OLPBuvddwAS98Q018= X-MC-Unique: EiECavmrOSe02oylLQ3oMg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 18/32] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x Date: Tue, 1 Dec 2020 05:34:48 -0500 Message-Id: <20201201103502.4024573-19-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Unfortunately, Sphinx 3.x parser for c functions is too pedantic: https://github.com/sphinx-doc/sphinx/issues/8241 While it could be relaxed with some configurations, there are several corner cases that it would make it hard to maintain, and will require teaching conf.py about several macros. So, let's instead use the :c:macro notation. This will produce an output that it is not as nice as currently, but it should still be acceptable, and will provide cross-references, removing thousands of warnings when building with newer versions of Sphinx. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-18-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 771367a6ab..75ddd3b5e6 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -886,19 +886,29 @@ sub output_function_rst(%) { my $oldprefix =3D $lineprefix; my $start =3D ""; =20 - if ($args{'typedef'}) { - if ($sphinx_major < 3) { + if ($sphinx_major < 3) { + if ($args{'typedef'}) { print ".. c:type:: ". $args{'function'} . "\n\n"; + print_lineno($declaration_start_line); + print " **Typedef**: "; + $lineprefix =3D ""; + output_highlight_rst($args{'purpose'}); + $start =3D "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: ". $args{'function'} . "\n\n"; + print ".. c:function:: "; } - print_lineno($declaration_start_line); - print " **Typedef**: "; - $lineprefix =3D ""; - output_highlight_rst($args{'purpose'}); - $start =3D "\n\n**Syntax**\n\n ``"; } else { - print ".. c:function:: "; + print ".. c:macro:: ". $args{'function'} . "\n\n"; + + if ($args{'typedef'}) { + print_lineno($declaration_start_line); + print " **Typedef**: "; + $lineprefix =3D ""; + output_highlight_rst($args{'purpose'}); + $start =3D "\n\n**Syntax**\n\n ``"; + } else { + print "``"; + } } if ($args{'functiontype'} ne "") { $start .=3D $args{'functiontype'} . " " . $args{'function'} . " ("; @@ -925,7 +935,11 @@ sub output_function_rst(%) { if ($args{'typedef'}) { print ");``\n\n"; } else { - print ")\n\n"; + if ($sphinx_major < 3) { + print ")\n\n"; + } else { + print ")``\n"; + } print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819480; cv=none; d=zohomail.com; s=zohoarc; b=ECVdxCIfoEGpGmtePG67ZkVOMc7y/ygWbpo4qWn2Onh9YQXtMFyIZ9Rm0csWGunHm5osIybkPJI+Mps5U9wy9kavl4ZTUhWERxaE8l8Dmgy4bxhlOA/XvRhAlM9bM7DwaMJbAr1VP8jLgOD+j40HRVdVg5pCJ3edKE0JD1ikxdk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819480; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=aRud3jdLb9FJvuGehd6OGDqI+KIpo1xj4TsOlXShFvA=; b=m3M3t6AhYct4mugBhzkGe6voaby6T6AJw8s1OqL0CbPJIidzddv0AN6rsCm/SfS54JoTuWrqE1FSqY3OMW8tcM/zDI2JXuOh2yPT9XzCpak6Tk9wAAy51+D4fT50qi3J/lgyLBbiEia5m0lYOyng7Mx0HPBOWVaRwp7fMzbdvUY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819480619659.17127466206; Tue, 1 Dec 2020 02:44:40 -0800 (PST) Received: from localhost ([::1]:42916 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk39D-0004yk-9X for importer@patchew.org; Tue, 01 Dec 2020 05:44:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30K-0002OQ-Gv for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39131) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk307-0003rE-B0 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:26 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-437-u6MVV40EOeGoBwyQ4XHlXQ-1; Tue, 01 Dec 2020 05:35:12 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 426E6190A7C8; Tue, 1 Dec 2020 10:35:11 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id E062910023BC; Tue, 1 Dec 2020 10:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818914; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=aRud3jdLb9FJvuGehd6OGDqI+KIpo1xj4TsOlXShFvA=; b=QyMkqeZziCNtaIwoblMX8hSMC0n6g/Or4X/lqk+1Q6VulH00amFA/qRB2qU/ku2qZTNdl4 28QSoKX+Pi8zHO/1is07WcMYpi14ocnLRd6FsNBVbPdZ1rUe82zdb3P/aPb9wlY6gKPz5e ATFh8n1k69zIrmKp2857fWB8QWYD51w= X-MC-Unique: u6MVV40EOeGoBwyQ4XHlXQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 19/32] scripts: kernel-doc: fix troubles with line counts Date: Tue, 1 Dec 2020 05:34:49 -0500 Message-Id: <20201201103502.4024573-20-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There's currently a bug with the way kernel-doc script counts line numbers that can be seen with: $ ./scripts/kernel-doc -rst -enable-lineno include/linux/math64.h >all &&= ./scripts/kernel-doc -rst -internal -enable-lineno include/linux/math64.h = >int && diff -U0 int all --- int 2020-09-28 12:58:08.927486808 +0200 +++ all 2020-09-28 12:58:08.905486845 +0200 @@ -1 +1 @@ -#define LINENO 27 +#define LINENO 26 @@ -3 +3 @@ -#define LINENO 16 +#define LINENO 15 @@ -9 +9 @@ -#define LINENO 17 +#define LINENO 16 ... This is happening with perl version 5.30.3, but I'm not so sure if this is a perl bug, or if this is due to something else. In any case, fixing it is easy. Basically, when "-internal" parameter is used, the process_export_file() function opens the handle "IN". This makes the line number to be incremented, as the handler for the main open is also "IN". Fix the problem by using a different handler for the main open(). While here, add a missing close for it. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-19-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 75ddd3b5e6..f33a4b1cc7 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -2268,7 +2268,7 @@ sub process_file($) { =20 $file =3D map_filename($orig_file); =20 - if (!open(IN,"<$file")) { + if (!open(IN_FILE,"<$file")) { print STDERR "Error: Cannot open file $file\n"; ++$errors; return; @@ -2277,9 +2277,9 @@ sub process_file($) { $. =3D 1; =20 $section_counter =3D 0; - while () { + while () { while (s/\\\s*$//) { - $_ .=3D ; + $_ .=3D ; } # Replace tabs by spaces while ($_ =3D~ s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e) {}; @@ -2311,6 +2311,7 @@ sub process_file($) { print STDERR "${file}:1: warning: no structured comments found\n"; } } + close IN_FILE; } =20 =20 --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819616; cv=none; d=zohomail.com; s=zohoarc; b=ayGnD4dh3LGATRPRrGtRd2iUNKG+hflyWPE5rhYgvlkbt15f6JzWLlVOEvNrssM55n6POYdktcGtI3PRdtIh4vwu1RqXHxjrnI3KUYxY91Rt5fxxe0eIqG1kzDNdpoX10yjiB6zq5dhtyDt3UYJf+tLg9edcUo59EHmY8lYvECs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819616; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Wdy6f88n2LIny//0BmS54CtVFj89l1KsmAMFogQ24V4=; b=SPYZgRSp6z2H4VBKhNUkFDm3loWFVcsBJ9Bmko/VAvm/LhxjlKDXFeXGsHtFzjtLOi0RVGzzEx1e7WCTbfzT5j1vcLcqx1Ab7RoWlrwwicbbPYZcYVS+7Ii6QX8rHXnJJTGkDUZ5ZXIcYEpbji1pqR9puta9W4z94OPM8ynqaAE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819616433164.09892547514335; Tue, 1 Dec 2020 02:46:56 -0800 (PST) Received: from localhost ([::1]:52014 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3BO-0000Mk-Ah for importer@patchew.org; Tue, 01 Dec 2020 05:46:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42062) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30K-0002Ob-K9 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:48035) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk309-0003rT-2v for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:28 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-365-DLqle5uqOTmekhc6hGMDUw-1; Tue, 01 Dec 2020 05:35:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EFC67190A7A4; Tue, 1 Dec 2020 10:35:11 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id ABC8610023B0; Tue, 1 Dec 2020 10:35:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Wdy6f88n2LIny//0BmS54CtVFj89l1KsmAMFogQ24V4=; b=Klyi7VWbdhNJ1Kmfd40NDsjuzAhllLpIWIEXjQnHItLfmNTbSp8JCpgNve17YGccp5CSZ0 TdokbL8azigPPuPgGgauQ7CGtVf+ZYIbEPGj70tGlgcNbrtuk44ZYdb7STPWcndTAeN5mT BKTNcqRV/aNjZxR39V3IW4C88UZawnI= X-MC-Unique: DLqle5uqOTmekhc6hGMDUw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 20/32] scripts: kernel-doc: reimplement -nofunction argument Date: Tue, 1 Dec 2020 05:34:50 -0500 Message-Id: <20201201103502.4024573-21-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Right now, the build system doesn't use -nofunction, as it is pretty much useless, because it doesn't consider the other output modes (extern, internal), working only with all. Also, it is limited to exclude functions. Re-implement it in order to allow excluding any symbols from the document output, no matter what mode is used. The parameter was also renamed to "-nosymbol", as it express better its meaning. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-20-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index f33a4b1cc7..35d60af834 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -66,9 +66,8 @@ Output selection (mutually exclusive): -function NAME Only output documentation for the given function(s) or DOC: section title(s). All other functions and DOC: sections are ignored. May be specified multiple times. - -nofunction NAME Do NOT output documentation for the given function(s); - only output documentation for the other functions and - DOC: sections. May be specified multiple times. + -nosymbol NAME Exclude the specified symbols from the output + documentation. May be specified multiple times. =20 Output selection modifiers: -no-doc-sections Do not output DOC: sections. @@ -288,9 +287,8 @@ my $modulename =3D "Kernel API"; use constant { OUTPUT_ALL =3D> 0, # output all symbols and doc sections OUTPUT_INCLUDE =3D> 1, # output only specified symbols - OUTPUT_EXCLUDE =3D> 2, # output everything except specified symbo= ls - OUTPUT_EXPORTED =3D> 3, # output exported symbols - OUTPUT_INTERNAL =3D> 4, # output non-exported symbols + OUTPUT_EXPORTED =3D> 2, # output exported symbols + OUTPUT_INTERNAL =3D> 3, # output non-exported symbols }; my $output_selection =3D OUTPUT_ALL; my $show_not_found =3D 0; # No longer used @@ -315,6 +313,7 @@ my $man_date =3D ('January', 'February', 'March', 'Apri= l', 'May', 'June', # CAVEAT EMPTOR! Some of the others I localised may not want to be, which # could cause "use of undefined value" or other bugs. my ($function, %function_table, %parametertypes, $declaration_purpose); +my %nosymbol_table =3D (); my $declaration_start_line; my ($type, $declaration_name, $return_type); my ($newsection, $newcontents, $prototype, $brcount, %source_map); @@ -434,10 +433,9 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $output_selection =3D OUTPUT_INCLUDE; $function =3D shift @ARGV; $function_table{$function} =3D 1; - } elsif ($cmd eq "nofunction") { # output all except specific functions - $output_selection =3D OUTPUT_EXCLUDE; - $function =3D shift @ARGV; - $function_table{$function} =3D 1; + } elsif ($cmd eq "nosymbol") { # Exclude specific symbols + my $symbol =3D shift @ARGV; + $nosymbol_table{$symbol} =3D 1; } elsif ($cmd eq "export") { # only exported symbols $output_selection =3D OUTPUT_EXPORTED; %function_table =3D (); @@ -570,11 +568,11 @@ sub dump_doc_section { return; } =20 + return if (defined($nosymbol_table{$name})); + if (($output_selection =3D=3D OUTPUT_ALL) || - ($output_selection =3D=3D OUTPUT_INCLUDE && - defined($function_table{$name})) || - ($output_selection =3D=3D OUTPUT_EXCLUDE && - !defined($function_table{$name}))) + (($output_selection =3D=3D OUTPUT_INCLUDE) && + defined($function_table{$name}))) { dump_section($file, $name, $contents); output_blockhead({'sectionlist' =3D> \@sectionlist, @@ -800,6 +798,8 @@ sub output_blockhead_rst(%) { my ($parameter, $section); =20 foreach $section (@{$args{'sectionlist'}}) { + next if (defined($nosymbol_table{$section})); + if ($output_selection !=3D OUTPUT_INCLUDE) { print "**$section**\n\n"; } @@ -1115,12 +1115,14 @@ sub output_declaration { my $name =3D shift; my $functype =3D shift; my $func =3D "output_${functype}_$output_mode"; + + return if (defined($nosymbol_table{$name})); + if (($output_selection =3D=3D OUTPUT_ALL) || (($output_selection =3D=3D OUTPUT_INCLUDE || $output_selection =3D=3D OUTPUT_EXPORTED) && defined($function_table{$name})) || - (($output_selection =3D=3D OUTPUT_EXCLUDE || - $output_selection =3D=3D OUTPUT_INTERNAL) && + ($output_selection =3D=3D OUTPUT_INTERNAL && !($functype eq "function" && defined($function_table{$name})))) { &$func(@_); @@ -1301,6 +1303,8 @@ sub show_warnings($$) { my $functype =3D shift; my $name =3D shift; =20 + return 0 if (defined($nosymbol_table{$name})); + return 1 if ($output_selection =3D=3D OUTPUT_ALL); =20 if ($output_selection =3D=3D OUTPUT_EXPORTED) { @@ -1324,13 +1328,6 @@ sub show_warnings($$) { return 0; } } - if ($output_selection =3D=3D OUTPUT_EXCLUDE) { - if (!defined($function_table{$name})) { - return 1; - } else { - return 0; - } - } die("Please add the new output type at show_warnings()"); } =20 @@ -1952,6 +1949,7 @@ sub process_export_file($) { =20 while () { if (/$export_symbol/) { + next if (defined($nosymbol_table{$2})); $function_table{$2} =3D 1; } } --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819609; cv=none; d=zohomail.com; s=zohoarc; b=M6svmbPfQ8jGIr1TdyeZtIJd/L7XC44Mes7h5O5uSw9gFmghhuchHbyuMGBJH8i4hKEvFswZcqnhBfBYYwG/xrran9Lz2NKkXQKZUlu7ezKwa26Kl6t5Pq1pO4HqsvGw+01bEW9claclT0bLtoEOYXukucwvjMjcd+f8B3HW1GI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819609; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=VkXrc6iYkC+E7KRGBxIBJR/SSDGRT2IvzZaJy0Vyq68=; b=eNFJJ0YrqJTP2tiJpEOZSfaj38VHKd/2RVX8NcGBo47uylmGUZt/Bc5xy789icNFbTRsHaz5FRqBcVj7SnOl3renOIfaRrLuHjBvo4Nf5m415Zv0pD9UhZB3cSq0lH2Hf3EpnC0nUCBGP8qNy9ICbEXKEwlLWUm2ZSmaiJJeneE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160681960907282.76617576385797; Tue, 1 Dec 2020 02:46:49 -0800 (PST) Received: from localhost ([::1]:51378 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3BH-0008Vw-VS for importer@patchew.org; Tue, 01 Dec 2020 05:46:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42082) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30M-0002RY-TB for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:30 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk309-0003rQ-3A for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:30 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-385-Z9L2rRx9MxCSo5Koc8udjg-1; Tue, 01 Dec 2020 05:35:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5B23E805BE4; Tue, 1 Dec 2020 10:35:12 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1720710013C1; Tue, 1 Dec 2020 10:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818915; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VkXrc6iYkC+E7KRGBxIBJR/SSDGRT2IvzZaJy0Vyq68=; b=TK+2mWeqXfhqO96MN5myNM+SQTQryBpysXPNldC3IvnIFbqOH7APk+ZIxtt2k5LNn1UXqR TVo0MUZA1IOcRcWlgZKWxfy8fXzVFkW31A4d6YFe8zYUvZldPrcK35jYAsFBPzZ1hNe88i 5phWxpzXMcFWsXecEX7VNqjKg24CXv0= X-MC-Unique: Z9L2rRx9MxCSo5Koc8udjg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 21/32] scripts: kernel-doc: fix typedef identification Date: Tue, 1 Dec 2020 05:34:51 -0500 Message-Id: <20201201103502.4024573-22-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab 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 Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-21-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 64 +++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 23 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 35d60af834..0c31e9ad66 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1748,30 +1748,48 @@ sub dump_function($$) { return; } =20 - my $prms =3D 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_typ= e); - } + my $prms =3D 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); + } =20 - output_declaration($declaration_name, - 'function', - {'function' =3D> $declaration_name, - 'module' =3D> $modulename, - 'functiontype' =3D> $return_type, - 'parameterlist' =3D> \@parameterlist, - 'parameterdescs' =3D> \%parameterdescs, - 'parametertypes' =3D> \%parametertypes, - 'sectionlist' =3D> \@sectionlist, - 'sections' =3D> \%sections, - 'purpose' =3D> $declaration_purpose - }); + # The function parser can be called with a typedef parameter. + # Handle it. + if ($return_type =3D~ /typedef/) { + output_declaration($declaration_name, + 'function', + {'function' =3D> $declaration_name, + 'typedef' =3D> 1, + 'module' =3D> $modulename, + 'functiontype' =3D> $return_type, + 'parameterlist' =3D> \@parameterlist, + 'parameterdescs' =3D> \%parameterdescs, + 'parametertypes' =3D> \%parametertypes, + 'sectionlist' =3D> \@sectionlist, + 'sections' =3D> \%sections, + 'purpose' =3D> $declaration_purpose + }); + } else { + output_declaration($declaration_name, + 'function', + {'function' =3D> $declaration_name, + 'module' =3D> $modulename, + 'functiontype' =3D> $return_type, + 'parameterlist' =3D> \@parameterlist, + 'parameterdescs' =3D> \%parameterdescs, + 'parametertypes' =3D> \%parametertypes, + 'sectionlist' =3D> \@sectionlist, + 'sections' =3D> \%sections, + 'purpose' =3D> $declaration_purpose + }); + } } =20 sub reset_state { --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819729; cv=none; d=zohomail.com; s=zohoarc; b=YXflHuOEZEZOyiRTe8Z5KSMhX59DtKfY5NHWZsw07RlUQhaI73pyzgqUlV7jPsz3eQuOfDjvEk5lv1n9M9OOPsAeRtOA8Y5hX+vcyaPXXO05a+tsHaGmbDbaAlqNfDSp7951rHxa5W8yiQW3gbl9avLvCloqWzCc3S7es1Vz/HU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819729; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=2Hqr6mt+EekxiJYbciaRspwkwPYDs2CfXQtqWsJjinE=; b=VFLs6Rgz2SD+WIrT20uQr4xo+mCIvtNZ5Z9jU/HoJK+DtFXEaiVqDVWF9+rlguRvHq+CFVRRygtAOBCFK0NKKWX53V77iu7v6gWPKaT26xQ9olVnCaqnSIOtTO/KvbBFexhdKZ8OOPTzmdQlQ48rcXvwkj7/BHHyCJ8w60yyIQk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819729912499.375233872373; Tue, 1 Dec 2020 02:48:49 -0800 (PST) Received: from localhost ([::1]:60428 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3DD-0003mG-2R for importer@patchew.org; Tue, 01 Dec 2020 05:48:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42088) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30N-0002Sz-Eq for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:24824) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30A-0003ry-AS for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:31 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-374-A36McOgwMBuvZKBPdQ4QcQ-1; Tue, 01 Dec 2020 05:35:13 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id BBE50100C60B; Tue, 1 Dec 2020 10:35:12 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76B7110023B1; Tue, 1 Dec 2020 10:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2Hqr6mt+EekxiJYbciaRspwkwPYDs2CfXQtqWsJjinE=; b=AZ2CzvzAd2iaMwpa6njr1oun898kNHgVETFneV0HCG8X5jzrL7K6fyJhoyHZ3XqIzr2UGF Dlv/sXu5Jm+ckIBVBV3YcdgwiXt4ZVsOoGrIHqp1IyDQTd2l2TUUVapnwOPG4kl3Fg/I/w C7iKJTnIGz5wsFCglbMHR3J9jL3Grxs= X-MC-Unique: A36McOgwMBuvZKBPdQ4QcQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 22/32] scripts: kernel-doc: don't mangle with parameter list Date: Tue, 1 Dec 2020 05:34:52 -0500 Message-Id: <20201201103502.4024573-23-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab While kernel-doc needs to parse parameters in order to identify its name, it shouldn't be touching the type, as parsing it is very difficult, and errors happen. One current error is when parsing this parameter: const u32 (*tab)[256] Found at ./lib/crc32.c, on this function: u32 __pure crc32_be_generic (u32 crc, unsigned char const *p, size_t len, = const u32 (*tab)[256], u32 polynomial); The current logic mangles it, producing this output: const u32 ( *tab That's something that it is not recognizeable. So, instead, let's push the argument as-is, and use it when printing the function prototype and when describing each argument. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-22-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0c31e9ad66..478037f736 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -655,10 +655,10 @@ sub output_function_man(%) { $type =3D $args{'parametertypes'}{$parameter}; if ($type =3D~ m/([^\(]*\(\*)\s*\)\s*\(([^\)]*)\)/) { # pointer-to-function - print ".BI \"" . $parenth . $1 . "\" " . $parameter . " \") (" . $2 .= ")" . $post . "\"\n"; + print ".BI \"" . $parenth . $1 . "\" " . " \") (" . $2 . ")" . $post = . "\"\n"; } else { $type =3D~ s/([^\*])$/$1 /; - print ".BI \"" . $parenth . $type . "\" " . $parameter . " \"" . $pos= t . "\"\n"; + print ".BI \"" . $parenth . $type . "\" " . " \"" . $post . "\"\n"; } $count++; $parenth =3D ""; @@ -929,7 +929,7 @@ sub output_function_rst(%) { # pointer-to-function print $1 . $parameter . ") (" . $2 . ")"; } else { - print $type . " " . $parameter; + print $type; } } if ($args{'typedef'}) { @@ -954,7 +954,7 @@ sub output_function_rst(%) { $type =3D $args{'parametertypes'}{$parameter}; =20 if ($type ne "") { - print "``$type $parameter``\n"; + print "``$type``\n"; } else { print "``$parameter``\n"; } @@ -1479,7 +1479,7 @@ sub create_parameterlist($$$$) { # Treat preprocessor directive as a typeless variable just to fill # corresponding data structures "correctly". Catch it later in # output_* subs. - push_parameter($arg, "", $file); + push_parameter($arg, "", "", $file); } elsif ($arg =3D~ m/\(.+\)\s*\(/) { # pointer-to-function $arg =3D~ tr/#/,/; @@ -1488,7 +1488,7 @@ sub create_parameterlist($$$$) { $type =3D $arg; $type =3D~ s/([^\(]+\(\*?)\s*$param/$1/; save_struct_actual($param); - push_parameter($param, $type, $file, $declaration_name); + push_parameter($param, $type, $arg, $file, $declaration_name); } elsif ($arg) { $arg =3D~ s/\s*:\s*/:/g; $arg =3D~ s/\s*\[/\[/g; @@ -1513,26 +1513,28 @@ sub create_parameterlist($$$$) { foreach $param (@args) { if ($param =3D~ m/^(\*+)\s*(.*)/) { save_struct_actual($2); - push_parameter($2, "$type $1", $file, $declaration_name); + + push_parameter($2, "$type $1", $arg, $file, $declaration_name); } elsif ($param =3D~ m/(.*?):(\d+)/) { if ($type ne "") { # skip unnamed bit-fields save_struct_actual($1); - push_parameter($1, "$type:$2", $file, $declaration_name) + push_parameter($1, "$type:$2", $arg, $file, $declaration_name) } } else { save_struct_actual($param); - push_parameter($param, $type, $file, $declaration_name); + push_parameter($param, $type, $arg, $file, $declaration_name); } } } } } =20 -sub push_parameter($$$$) { +sub push_parameter($$$$$) { my $param =3D shift; my $type =3D shift; + my $org_arg =3D shift; my $file =3D shift; my $declaration_name =3D shift; =20 @@ -1596,8 +1598,8 @@ sub push_parameter($$$$) { # "[blah" in a parameter string; ###$param =3D~ s/\s*//g; push @parameterlist, $param; - $type =3D~ s/\s\s+/ /g; - $parametertypes{$param} =3D $type; + $org_arg =3D~ s/\s\s+/ /g; + $parametertypes{$param} =3D $org_arg; } =20 sub check_sections($$$$$) { --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819897; cv=none; d=zohomail.com; s=zohoarc; b=G4LDqJk/ART9N5YqhMmRyn/JzxZKkQLD0cVFEp/R7SM+cB17zC7RegSex3HXGVnMMS9PwqxgBXrz+uUcAe8gOlpgrT6oDWcWNOq9ku1LiCBreNPcO+HFWMXQhloEFtunWpTCXrvHJrSF5ThowfGU7W1zidQenjgha7f5CRgBbfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819897; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Ukg5Y1cAgqxZBGLArhGZ7RHHMiikRdI3w0My8dsythw=; b=GF9x8Qp22RKz+UMVNlpfvWmBuWJJMaSUgSJzWzyvVAKSuFqJRShRRFtu7jFu8ff6Zqva8tio0hjkRxJy2tJ07ogmQuvTCaLFLAR7csXK6S2m57gv1REVDC3Nm1o9qI2wFggDF5Q6b3VZwRoTMd/ZsFyCQN0wkOhYq0TPjN18mRY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819897555939.2942364286919; Tue, 1 Dec 2020 02:51:37 -0800 (PST) Received: from localhost ([::1]:40178 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3Fw-0007DQ-AQ for importer@patchew.org; Tue, 01 Dec 2020 05:51:36 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42146) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30P-0002Xh-6U for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:36 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31107) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30A-0003s7-Kb for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:32 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-388-m3Z1G1MhMLii7fFJSF5aHQ-1; Tue, 01 Dec 2020 05:35:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 29BB38558E2; Tue, 1 Dec 2020 10:35:13 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id D72B410013C1; Tue, 1 Dec 2020 10:35:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ukg5Y1cAgqxZBGLArhGZ7RHHMiikRdI3w0My8dsythw=; b=Sh3P5C7nn8iUMR046hjOd05RM4gELkDUIc/0tW9m1bLUXsYq0+OQFR43QE04QLVZcyum9u Cvy4b4AUxTE0q9oR3afxu6mj1yZzaAKwJBXzSK9BN02XQ3Wm0G8ncBzu+w0qY3T9vmwHic PytizHEAnQiWAZdYSqcKpmi2pv2vWyk= X-MC-Unique: m3Z1G1MhMLii7fFJSF5aHQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 23/32] scripts: kernel-doc: allow passing desired Sphinx C domain dialect Date: Tue, 1 Dec 2020 05:34:53 -0500 Message-Id: <20201201103502.4024573-24-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab When kernel-doc is called via kerneldoc.py, there's no need to auto-detect the Sphinx version, as the Sphinx module already knows it. So, add an optional parameter to allow changing the Sphinx dialect. As kernel-doc can also be manually called, keep the auto-detection logic if the parameter was not specified. On such case, emit a warning if sphinx-build can't be found at PATH. I ended using a suggestion from Joe for using a more readable regex, instead of using a complex one with a hidden group like: m/^(\d+)\.(\d+)(?:\.?(\d+)?)/ in order to get the optional argument. Thanks-to: Joe Perches Suggested-by: Jonathan Corbet Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-23-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- docs/sphinx/kerneldoc.py | 5 ++++ scripts/kernel-doc | 51 +++++++++++++++++++++++++++++++++------- 2 files changed, 48 insertions(+), 8 deletions(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index c0180e02a2..079aadced3 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -69,6 +69,11 @@ class KernelDocDirective(Directive): env =3D self.state.document.settings.env cmd =3D env.config.kerneldoc_bin + ['-rst', '-enable-lineno'] =20 + # Pass the version string to kernel-doc, as it needs to use a diff= erent + # dialect, depending what the C domain supports for each specific + # Sphinx versions + cmd +=3D ['-sphinx-version', sphinx.__version__] + filename =3D env.config.kerneldoc_srctree + '/' + self.arguments[0] export_file_patterns =3D [] =20 diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 478037f736..667ad3169c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -56,6 +56,13 @@ Output format selection (mutually exclusive): -rst Output reStructuredText format. -none Do not output documentation, only warnings. =20 +Output format selection modifier (affects only ReST output): + + -sphinx-version Use the ReST C domain dialect compatible with an + specific Sphinx Version. + If not specified, kernel-doc will auto-detect using + the sphinx-build version found on PATH. + Output selection (mutually exclusive): -export Only output documentation for symbols that have been exported using EXPORT_SYMBOL() or EXPORT_SYMBOL_GPL() @@ -270,7 +277,7 @@ if ($#ARGV =3D=3D -1) { } =20 my $kernelversion; -my $sphinx_major; +my ($sphinx_major, $sphinx_minor, $sphinx_patch); =20 my $dohighlight =3D ""; =20 @@ -457,6 +464,23 @@ while ($ARGV[0] =3D~ m/^--?(.*)/) { $enable_lineno =3D 1; } elsif ($cmd eq 'show-not-found') { $show_not_found =3D 1; # A no-op but don't fail + } elsif ($cmd eq "sphinx-version") { + my $ver_string =3D shift @ARGV; + if ($ver_string =3D~ m/^(\d+)(\.\d+)?(\.\d+)?/) { + $sphinx_major =3D $1; + if (defined($2)) { + $sphinx_minor =3D substr($2,1); + } else { + $sphinx_minor =3D 0; + } + if (defined($3)) { + $sphinx_patch =3D substr($3,1) + } else { + $sphinx_patch =3D 0; + } + } else { + die "Sphinx version should either major.minor or major.minor.patch fo= rmat\n"; + } } else { # Unknown argument usage(); @@ -477,29 +501,37 @@ sub findprog($) sub get_sphinx_version() { my $ver; - my $major =3D 1; =20 my $cmd =3D "sphinx-build"; if (!findprog($cmd)) { my $cmd =3D "sphinx-build3"; - return $major if (!findprog($cmd)); + if (!findprog($cmd)) { + $sphinx_major =3D 1; + $sphinx_minor =3D 2; + $sphinx_patch =3D 0; + printf STDERR "Warning: Sphinx version not found. Using default (Sphinx= version %d.%d.%d)\n", + $sphinx_major, $sphinx_minor, $sphinx_patch; + return; + } } =20 open IN, "$cmd --version 2>&1 |"; while () { if (m/^\s*sphinx-build\s+([\d]+)\.([\d\.]+)(\+\/[\da-f]+)?$/) { - $major=3D$1; + $sphinx_major =3D $1; + $sphinx_minor =3D $2; + $sphinx_patch =3D $3; last; } # Sphinx 1.2.x uses a different format if (m/^\s*Sphinx.*\s+([\d]+)\.([\d\.]+)$/) { - $major=3D$1; + $sphinx_major =3D $1; + $sphinx_minor =3D $2; + $sphinx_patch =3D $3; last; } } close IN; - - return $major; } =20 # get kernel version from env @@ -2333,7 +2365,10 @@ sub process_file($) { } =20 =20 -$sphinx_major =3D get_sphinx_version(); +if ($output_mode eq "rst") { + get_sphinx_version() if (!$sphinx_major); +} + $kernelversion =3D get_kernel_version(); =20 # generate a sequence of code that will splice in highlighting information --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819720; cv=none; d=zohomail.com; s=zohoarc; b=UXDTo1aSJ3PojqM1BydXbhsSASk9Ic+yL9iLNHsgvMEaUGr2yTXL+586Xf0E5wl+3btheAgWLceqVjUZRVTIvD4R3s3zF4yg6zNyv6bX8opvZgVbrodjzWnc2NKYbWyGoRRXRyBNOJqZPQ/DCFmoY4VElQ0PE2rLJPAuAdGpijQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819720; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iUR8QomuX/Blkx1DYOhTiUT7FwKK7aUab2JpYXJFiRg=; b=CBaLWjJqQmNNp6V0vogVQZGjLlZxBBcJHFIwsDta27k745BRcTlsM+9PIkUpj8NKS7tN0WC7xRkuR8nfeB/JsnV8ySfLWonPwJljeZxRXuGdLjY3PT+VC1BUQAWDkd2NUFoaBhmYbhve1C98oSlilrXW8mP78vAD+P6UkbKEEsc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16068197209581013.5659527862123; Tue, 1 Dec 2020 02:48:40 -0800 (PST) Received: from localhost ([::1]:59960 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3D5-0003aY-RN for importer@patchew.org; Tue, 01 Dec 2020 05:48:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42126) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30O-0002W3-Is for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:59079) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk309-0003rg-8l for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:32 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-197-_yxM6Qs8OJiTnM1FuQ02Lw-1; Tue, 01 Dec 2020 05:35:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 89D0C190A7A6; Tue, 1 Dec 2020 10:35:13 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 44A3410013C1; Tue, 1 Dec 2020 10:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818916; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iUR8QomuX/Blkx1DYOhTiUT7FwKK7aUab2JpYXJFiRg=; b=EcGFfThh57p2BJ1Fb6ZdsVbSk2YcKfwJFrcrVSsCztBF5nOq1+lw/EOPkdguS+vplL4Z4S /eg6/KVl6l2BciP7MQhlpcVgn9Qzhre0g6RrB39Pddqic1fIBXGvxtG4zmLJx1qym2LAOE JOyi6tSVznj9dg5auJoPZwe9zq1hIGU= X-MC-Unique: _yxM6Qs8OJiTnM1FuQ02Lw-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 24/32] scripts: kernel-doc: fix line number handling Date: Tue, 1 Dec 2020 05:34:54 -0500 Message-Id: <20201201103502.4024573-25-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Address several issues related to pointing to the wrong line number: 1) ensure that line numbers will always be initialized When section is the default (Description), the line number is not initializing, producing this: $ ./scripts/kernel-doc --enable-lineno ./drivers/media/v4l2-core/v4l2-mem2= mem.c|less **Description** #define LINENO 0 In case of streamoff or release called on any context, 1] If the context is currently running, then abort job will be called 2] If the context is queued, then the context will be removed from the job_queue Which is not right. Ensure that the line number will always be there. After applied, the result now points to the right location: **Description** #define LINENO 410 In case of streamoff or release called on any context, 1] If the context is currently running, then abort job will be called 2] If the context is queued, then the context will be removed from the job_queue 2) The line numbers for function prototypes are always + 1, because it is taken at the line after handling the prototype. Change the logic to point to the next line after the /** */ block; 3) The "DOC:" line number should point to the same line as this markup is found, and not to the next one. Probably part of the issues were due to a but that was causing the line number offset to be incremented by one, if --export were used. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-24-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 667ad3169c..98752164eb 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1705,7 +1705,7 @@ sub dump_function($$) { my $file =3D shift; my $noret =3D 0; =20 - print_lineno($.); + print_lineno($new_start_line); =20 $prototype =3D~ s/^static +//; $prototype =3D~ s/^extern +//; @@ -2033,7 +2033,7 @@ sub process_name($$) { if (/$doc_block/o) { $state =3D STATE_DOCBLOCK; $contents =3D ""; - $new_start_line =3D $. + 1; + $new_start_line =3D $.; =20 if ( $1 eq "" ) { $section =3D $section_intro; @@ -2116,6 +2116,7 @@ sub process_body($$) { if ($state =3D=3D STATE_BODY_WITH_BLANK_LINE && /^\s*\*\s?\S/) { dump_section($file, $section, $contents); $section =3D $section_default; + $new_start_line =3D $.; $contents =3D ""; } =20 @@ -2171,6 +2172,7 @@ sub process_body($$) { $prototype =3D ""; $state =3D STATE_PROTO; $brcount =3D 0; + $new_start_line =3D $. + 1; } elsif (/$doc_content/) { if ($1 eq "") { if ($section eq $section_context) { --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819903; cv=none; d=zohomail.com; s=zohoarc; b=mo2nEHKhP6gsvnXj0bvSvOfRcfTHthT1ZVkAH1FzNX6nAQgInL1qUhkvnZy8uBY6WcJXLLNq15OKnG+9z38HqF2a9vN27LVyiZ2a1ff51UZWeW0LBbDTjTFIbXBcpBeLLV02qq7JStJPqchz9t3RER+Mqh+WLFXHWOZ3m/wzl1c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819903; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=NKqe7y+mXgOFikYR5IZB9Gho5DKqxTtHmA1FFYL0kT8=; b=n78w9g1CwLUeCAOuNKD+Pde6PK7L8QKepASA7uBhD61DdVdrLlB0XE89ZbMy9vY3bIN95fhsTBYv9vt3vMHat3gVyDJfziH+j37HowbCNceNb0M0tXlfCkb0AT+nhMc3hCYNFb1AJ44PmWbtHqBchN83htG8CfBD6u1uH06tYIc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819903157938.6771743109214; Tue, 1 Dec 2020 02:51:43 -0800 (PST) Received: from localhost ([::1]:40764 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3G1-0007SP-WA for importer@patchew.org; Tue, 01 Dec 2020 05:51:42 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30O-0002WB-KR for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:32 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:29102) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30A-0003s4-J6 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:32 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-22-Hs3d4uOWOj6SapFAE6a55g-1; Tue, 01 Dec 2020 05:35:14 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E9C77105208F; Tue, 1 Dec 2020 10:35:13 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id A512010013C1; Tue, 1 Dec 2020 10:35:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NKqe7y+mXgOFikYR5IZB9Gho5DKqxTtHmA1FFYL0kT8=; b=iLN8ssxMpPwz2LDgQX2w2sgMo9odWn+/h8DcbIX3o7+ikW6OVYCODxuNmWYUds2spF7IWd PPitv10fqGDrNhbV3bLBFEwzYk9rlPKUwggPrsqR2P4b4q1iCLX/WsSDIjeJzlLkAPDpsZ FATaawRzPPUKeonvHslZFkouyvb+Myg= X-MC-Unique: Hs3d4uOWOj6SapFAE6a55g-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 25/32] scripts: kernel-doc: try to use c:function if possible Date: Tue, 1 Dec 2020 05:34:55 -0500 Message-Id: <20201201103502.4024573-26-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab There are a few namespace clashes by using c:macro everywhere: basically, when using it, we can't have something like: .. c:struct:: pwm_capture .. c:macro:: pwm_capture So, we need to use, instead: .. c:function:: int pwm_capture (struct pwm_device * pwm, struct pwm_captu= re * result, unsigned long timeout) for the function declaration. The kernel-doc change was proposed by Jakob Lykke Andersen here: https://github.com/jakobandersen/linux_docs/commit/6fd2076ec001cca74668574= 93cd678df4dfe4a65 Although I did a different implementation. Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-25-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 98752164eb..2d56c46933 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -917,6 +917,7 @@ sub output_function_rst(%) { my ($parameter, $section); my $oldprefix =3D $lineprefix; my $start =3D ""; + my $is_macro =3D 0; =20 if ($sphinx_major < 3) { if ($args{'typedef'}) { @@ -926,11 +927,17 @@ sub output_function_rst(%) { $lineprefix =3D ""; output_highlight_rst($args{'purpose'}); $start =3D "\n\n**Syntax**\n\n ``"; + $is_macro =3D 1; } else { print ".. c:function:: "; } } else { - print ".. c:macro:: ". $args{'function'} . "\n\n"; + if ($args{'typedef'} || $args{'functiontype'} eq "") { + $is_macro =3D 1; + print ".. c:macro:: ". $args{'function'} . "\n\n"; + } else { + print ".. c:function:: "; + } =20 if ($args{'typedef'}) { print_lineno($declaration_start_line); @@ -939,7 +946,7 @@ sub output_function_rst(%) { output_highlight_rst($args{'purpose'}); $start =3D "\n\n**Syntax**\n\n ``"; } else { - print "``"; + print "``" if ($is_macro); } } if ($args{'functiontype'} ne "") { @@ -964,14 +971,12 @@ sub output_function_rst(%) { print $type; } } - if ($args{'typedef'}) { - print ");``\n\n"; + if ($is_macro) { + print ")``\n\n"; } else { - if ($sphinx_major < 3) { - print ")\n\n"; - } else { - print ")``\n"; - } + print ")\n\n"; + } + if (!$args{'typedef'}) { print_lineno($declaration_start_line); $lineprefix =3D " "; output_highlight_rst($args{'purpose'}); --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819654; cv=none; d=zohomail.com; s=zohoarc; b=P+7xuZd9LoyzfDsKilTuzNsUS3gIsjW9/MicK/ZYJ8+OjmuldE2/lTlfa9WgYjkv5mRDFs8ZEO0dN8d7UzJqrHmT/PHCmVLDwpcU983MmDm3w8g0xSLRaai87UPGaNIcAL23ePGqkyqBBAZGNgiiIkmffBhzXrutmL4nkEQaT/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819654; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=RhwMeLb8WEPNPD1HkbeUC+TAOzuLzw7E47zkdkxByCk=; b=AEHkrv1og5lRgOFjLHuwARgQAafsadYcjsNcGrPCitx82sKuCO/oDRuerUG2bMVe8+0VCemJDz9lbuOAvYZntWpnHQgFRravdKmTGSsUWAgVfqCbApsQ3hqT+nkH1AdoI+YRagChTnJBG96rqudaw30QUoOV5BuzKXJZt1rxd9Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819654314140.8725427047724; Tue, 1 Dec 2020 02:47:34 -0800 (PST) Received: from localhost ([::1]:54790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3C1-0001Vk-3l for importer@patchew.org; Tue, 01 Dec 2020 05:47:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42090) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30N-0002TA-FB for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:31 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44184) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30A-0003rs-2R for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:31 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-104-Pi20ht-qMIODpkZ6jgKKnQ-1; Tue, 01 Dec 2020 05:35:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 55841425CB; Tue, 1 Dec 2020 10:35:14 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1076B10013C1; Tue, 1 Dec 2020 10:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818917; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RhwMeLb8WEPNPD1HkbeUC+TAOzuLzw7E47zkdkxByCk=; b=gp4qg3g79+UeDFcRb6O02q4/hdyrKVLqtn0SP9nmvOFKTGPxx2PYHV749IU5JcPZlz3SK0 Una6yhvlTJsHmZIwvlimMEPmK0HXIF7OWBJ0+w7HovLe3GhW1fc+I8KxB5DfQFfP60v8rd s3BBKG1WmrrreG6RtOYPCqNBhip6EmI= X-MC-Unique: Pi20ht-qMIODpkZ6jgKKnQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 26/32] Revert "kernel-doc: Handle function typedefs without asterisks" Date: Tue, 1 Dec 2020 05:34:56 -0500 Message-Id: <20201201103502.4024573-27-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 3cd3c5193cde5242e243c25759f85802e267994f. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-26-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2d56c46933..780aee4e92 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1434,7 +1434,7 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*?\s*(\w\S+)\s*\)\s*\((.*)\);/= || + if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ = || $x =3D~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820000; cv=none; d=zohomail.com; s=zohoarc; b=AywM95m9ptllbRBV2oQaiqus6wFdsVOeso/nN81syiqUHEHs7BXxeGLLUTYkmu9jksN6DR+1LWqxxBJipFyKha2XnETFZEPfd3i/by7NoSJTEnsd0dzT07ghHEF1YkX6KCQsC7vWYWu+N7mRqtFVeWE7qoOUHyx5i5QhktGo/2s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820000; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=GiAsebyEgUN6g6nMYa5Mkh5gItth4ZEtNuU0Vbs8Oe4=; b=idrrpoA2N4VRzTBkO6IODwqCFIU2YYb5XKrosAzh3kahJYIt6ZHNzrYpCozKt6H3GG0Aq8jlWtprwEiwaGvkloyHXUO7AursJpgdKWJyrIlaqJuien1sKviFzaaZ4gDU8c4BVPjeaTMCkl+0u/rsdn/lu8wxKJr3C5tYzzcw6us= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820000832971.6204895048013; Tue, 1 Dec 2020 02:53:20 -0800 (PST) Received: from localhost ([::1]:49132 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3Hb-0002U9-GF for importer@patchew.org; Tue, 01 Dec 2020 05:53:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42186) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30U-0002b2-2o for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:38 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:54109) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30G-0003sP-Gv for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:37 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-496-UxIr1tF1Pm2NoncK_ZwU-A-1; Tue, 01 Dec 2020 05:35:15 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B5308805BE4; Tue, 1 Dec 2020 10:35:14 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7063F10023B0; Tue, 1 Dec 2020 10:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GiAsebyEgUN6g6nMYa5Mkh5gItth4ZEtNuU0Vbs8Oe4=; b=eRquAdrT/Ef6/e+GRJUwk3dpoTLpIjPHOg7ReE1Kw1sAXSgZcNoc7cVVsz6b6yUIGzO83H /PSCtClMgR+hoG0jNEqnc0WPX//UeyB4LlcTCwLMkzWcV29xcBFdIH9xpSeD2vc5Mt29nt /oVP0/RKCrI3QyPkz16ODe8Mb+ULAzg= X-MC-Unique: UxIr1tF1Pm2NoncK_ZwU-A-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 27/32] Revert "kernel-doc: Handle function typedefs that return pointers" Date: Tue, 1 Dec 2020 05:34:57 -0500 Message-Id: <20201201103502.4024573-28-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit 19ab6044be0c55d529e875e3ee16fdd5c3b54d33. We will replace the commit with the fix from Linux. Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-27-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 780aee4e92..d3a289628c 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1434,8 +1434,8 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+\s*\**)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ = || - $x =3D~ /typedef\s+(\w+\s*\**)\s*(\w\S+)\s*\s*\((.*)\);/) { + if ($x =3D~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ || + $x =3D~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs $return_type =3D $1; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819996; cv=none; d=zohomail.com; s=zohoarc; b=atwoZKFlYla5IkK7XI6I1ML9XIyu+8h7fKncqOJ/nYcbIYpmwGbbohN17QZgCDUBLhZWVuGurOFpmkKFjEGS63o4yfa6Z+RU594h5lj/bymrAyw21ExH8c5z9fJvJNlGo4P8rp0Fcke99n23vJG/4cz+elJd8eQxMk4ZxEEM9LM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819996; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=9FsWZNmQMTzP45CGKAZDRB7a8dvrSmV62DmBnscUAZg=; b=GGw5NWo2lVnEZIxUBqLyIFRs4rvuEy/NQ4xsNj7AtAygRzcF9tzHBlWgWyDtR4jeAj6/WFupU91mYhNZeeHInQ2lsCZ+SXms08WWs38t2eaHbMIpzxQr3Tw87KqRx7xB+xbccgmqhjzYtLmmfuXULbI0wISaWDhgCv/qUSGd8Nk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606819996390218.04039488043486; Tue, 1 Dec 2020 02:53:16 -0800 (PST) Received: from localhost ([::1]:48766 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3HX-0002L9-8q for importer@patchew.org; Tue, 01 Dec 2020 05:53:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30T-0002Yl-7W for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:32205) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30A-0003sD-Vn for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:36 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-511-MTPvBqRaP9GrgmKIRd-VxA-1; Tue, 01 Dec 2020 05:35:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 240FB8558E9; Tue, 1 Dec 2020 10:35:15 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id D192B10013C1; Tue, 1 Dec 2020 10:35:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=9FsWZNmQMTzP45CGKAZDRB7a8dvrSmV62DmBnscUAZg=; b=TOx8XkaMB4LsX1ASujVWfiT/OVznXFBr0um+RPRxA2nrrfLWfdoUjJGbEeO6c7vlp83/m6 lhc8yE1tNHkBcts+cn545CimNNAbJEgSdWL3/aG+SyruvHDwnZCLGP8VMXmj3fQRobbjgJ b+9Gj9Ps9uQGNaQITdVSc1tAIXk9Xa4= X-MC-Unique: MTPvBqRaP9GrgmKIRd-VxA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 28/32] scripts: kernel-doc: fix typedef parsing Date: Tue, 1 Dec 2020 05:34:58 -0500 Message-Id: <20201201103502.4024573-29-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The include/linux/genalloc.h file defined this typedef: typedef unsigned long (*genpool_algo_t)(unsigned long *map,unsigned long s= ize,unsigned long start,unsigned int nr,void *data, struct gen_pool *pool, = unsigned long start_addr); Because it has a type composite of two words (unsigned long), the parser gets the typedef name wrong: .. c:macro:: long **Typedef**: Allocation callback function type definition Fix the regex in order to accept composite types when defining a typedef for a function pointer. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/328e8018041cc44f7a1684e57f8d111230761c4f.16= 03792384.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-28-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index d3a289628c..862b77686e 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1434,13 +1434,14 @@ sub dump_typedef($$) { $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 # Parse function prototypes - if ($x =3D~ /typedef\s+(\w+)\s*\(\*\s*(\w\S+)\s*\)\s*\((.*)\);/ || - $x =3D~ /typedef\s+(\w+)\s*(\w\S+)\s*\s*\((.*)\);/) { + if ($x =3D~ /typedef((?:\s+[\w\*]+){1,8})\s*\(\*?\s*(\w\S+)\s*\)\s*\((= .*)\);/ || + $x =3D~ /typedef((?:\s+[\w\*]+\s+){1,8})\s*\*?(\w\S+)\s*\s*\((.*)\);/) { =20 # Function typedefs $return_type =3D $1; $declaration_name =3D $2; my $args =3D $3; + $return_type =3D~ s/^\s+//; =20 create_parameterlist($args, ',', $file, $declaration_name); =20 --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606819811; cv=none; d=zohomail.com; s=zohoarc; b=ZjlGjhej/ut13VnCGL4mdeQDFkttOIvVkMj4Jqo1rxOPl7vAJYMs3O6ZPwf3hefs+p/NqDd8XJb07cOoKhJlk/j5qu0k2x54rHO0l6+tI3e4XP8Fql0F2OvVn7abPNBDabh19Qq4VJPGEXxkaejvvKWZKioHtA/iWds6dRanTMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606819811; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qHV1Bw2XcvB86SinjjcaViQAYlGKdlvYVGUfC9qwTiU=; b=QX+IsoFcKrlTwYCqBoDg5t4OzuD4KlYsZ1xcVpXNhQAkrkM6Wc4w02+UpBnwU9s50aeFs9uVHVphkoKR7NCq2leYVlwS9HXoTGHnmvKciqxACmGCFxqg42M5zpLpPCLnijl5ceDO26/RhtLcaotQmUOirhpM34QKRc3bs12MO9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 160681981067228.75664581958756; Tue, 1 Dec 2020 02:50:10 -0800 (PST) Received: from localhost ([::1]:34906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3EW-0004xw-A2 for importer@patchew.org; Tue, 01 Dec 2020 05:50:08 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30T-0002a4-OK for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:37 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:25897) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30G-0003sV-43 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:37 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-129-EBUVSEbHOwi-E6AAKow1RQ-1; Tue, 01 Dec 2020 05:35:16 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8400F425C8; Tue, 1 Dec 2020 10:35:15 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3F22210023B0; Tue, 1 Dec 2020 10:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818918; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qHV1Bw2XcvB86SinjjcaViQAYlGKdlvYVGUfC9qwTiU=; b=HIwFr8KpQv8fx3+F5HertGH/4W27i/UuNleGSgglBzeIa9WCnF5WuNfruQAOm5vTMe79ZO LkuzCiUPdTyM29GSe3Xss/5bA9ASf16hq6RL9g7PLArLZHO7P0IBCoDskQd0nzCo/3KNKV l/XZHqyq9nK3Dxe0r1Bok2LoH0S5uiA= X-MC-Unique: EBUVSEbHOwi-E6AAKow1RQ-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 29/32] scripts: kernel-doc: split typedef complex regex Date: Tue, 1 Dec 2020 05:34:59 -0500 Message-Id: <20201201103502.4024573-30-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab The typedef regex for function prototypes are very complex. Split them into 3 separate regex and then join them using qr. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/3a4af999a0d62d4ab9dfae1cdefdfcad93383356.16= 03792384.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-29-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 862b77686e..524fc626ed 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1427,17 +1427,21 @@ sub dump_enum($$) { } } =20 +my $typedef_type =3D qr { ((?:\s+[\w\*]+){1,8})\s* }x; +my $typedef_ident =3D qr { \*?\s*(\w\S+)\s* }x; +my $typedef_args =3D qr { \s*\((.*)\); }x; + +my $typedef1 =3D qr { typedef$typedef_type\($typedef_ident\)$typedef_args = }x; +my $typedef2 =3D qr { typedef$typedef_type$typedef_ident$typedef_args }x; + sub dump_typedef($$) { my $x =3D shift; my $file =3D shift; =20 $x =3D~ s@/\*.*?\*/@@gos; # strip comments. =20 - # Parse function prototypes - if ($x =3D~ /typedef((?:\s+[\w\*]+){1,8})\s*\(\*?\s*(\w\S+)\s*\)\s*\((= .*)\);/ || - $x =3D~ /typedef((?:\s+[\w\*]+\s+){1,8})\s*\*?(\w\S+)\s*\s*\((.*)\);/) { - - # Function typedefs + # Parse function typedef prototypes + if ($x =3D~ $typedef1 || $x =3D~ $typedef2) { $return_type =3D $1; $declaration_name =3D $2; my $args =3D $3; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820191; cv=none; d=zohomail.com; s=zohoarc; b=dLTwKCJCLl72z52ImBAxjLQ1doeAottU49CNC1+mRU31XQddmtO762kKMqRe8a8WF7YW1HAM/0FY2kHsvAw2EtD9O3U8scHLXF1WBMun4Z4alibyTita8OQjB3pWyplaUdrwCClrCIDZWUWPf+Ivs8jb6OE70weSBbSSvPspnyA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820191; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=kSjg7m+HaAHtujriKl1vHsebKVqWjUJdu+/lbf1VQG0=; b=Md1kYoT/xOv+53JqqNv5XcRDRusQcgGBoOOhUoeOLzrSSDtSOjHtFE8TYS2WwIwDQ2ekQBrqzsoIvWr3V69eQMkF+a5NYTCV86yYklu0UppRPlMrj8dx6q1jY0LClHYHp8FzXDo2ZCbMM2LXT90M2C9SDMf+p7Wi+DD6ZZ2bW44= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820191647563.2057524617527; Tue, 1 Dec 2020 02:56:31 -0800 (PST) Received: from localhost ([::1]:57644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3Kg-00066r-AP for importer@patchew.org; Tue, 01 Dec 2020 05:56:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42216) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30V-0002eh-DB for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39612) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30G-0003tf-Lt for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-270-Gg1C_w7XNiSACDxeCtJpnA-1; Tue, 01 Dec 2020 05:35:18 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 42E7C805BE6; Tue, 1 Dec 2020 10:35:16 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA5AB60BE5; Tue, 1 Dec 2020 10:35:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818920; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kSjg7m+HaAHtujriKl1vHsebKVqWjUJdu+/lbf1VQG0=; b=DPd5WP1xJgG6iZlkI/gbpbH4hcmCG64JGOZ4TrSfZdau9LjNuxElVfsvy+6bzSqqasiFIq 2/MEOV0sSPwV/AJ+HBmqiQMglq9bZNQFRl0cb9Yk7zf+z8gC7vKBUeL6sq+qVy4JqecSNk d0ZOxOa92fquDTjgZ4aKoieiHuGUthw= X-MC-Unique: Gg1C_w7XNiSACDxeCtJpnA-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 30/32] scripts: kernel-doc: use :c:union when needed Date: Tue, 1 Dec 2020 05:35:00 -0500 Message-Id: <20201201103502.4024573-31-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" From: Mauro Carvalho Chehab Sphinx C domain code after 3.2.1 will start complaning if :c:struct would be used for an union type: .../Documentation/gpu/drm-kms-helpers:352: ../drivers/video/hdmi.c:851: WA= RNING: C 'identifier' cross-reference uses wrong tag: reference name is 'un= ion hdmi_infoframe' but found name is 'struct hdmi_infoframe'. Full referen= ce name is 'union hdmi_infoframe'. Full found name is 'struct hdmi_infofram= e'. So, let's address this issue too in advance, in order to avoid future issues. Signed-off-by: Mauro Carvalho Chehab Link: https://lore.kernel.org/r/6e4ec3eec914df62389a299797a3880ae4490f35.16= 03791716.git.mchehab+huawei@kernel.org Signed-off-by: Jonathan Corbet Signed-off-by: Paolo Bonzini Message-Id: <20201117165312.118257-30-pbonzini@redhat.com> Signed-off-by: Paolo Bonzini Tested-by: Peter Maydell --- scripts/kernel-doc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 524fc626ed..b95bae3654 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1092,7 +1092,11 @@ sub output_struct_rst(%) { print "\n\n.. c:type:: " . $name . "\n\n"; } else { my $name =3D $args{'struct'}; - print "\n\n.. c:struct:: " . $name . "\n\n"; + if ($args{'type'} eq 'union') { + print "\n\n.. c:union:: " . $name . "\n\n"; + } else { + print "\n\n.. c:struct:: " . $name . "\n\n"; + } } print_lineno($declaration_start_line); $lineprefix =3D " "; --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820357; cv=none; d=zohomail.com; s=zohoarc; b=aILN27AWu7XTZwQPTe9ZrJWsuFk7/sna14hyMhtTJlUi0jwaio8Fi2KnLSxcdUgvUxmLVbhpDnXrvPWeVwFWmW2P5xtbr5LfurlrNt7nP56PSXcCSkaAJ1bdLD/fDy3iGVsiJvI40STuiClNwKCdwwmzvhAz/WsDBduHt8th/qI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820357; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=lXxgg6srxt7xRfadKq9QJ/nuaQ+cvM/Ydzs2egVLJ+U=; b=Wny16KVwTyviXw74iTEbPzDxOhoODvbSLcyrqquqqcKSj3kteLsVCeVvt0Nzz/TKo4PLbjgZQf1/fR8dV42e4H4YSKYwhnnsdxd+TljD4FFatkGf4NMy7Q+clihJ2kQ0T7HBNeD/uTmIZ8yvdwMVIGB2sAFKmbu9iGqGHEYP3Bc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820357548256.9564000519298; Tue, 1 Dec 2020 02:59:17 -0800 (PST) Received: from localhost ([::1]:37870 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3NM-0001EB-FP for importer@patchew.org; Tue, 01 Dec 2020 05:59:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42222) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30V-0002fs-S2 for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:42343) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30G-0003sf-Gt for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-qmQ59T9FNu-tF-vM7V1jAg-1; Tue, 01 Dec 2020 05:35:17 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81C29425CB; Tue, 1 Dec 2020 10:35:16 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4047E60C0F; Tue, 1 Dec 2020 10:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lXxgg6srxt7xRfadKq9QJ/nuaQ+cvM/Ydzs2egVLJ+U=; b=NNgzh12PZ3j67LDTMn1kCUsBsbczoJqHAVpHv1FqRT6g49fnBJCe0isQo7NqKiNuf7WlUN wyGmGLYE/y0I+UbgrDHz0RMZG2bT7NbywETZY4RE0BWdeI5TEou5tC/cGXEgYp+Zh2hXS4 0hswp3iqXiqtKOQUUMOmBfMBHiJphUE= X-MC-Unique: qmQ59T9FNu-tF-vM7V1jAg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 31/32] Revert "docs: temporarily disable the kernel-doc extension" Date: Tue, 1 Dec 2020 05:35:01 -0500 Message-Id: <20201201103502.4024573-32-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" This reverts commit fd68a72875cf318f4310726f842139119c5f45d5. We're done with the update of kernel-doc and we can restore kernel-doc's functionality. Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell Tested-by: Peter Maydell --- docs/sphinx/kerneldoc.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/docs/sphinx/kerneldoc.py b/docs/sphinx/kerneldoc.py index 079aadced3..bf44215016 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -80,9 +80,6 @@ class KernelDocDirective(Directive): # Tell sphinx of the dependency env.note_dependency(os.path.abspath(filename)) =20 - # Disabled temporarily while scripts/kernel-doc is updated - return [] - tab_width =3D self.options.get('tab-width', self.state.document.se= ttings.tab_width) =20 # FIXME: make this nicer and more robust against errors --=20 2.26.2 From nobody Thu May 16 17:58:30 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1606820342; cv=none; d=zohomail.com; s=zohoarc; b=K2oUEM+W7GAVqIszgbagGA848n+ORSRu/O44MAvBCTevAxiVKt2ih+x+oC5q5aS3CB2upoLYz7nUZwnVZPQEqcNy+6c+ckKwvGaFNV+8O9aEEYL+1RAgI2/9ZeHd6cUcydIKGi7NCrQmVjA9Lj0WKqQBcMwu9e9maTrz1nd/nkA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1606820342; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=DPtg02KBbgeo/fb7I7tYDFfslZ3GmxNcSArYS7E1QLU=; b=AMQEU3ZJHb8IkG2B6b5pHXOzgL5XjySu/7s3t/cVkkhyJcSW0mT4MyFWvbDJomV633LPXB5QiyApPXvCj2g54+4Nq7bxI6pJbds4sxnf+w9OuPy3Dobk42DcLC1yMCaLQ4meiw81pzBFmHXvU7w4TQ5h1d5y83Nlt7KEo2wzRMA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1606820342458863.000842667469; Tue, 1 Dec 2020 02:59:02 -0800 (PST) Received: from localhost ([::1]:37526 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kk3N7-000153-DV for importer@patchew.org; Tue, 01 Dec 2020 05:59:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:42218) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kk30V-0002f9-KN for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:40912) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1kk30I-0003sm-0p for qemu-devel@nongnu.org; Tue, 01 Dec 2020 05:35:39 -0500 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-215-3nwcpq23MvGIO0JfG9UvHg-1; Tue, 01 Dec 2020 05:35:17 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB5A2425D6; Tue, 1 Dec 2020 10:35:16 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9B65960BE5; Tue, 1 Dec 2020 10:35:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606818919; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DPtg02KBbgeo/fb7I7tYDFfslZ3GmxNcSArYS7E1QLU=; b=A/SQezsvkAQDaApnO1agmZd1pf4bIoJZl5iYh7oH9MjDGd2J+o/io3Sgd0KmBK2aCaWwcO p968bQ+dmsK7O+t6/eGE3IAPW7TSQmLV84udFyw+epXUfm8xKojmPQXt+Dn2ezCdnc4myb hfqgzImz8JgMSmMzTLPYEuK0KefgEBM= X-MC-Unique: 3nwcpq23MvGIO0JfG9UvHg-1 From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH v2 32/32] scripts: kernel-doc: remove unnecesssary change wrt Linux Date: Tue, 1 Dec 2020 05:35:02 -0500 Message-Id: <20201201103502.4024573-33-pbonzini@redhat.com> In-Reply-To: <20201201103502.4024573-1-pbonzini@redhat.com> References: <20201201103502.4024573-1-pbonzini@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -35 X-Spam_score: -3.6 X-Spam_bar: --- X-Spam_report: (-3.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.496, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" A comment in kernel-doc mentions QEMU's qatomic_set macro, but since this code originated in Linux we should just revert it and stay as close to the kernel's copy of the script as possible. The change was introduced (more or less unintentionally) in QEMU commit commit d73415a31547, which did a global search-and-replace of QEMU's atomic access macros. Suggested-by: Peter Maydell Signed-off-by: Paolo Bonzini Reviewed-by: Peter Maydell Tested-by: Peter Maydell --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index b95bae3654..4b19851b2d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -1758,7 +1758,7 @@ sub dump_function($$) { # If you mess with these regexps, it's a good idea to check that # the following functions' documentation still comes out right: # - parport_register_device (function pointer parameters) - # - qatomic_set (macro) + # - atomic_set (macro) # - pci_match_device, __copy_to_user (long return type) =20 if ($define && $prototype =3D~ m/^()([a-zA-Z0-9_~:]+)\s+/) { --=20 2.26.2