From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632073; cv=none; d=zohomail.com; s=zohoarc; b=MO2+NN6Hoecsrq22YZE+RxYRlvdBEcJJe2eCzLB1NfTy0YG13p/EVRrj2KnhHKiTzxRaUUfzpQz4pfRfHDby/cBLYk2/xlC4C5GA+hf1ey5YjUCY8fD94NKS029azeZ6ZtaLOKHb2ZrTw0iTYYgIJNIyIzRqSt8IVoycCEhrxOA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632073; h=Content-Type:Content-Transfer-Encoding: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=oYPzWMFrHNuaSUUxoAwHWUxCwjgdcly0qE/fwm5druY=; b=fqaW1qZdga5DQz5tH1Yg+xg6FfxmVXROtedwk5O/JQY76ToSQqLBdF6nefUth6HdqW9TmCdL/mvHWS/2uSyLV/rTcd86+KyiemqebV3+FBNO+43tJT2jvBMEt+ezTdXnWlLK6jSDMZbaXrXzwFUwjGEocFwKSurKDIGSyNOiAso= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632073291296.55568605250926; Tue, 17 Nov 2020 08:54:33 -0800 (PST) Received: from localhost ([::1]:46812 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4FT-0003aF-Ti for importer@patchew.org; Tue, 17 Nov 2020 11:54:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43274) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EJ-0001tV-PT for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:19 -0500 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:33627) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EI-00071i-4N for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:19 -0500 Received: by mail-ej1-x642.google.com with SMTP id 7so30389307ejm.0 for ; Tue, 17 Nov 2020 08:53:17 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oYPzWMFrHNuaSUUxoAwHWUxCwjgdcly0qE/fwm5druY=; b=PX6+m+yP+Ln/RXfQy7QG61hTZLYoD17p9cyp2APDhJly39gYPyQpakftiD1zGZTsaa xe/nBeaZXdcu/MQlM9iLy6Aj90bM9KM0cCYmBvSNRg+lBlG+Snf1JafbMUvMCW9bgPVX OGo53rey+irxAqQ6fvSvMnwUWsaU39DLY+21xLCVZFdMhku2C5rECClEuHfNECdjXDoq gkkBWH7YgfI+fg0JJJA0Oa8qTBHDhTcDXtArIgc1PuR8t4rrcpunWsN359kdnUfjuHpr Wmfq/s8+0aL4PUrtIIbdHKgeuHdoul2Ot95pleD+Fy1wXh6qeyrl5Ogq0SUFgmTVBMph 8SZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=oYPzWMFrHNuaSUUxoAwHWUxCwjgdcly0qE/fwm5druY=; b=i/los89WttC+xD/zoT/9s8m41xYp6Yj0F3XIvCueJjqaZFYhqgYNj0bOFY750SU57O 211V3xvaFKvJ9qDm8aup/cCIlkkSTo+QqD3pNQ68a1Hl/8O1cg6a7bQz5poR2xnSukKB voG2tkOjuDOteDxsfe42wOZNwe3e5ahhbOJUB30UNsKQbsC9pv1qtpfaXt8c8CsB35VC fqJ+aYyeiLdzEoDDIx85Nbmr7aASgf3tNHuIrnwTjz/LPH/okfC1HW2sbhNrrrY+51vs VPH+CAMOHcp9ZYXo3jtEM3jirxpFrLN64z3HLIEw/PdUBhgT9FWa4dRoW2h5iRGOEOPF 2MRQ== X-Gm-Message-State: AOAM530kmd9IRP5fmK3hE6xR70aipp+IjEYNfdJneQoBZ+6hy3bT1HQz 36A3247BLcUfjVwNlXMbbheAhKK7u8g= X-Google-Smtp-Source: ABdhPJyCSKaBM3LZZBZNFLz09qmJ3XGnMK+2Lx/3zEQ1457fZRAJ9Kmpg7mdAJB3NWWensedsE0bOA== X-Received: by 2002:a17:906:604e:: with SMTP id p14mr21221026ejj.515.1605631996293; Tue, 17 Nov 2020 08:53:16 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 01/29] kernel-doc: fix processing nested structs with attributes Date: Tue, 17 Nov 2020 17:52:44 +0100 Message-Id: <20201117165312.118257-2-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::642; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632191; cv=none; d=zohomail.com; s=zohoarc; b=fhpeFFykCbLA3j83LpkfDb/vTmcyzF8s+J/CmDIYzbF/LyC+rErCWvKMAFHAYI31IUCJGufdoNa3VqjZxSkwFFte0dHL4UTu/pYMrj6KXVKrsaWGq/sg3ctpxlxUU1d7wzZGWZHATXLBpE3p7Lu6/uQCmJC5Sd0mc5M2YTj4Px4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632191; h=Content-Type:Content-Transfer-Encoding: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=8GhvAvrzm3gZ/KhG/DzPgYp9uBo/iVatk34KwPcwZjM=; b=WOlEA3vAanqEsaPfM/blsMwPLoioKKe+y5LfH8P2FF1c/9IJz8qwLs0Y5uz7swTEG2p5x2iG4BrpxiAX1S4593kw3MF+ffd2KDgR1eDA6Sw4xZHd/VR8GOqvD0sLOs3/nJGlABzlO7eCZzDDQUU0oMQs3P5vNBs6qygjEMSdW9Q= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632191207804.351145317788; Tue, 17 Nov 2020 08:56:31 -0800 (PST) Received: from localhost ([::1]:55228 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4HN-00074H-Ra for importer@patchew.org; Tue, 17 Nov 2020 11:56:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EL-0001vF-V4 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:21 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:45003) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EJ-00071x-7g for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:21 -0500 Received: by mail-ej1-x643.google.com with SMTP id y17so24740561ejh.11 for ; Tue, 17 Nov 2020 08:53:18 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8GhvAvrzm3gZ/KhG/DzPgYp9uBo/iVatk34KwPcwZjM=; b=KIDssoS+raLR9y6g8Vb4RLAeNALSd8rgMBTLdIE5WXFB1EVvblZEAl3K8/h6XECsBb TD+4R487F9ivYkamXVortTo9KOFU7jMUOEBTgz7P0pxKyKhlgaBU/MGS0xK6xGq4a7Dg 8L7TUc/+l758JqdDT/K39d+FBJU/rFd3YOOSrLGOGZ61FvI59ZB/5eVakoLVNu5gLeLf I8gUMYhWldHFX+5nS5eKWzKAe5JO5xHQ5JA1d4hcMf+gF1xjZpEvP0G65kz6D6iaJm6B 3svwJachOHxXggVqsfsV6UTryJEhZ/+4dmGo5skOWSOw6ad158ceesbfi4Bnv55IBfzK 2HOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8GhvAvrzm3gZ/KhG/DzPgYp9uBo/iVatk34KwPcwZjM=; b=RtIMkBtEFkYldLknNSvwSkwsSHoureP1tP5hTv4x5BTqMW7xB5rGV+NGHJUSW4P7lJ CJefQXINfbTE/af3x97r0MGeKaM52ExNco9j/FJGEzHs1JoCQ+bRHa00S+qfEovR7T+s 6KXOcA7b667Zp/hGs50/wb88X5/j2wwUC9GZXlLTUs6G9KpR8bAJJA3CcptpiaZyjcyd YIIAb+Q8mu6bI6G/L7aIMopr99tCF3csalVDi8J/XzExqMoM5jo4JX7I6nduSSBWUUtm qj4hNG7SeQnk6oKTPi7wdiJ9j/74wgUyR6zDExvVRkBEpx60Sy62sy3IM2U9ZDT5vkiU N0gQ== X-Gm-Message-State: AOAM531OyzMt3xhUp/yBzKMze6ZNsBpsHhGmNst16+iibFOlgPTNRL2X jAcTS2sb18BFD9C2AH9hXYs9XIKmwoY= X-Google-Smtp-Source: ABdhPJzDQftyxkCFZ+oNsCnY6F2Bx1NDNMMFpKNA70STRjqDYR0+ynZbdzoa5wg93NxNvpALjm1cSw== X-Received: by 2002:a17:906:3958:: with SMTP id g24mr20571356eje.360.1605631997373; Tue, 17 Nov 2020 08:53:17 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 02/29] kernel-doc: add support for ____cacheline_aligned_in_smp attribute Date: Tue, 17 Nov 2020 17:52:45 +0100 Message-Id: <20201117165312.118257-3-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632189; cv=none; d=zohomail.com; s=zohoarc; b=jVlPpnSCBqJLRO3om5xedBIxPLH+QepczS7yiTvOH66kD8LxAERC8VLWI0yrLzN0hwPdBBKQbHAtzNwRDRx96tPrK86zDLeaxN7+UGuqDOvhhyeXG0fifT80MLjSaIfi+rSgfBHzjCadGEv4crV3o3gDagQhNyTvXF4Ov/x1rfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632189; h=Content-Type:Content-Transfer-Encoding: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=nAr7FMMY1Aekrxeh4MeSfYXr651AgfiypgckE+9CcNk=; b=MF5nhXcc1ySqud8qV2D9V7ar1pgzktLyvAZu1hqxANXDDwabkGYlfTEukaHtMguiKM4o+hPwBmU/tQr3Diw3ZLxWxxRB3l7WJvosEmOSKB1ObHo0zsGy17NPuOQwYfhcVFjtzVUPwDKBUG9KCqInGGxSnGnN64h/V7IY4oZaZVo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632189524647.0328231558245; Tue, 17 Nov 2020 08:56:29 -0800 (PST) Received: from localhost ([::1]:55116 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4HM-00071E-7s for importer@patchew.org; Tue, 17 Nov 2020 11:56:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43304) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EM-0001wx-R1 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:22 -0500 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:38817) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EK-00072p-Mp for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:22 -0500 Received: by mail-ej1-x642.google.com with SMTP id a16so2627912ejj.5 for ; Tue, 17 Nov 2020 08:53:20 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nAr7FMMY1Aekrxeh4MeSfYXr651AgfiypgckE+9CcNk=; b=UKXuRsb0ue0nf1raLR4Pd6olHOOT22WzzDo3P25IHe4ufm6Y7ZZCk5PK8XCEF+4bIm E15Rm7HxOQIzGi2yRK1Hx24z0AqesjaJlo86smuVDNnh582ADqDHV+2IEqHPz2yf+EFP LC/5DFhRI8OJafjHqIJzEELLLjKP34htqKwa9BahzdslNQYROPU5p/e30F5j+bU1ZOUK RfJMDBUIIPpQi5fPx34T5wj30pvBtm5bTc9QsCD0uRRQ+aCGLl0o0gGdgH/fYtixUomd mF7VZkGUIXcy5pYU6OTSJDlcUsxdlzinS6z5KneGSZXdAdqOJ1DNBy/feSjiX/xwfk1b JANQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=nAr7FMMY1Aekrxeh4MeSfYXr651AgfiypgckE+9CcNk=; b=tjZQD8M5zNiff7Ttxa7kmvCn5X1WzsbJ9PczB+CSjXvhHgZoNCDBCokQHoQhEvr/Nr 08q046NUn01+DQiWib/c+OXZ4NNoOVjX3R6rC8B5Y6Rgd7QYbdkhZg4g8Kyq/pNyVL+L lheMYLJ26HyPQw4wYb0HjK5o+8dY+vMQm7ffelKdKs/cwEkLb1zPp4uLTOD2O4Raq/OY Jp8ltDMKwsXv4qmRt5WnSHpQMTbYCWdkjCBLNaTBxdKzZB4qsOzuwONn7RUJDqnfCxGI Kx9ahHOaaQU9vbA6J7/ujfyjRKHyYB2JVKS2gQ9wsl30vcuet+vhFo2HzvjV3Nhyl85V JbZw== X-Gm-Message-State: AOAM530E0Mr9D0CLRea69H96nvqcsdA/VveuD4ojJsXcPg+aqX1b49b+ PtY9TnWPfi5YBFydnoS9U1oqXVwwMPU= X-Google-Smtp-Source: ABdhPJzGQ+++xv5cVoLsw39rGUUwgGyxj9M3iCgCOhSJOeo1Wrp+rohxH1Raknoc8SOJUiJKH8S32A== X-Received: by 2002:a17:906:6d99:: with SMTP id h25mr20581507ejt.281.1605631998425; Tue, 17 Nov 2020 08:53:18 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 03/29] scripts/kernel-doc: Add support for named variable macro arguments Date: Tue, 17 Nov 2020 17:52:46 +0100 Message-Id: <20201117165312.118257-4-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::642; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632076; cv=none; d=zohomail.com; s=zohoarc; b=H8+i6qSp3qYAhm+VRcbrZOxEUTKgIXRKc5/cWkjRwZr00ccdBCTo3h94JFu/GRs43iE55dX18WIb76tiR5F28Hzud2NWRun126xxYEQx7vDKvEGA/ioi6SYAunSFq7PbByvdkr5Z6eJxioiRv0laL0QVZyr5N9qC7vplXfpoGNo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632076; h=Content-Transfer-Encoding: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=ArDMKySatkMVEUjIFtkfkJUZ/d5fmcXFZVM5ofr2RH0=; b=AFTX5nWzXIrHzWihuKcgfVSCsrjNHAt3hrb6veKc1Pp56pOczlo30dmtsZva6bCER9CVDWTre892sNIVN6OhN+DiTgAps1N6PnGRXg5EN1+NpqHdZMXxMosxNKPciRH272buX/g9CZvZ/IPPNLeMkBCj/azHyOYOwFDTlZyoqcY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632076248172.98474328231453; Tue, 17 Nov 2020 08:54:36 -0800 (PST) Received: from localhost ([::1]:47154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4FX-0003iV-6K for importer@patchew.org; Tue, 17 Nov 2020 11:54:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43326) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EO-0001zZ-Cx for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:24 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:34857) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EM-00073q-9k for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:24 -0500 Received: by mail-ej1-x643.google.com with SMTP id f23so30458748ejk.2 for ; Tue, 17 Nov 2020 08:53:21 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ArDMKySatkMVEUjIFtkfkJUZ/d5fmcXFZVM5ofr2RH0=; b=R9hSN4keg1Zrt2jt25PXAKIiPCXCcQBilYLO6EmVKOqbw/IIBpjz8dRZ1VGINXCAkt PL0YnOFEWR9bzMeWgD7Lt66GZB+K802ufbunydzOnEVrIuwrzpcpMKANW8WFXHRTKkUG 5Gv/GfwqOIqUhwLqQ9l86LgaO6ltoc11dHITk7v1zEbwLM7RL5yKq1mvz9gQr++eEIzp 2Y8PawiYeD27PRliHWlmwvtzHPQWdMWdukeAIwjKeKYEz1EdaBOk5v7+DZmpKf+AQuVk CeZ9HMCXjMjvOXfo2mF5Nv8RpjP0L6lmNXLy4gEszDC8IQb9lTnC7abx6i8UBl/dQWE9 WZDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ArDMKySatkMVEUjIFtkfkJUZ/d5fmcXFZVM5ofr2RH0=; b=tEYI5xV1tLXFueXhxPdS1wLTdKLhBA/8Bmb+Au5wgGt+l22BNNfjf0ReWTRQzkQMdJ ps5T4USFB3F5bk3DjzRUh1UXHra8KBAHJgAqD5eqtKkCRhhwP0G/E1s4xy4PX0rVv9C8 4DzrZ5EdCNzT1SDpibnEVme6ANqUu0ncUIALMtpQ6WlY0xDvrz0UNnJmxgJ5vXM5v205 Yy7mH7FxEDqrFcw0i0q1j7KMqihD4ouUAvfO0tDE2LvHS6g5vHyliKfrp6PSVOMwtSAs my1qvhd0kfw0R6OYVVjoKoOev5XdVpgA3gr3etvD8sMJPU751OCF4ASLCNDf75KMfnaD D8bQ== X-Gm-Message-State: AOAM533DBWIp3L094vzhm3htfEfWDz9ez40CW8ltUPKL7P/x8NfmmcV9 B06TAczEbN5F5pijg6oewrhekhxykhI= X-Google-Smtp-Source: ABdhPJwbfV0/x1notpgJgS+mRhGcNXK3T/XD+ttoA8oE9X7EUXClGTLLWmK9NwJ++BN9KxarGRR9AA== X-Received: by 2002:a17:906:e4f:: with SMTP id q15mr19729316eji.220.1605631999505; Tue, 17 Nov 2020 08:53:19 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 04/29] scripts: kernel-doc: proper handle @foo->bar() Date: Tue, 17 Nov 2020 17:52:47 +0100 Message-Id: <20201117165312.118257-5-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632310; cv=none; d=zohomail.com; s=zohoarc; b=nM5c/4HApjtd8/NsFnTXQYwwEXGv6V0G2Kc/eEKgSGk9LFOdvE9kFts3jvKd7b11jJKk1IEaxUnKBor1mZP2fD/nwzbZxSUYV4UGlLaro8IYV6BQujP/oP1hpqpaiS+p0JT7kc6rxgyRUuEf85LFCYRssAuBkGVO3b3eJDywEyc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632310; h=Content-Transfer-Encoding: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=JEFn2myAfvQw/Vg4eNXG7kpGva/yiW9GffCGDX+kPnA=; b=bhgTOMnzRkA+wMIA0BEvpwdrvc9I6vE6OESAvmXL/Q0cHmFtS1qlr8dzM6fCvDrmgutWX9tpMSaqbg/QmK+ini8A7n+O7JQvV2MqOK55fxf1vjs5IqLYWGNaH0x+0ogcsZx9nVp/8sBC7lKjI0Wwmq7Sj0LG9jYHuAP0+guy7iU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632309882430.4971279595421; Tue, 17 Nov 2020 08:58:29 -0800 (PST) Received: from localhost ([::1]:35332 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4JG-000272-S4 for importer@patchew.org; Tue, 17 Nov 2020 11:58:26 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43346) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EP-00021M-AF for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:25 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:42188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EM-00073t-9P for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:25 -0500 Received: by mail-ej1-x643.google.com with SMTP id i19so30376958ejx.9 for ; Tue, 17 Nov 2020 08:53:21 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JEFn2myAfvQw/Vg4eNXG7kpGva/yiW9GffCGDX+kPnA=; b=fE0NQAjwsPO6tq8enYvewmT2fjA5tibOwQp61lVJ7PxKwJgO06NqcFH+8PjbjLy4dK /tUEN029hXkE25V2OE46iXpurTfyPhBvpHCjWjhqZTFrW6i0kxAi8gc0pt62Br9SV8PK DkPbuIXJw8sWl5bV7WxBNYvqmldbm+0BPh9kqcte1ll6w0dOtfKCLYUShlqT7TCD0lgQ Yy0qzhEchvmWtt2PQzU8GlJCGVqZzogwtZKu6twbtrakNGBYTh/xNCwoC2MCIp0ItjSq Bw0zrQ6BDwaNufzB1Q3AkaD/YrnvQsAAp6eAF2h7FJRY/c5kjdbtWNtAzQIPa9HLSnoh Mf3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JEFn2myAfvQw/Vg4eNXG7kpGva/yiW9GffCGDX+kPnA=; b=olcBn9RIUHAXNqgdDN+6g0XSxj15KyY5hp3fe1rRXd+DmOmN7afLX2qxXX3Pb830wK SYMie7rI+tZcdeY2k3/TXDgVFq8YTW7gd4ZCNK9r8Q441c2GKO4zIAUTNpocdRM8mA5c YVXe6sVVJQXtnRgv+pCm/dT7CQOXjum58AJLqQXlYQVdWZsBU5lNKoIY1RgwNK0qeqC7 9zfDFsdJGVkxRU6AyWI9/Lr5P1ba3ZrlQbcqrDnAJZ23GYCE3AMobo+uhV3EiENHHweP /YvedDdHEHuewevjQwdzJWQaSAHlACSkAJ2Ia/CYAQT7fxGuIyz9tqafXPCrVrUvSX/o FrGA== X-Gm-Message-State: AOAM531sPPKunFwZ8gnMGKBnwSqSi73mA1DrY2fJtcVCtx5J7cSb3JQq hqZog6UdUmilCOqRMD6cgzyhA/RhUp0= X-Google-Smtp-Source: ABdhPJy+ZIudjZOr/O4kEYybSQeJclEqMarH0sJO4M+qUFwCQ1BzCJj+/j5JJCdnE6NX6JJE0ZEYTQ== X-Received: by 2002:a17:906:519e:: with SMTP id y30mr19751922ejk.186.1605632000592; Tue, 17 Nov 2020 08:53:20 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 05/29] scripts: kernel-doc: accept negation like !@var Date: Tue, 17 Nov 2020 17:52:48 +0100 Message-Id: <20201117165312.118257-6-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632079; cv=none; d=zohomail.com; s=zohoarc; b=kuePf1lVF9IVUCNh8iauSeEXMsSI95aF8xCv0SF8C66gRWH4FICo/civ5sRMt57qZi+/yot0KOlVoBimwtoPl9mCuMD2gOeObsrmZcIqz3Ql/Qj2usAA6rVYUWvrTHliNsyzhOchdiccW5Jmowx+F7RBUvBC7bj8g5cACLDT09c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632079; h=Content-Transfer-Encoding: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=o3FEmTirvN3wCU7dGXsCMf8zrDeMSpCzE0Xw7TwlYxw=; b=Hzf5hm8JMLrvuTUTsIb8JBWI3G2N2zjfnz7+50/vt8JG/acKpXVGlsod369HaoI2S5wMkdbAO9dKLs/wgfXL8saRDzgAw/rtvAAKVfy8+8T5MC4YzgkUsBf36nqethJAglFeB6ZHb1T1z9mClOBR7Ct7RoMJxkK29SgxsUV4fLc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632079154809.5609130030771; Tue, 17 Nov 2020 08:54:39 -0800 (PST) Received: from localhost ([::1]:47478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4FZ-0003qT-Vx for importer@patchew.org; Tue, 17 Nov 2020 11:54:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43354) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EP-00021u-M6 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:25 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:46647) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EN-000746-Gd for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:25 -0500 Received: by mail-ej1-x643.google.com with SMTP id w13so30378659eju.13 for ; Tue, 17 Nov 2020 08:53:23 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o3FEmTirvN3wCU7dGXsCMf8zrDeMSpCzE0Xw7TwlYxw=; b=VwYa0aGOkvUHLLgA1LuRuIfmx3iu6yxso4fWhSZ0ai3fW+ePI438vRE6MLcoPRdM3d TIE2UBwRwqOGMAWUfL5pSHBRM2SYOt+Zs9noWfpmoKu6VyveWWQJqdGJU3VVS3nAHg5+ jeVKFVsu8pnxV69h2SuPxgMBbuCmsdhsRpjoOKPv3jAny6uvkedNV08TLcYGhGZ8YbIS yKb8jtLQQlZ/bX6FKWc980T+945gpGsEJlJPDN4YnsfuU0ElMyRyNv5Llm9tAap2fpZM X/IRTZn6M/cJ8RzS4+47L7XsxGp8D+Jfxi8pXw8cOaNp1iakC/XNKoMwYXBfzcq44tpR uuzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=o3FEmTirvN3wCU7dGXsCMf8zrDeMSpCzE0Xw7TwlYxw=; b=CDhsy/Hz8uXyPX3Pzjf3W+VGdX09jdmZRnUoNaeP1QeRZp0R8wVgBn4DgqWyZXUFq0 yamrO6g2n5D7c84IVp6FzYjr52KPp62DM8yMUtvXcsCKazcOpyopn6NwEHm94WMmLAAO wOBtyUg81xhOJMYd8nLAdig7j4A7+7YzyHlWK3nvpqaQ808lXMX+JAXi/6cOC2e5toc4 CkJ18GL88thF5z7pUpdIuuuaLdF6GOKpo84vw09xHhAwd0raCFk2H7ch1kYM15QZEwOv akldcgxnHGQqyj/aH6zQKtE1ouTuyjO92kbOCz5eCdl+YiNtvO5oHhP7NOGY2i2AWl78 7IcA== X-Gm-Message-State: AOAM5303rkiEVwDg12PIdx30mlCyOdwRXusd5dsu1tNxlWUOvKxekuXZ OG0Cu4jffbp1IGGyqg73jZEB0Lr73eA= X-Google-Smtp-Source: ABdhPJzapIfwI/UpTbSWsFQlRrwb8VGki1xRVfIyy0U6LhLgw14JWm/v0yAsMBaAXWROoyskY0WjdQ== X-Received: by 2002:a17:906:3807:: with SMTP id v7mr19302203ejc.441.1605632001868; Tue, 17 Nov 2020 08:53:21 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 06/29] scripts: kernel-doc: accept blank lines on parameter description Date: Tue, 17 Nov 2020 17:52:49 +0100 Message-Id: <20201117165312.118257-7-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_FILL_THIS_FORM_SHORT=0.01 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632434; cv=none; d=zohomail.com; s=zohoarc; b=PZC+KTbD1ur9B7HhxKYV8iv0gwatk47GBmAiFRHIRwvox23EPjI2TDjTwquxsvljltsDv1jQggAxussf6NhfcnRa3BHtYuCYognRBV1pX3wr7TD+7kmZPsFQ1hrXSWdT6YsLqfhoVOP63cJV7VfZ99E8OZpZPflnkazSqsNboAU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632434; h=Content-Transfer-Encoding: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=gNWJ/VEx1uTE8wxM/bFQps9+VkdXGSnUdRqMFFMtLWI=; b=O86Q3DUjMnb41fTp7O3GMSodDZebyxc/D1tE3qXtSl2qWjn88DZKhuBeH0+sJAQnHkg1Dk3hQjL9rK4iM0dfIBOSC9BRjbwp6vxz3qgwP5KGCRfDBcVOMEVx7cHPH9xg6MEsa7NTTD0mX2+DJRkfHOzF2M6UMrg+qcxPk17TFvo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632434220858.4508463317677; Tue, 17 Nov 2020 09:00:34 -0800 (PST) Received: from localhost ([::1]:43634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4LG-0005Rf-Ug for importer@patchew.org; Tue, 17 Nov 2020 12:00:30 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43364) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EQ-00023n-Hs for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:26 -0500 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]:39177) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EO-00074C-Lb for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:26 -0500 Received: by mail-ed1-x544.google.com with SMTP id e18so23206227edy.6 for ; Tue, 17 Nov 2020 08:53:24 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gNWJ/VEx1uTE8wxM/bFQps9+VkdXGSnUdRqMFFMtLWI=; b=rYInS5QIiVulKKyP3KjWYttA1MOwrN056PVQGDYCOTzKnqWufNzbFGvpKF/xVdSkXC PlAxUQUpvDWXx7m5TbRS0MfVgB0LdFgbMbR5s/otboTRjE1C/vuOiWydhAxtzlTb42So S0rQAMlmnDEQhT5webkub15bX3claOoCnD3JlmVxAg8DDJWkZz4XP7//zqgdneTC9fKz zCs1Lfa1sC1ZG+o4ANo0hfyGG3wALOLQu9bYICNf9EsKU8CM3itsTnT1XLRkYrbu8JSr 0U9KvP7wDPCY/ZBZd3tCj3g78V9c/LLmt/QtF6fbX9+8iZ2HLVQO/Pdz38A6XMQYQUJt vOsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=gNWJ/VEx1uTE8wxM/bFQps9+VkdXGSnUdRqMFFMtLWI=; b=rWYMudIFgblCaG8C3UBKoPlX1Wy/lid7Uj+d9xzureKdFKmpMLKkUFJEGszh+BtACP 5ui7iH5TvCfRROQUV9z1SGuOyrrSu6Iz6HGJUo3AsygiqBucJ1EIniTfu2FxC4vDvO/8 81eqiTvNhLy13nrK5GCe417eMF6DarY8zBZdRirhI/olwfcYlEwvcAdR7vU5Fm5op9oE h8FceFiC3q0O5Pq+gdoh1MDZGwjLs1OzhQXSbUcGeA9RDOxh9WP9GR1RH7XG8COeNQoP QJ+hY32VkU7lrHbzbTu7TMMK3ncn0gSiRBklB79uat2fXFShFZOtlVo0Un6Q9z6AYeAm Ia9A== X-Gm-Message-State: AOAM532KoDMroWJnMrLwg2XI1DlJrSYl6I26vFhDJisD9PqNBJaX6FLD eAkPaMVigs9MG09aRGggESHO/GcTHCs= X-Google-Smtp-Source: ABdhPJxFXRFTnwia/1OwEcbBoBA8P+CKT+sCd4WwD5aLuSz42sObQ/PvnDcLRym4hmhHkbDJ6QrXfg== X-Received: by 2002:a50:da4b:: with SMTP id a11mr4449648edk.364.1605632003055; Tue, 17 Nov 2020 08:53:23 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 07/29] Replace HTTP links with HTTPS ones: documentation Date: Tue, 17 Nov 2020 17:52:50 +0100 Message-Id: <20201117165312.118257-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::544; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x544.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632306; cv=none; d=zohomail.com; s=zohoarc; b=Lypw1MBTztnZvqpHwmVXG2+eXkV2CW3o+cy+qkR7yciR10Vi4zaJaUZrDWwkpsjaR6ghGmhn5X/YdkUE8wP+Api3St7oFTdi7icns44jMCpj5+UjjSBhm7N9ZjhKSfnGq0SkUZe5RKkp3zJDR/5neMeXLm7enn7ZginQrJA6Rjs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632306; h=Content-Transfer-Encoding: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=XQrna4rwZXMJJQSjXOwFxD8k5atGx5lFfFM7NcFB024=; b=nQFkXPZDJIFvfZtShXU78CgQ7uR1RIDICuUXeSL0Fkv7DRUKnQl/8Ej7Q2+2+46wP7yvQvalYr0YotwaKIBMmF+q6pYFzqoYg32MwJj+DJiDwp8kjQySrUFtIHfLvkVFuG2y6ANBHi9vUeuSfL20QXlVESkrxBcqcv4RgrnC0M0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 16056323065007.454273823822632; Tue, 17 Nov 2020 08:58:26 -0800 (PST) Received: from localhost ([::1]:35154 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4JF-00022x-Cx for importer@patchew.org; Tue, 17 Nov 2020 11:58:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4ER-00026r-Ms for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:27 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:36746) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EP-000759-NG for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:27 -0500 Received: by mail-ej1-x643.google.com with SMTP id o21so30406228ejb.3 for ; Tue, 17 Nov 2020 08:53:25 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XQrna4rwZXMJJQSjXOwFxD8k5atGx5lFfFM7NcFB024=; b=DhdjDQMovt9sIrNXiQvZkjKPY8RBi7bHVLsPiRaVY3u7MxGZuzr2mk9obJTMLiljZz H09o+Yg6NSwbko8r+bMcGcBCK7qybAwQHc4WS0GZpi2VGMXvy9hmqCrxV0Iv6p/pwFmY vpmuKs15L4uLGpmYFLXjWZlSS2wMh008u335oBlp2KwMSUZVtrWGgBBOSEWWakRjfYcP JjflxIZ4Dsa00Ba1oxO1f/fAsAIZ8HW+qwcRNHnwgA/xD4W8uv2Uvx0oy3A/MUa/zC5T sCTJxAq2jeH3DpDv5LCO8vRao2xJZTy/3yJDlHQQUxNvC69Auh0CyG/0wupf+k5wML0w +r9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=XQrna4rwZXMJJQSjXOwFxD8k5atGx5lFfFM7NcFB024=; b=XTS0a6U0Bn2rZMxvPIXLVBgamERMeA4/9b0yvzXGiGXIuJ+w0rYnul89bowzItgRHy XEtoPyfFeseu57738nR2RyL0qU8Vzba6WW3T8y7amwEkUgFd9H3aSe/zlk5kG8vx0KtR fIuBqZ04LXU7rICba/yOCL6NVgienMqZOkl0XBCCsh8fvtTYodvVWwsldy5Cr07sk7yJ VMEtdioJXZg2wqC4M5sa921LhTb+CSrXyrf+MFkROgiYYEdekR4MRzzXLFsLAOAoutDh yT4e/K/b1xdRygh8dgDghh+hGyibfxwdG+fgxIUVFM6Lm/tc5KzNRa9qDGTs7eL6+y7p vZqA== X-Gm-Message-State: AOAM5335J7YjmtNYvkiCYPJEUFpMihUJlHYUvOGOeoFUZ7uOzLJjpJPc XF/59rUpI9sQ0jTsmGbNcaW7zXm4rKk= X-Google-Smtp-Source: ABdhPJys5lE9HPclkauEdGIHncXm1/HdsGkNVAQytc/3AOGdW/d9u1qlgH8Cp9VkC8LGKVFAnXnI8Q== X-Received: by 2002:a17:907:411b:: with SMTP id nw19mr19690576ejb.150.1605632004064; Tue, 17 Nov 2020 08:53:24 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 08/29] scripts/kernel-doc: parse __ETHTOOL_DECLARE_LINK_MODE_MASK Date: Tue, 17 Nov 2020 17:52:51 +0100 Message-Id: <20201117165312.118257-9-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632193; cv=none; d=zohomail.com; s=zohoarc; b=Mis+abPf9/6WyKPRmzPK5wIX4EX62P61mfFt26d0M4UYeB3+uCOzCHqk18H79SnWJw7jGeFDk2tdkh+mX4HPCpqj8HFuZEygwDDYvRKI6b7aCSzYq+QRQW3M5AFp+pihjZjKVGbeQw3qMMrifGEIs3EKCi1dJADojrgW0Ewwf8c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632193; h=Content-Transfer-Encoding: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=diMMQnnjwdchxcFLq3HawYvuPKfV5ciSzV6TIRp0xJo=; b=OOj1XC5uLXmCRQwgolUHjEbSCl/RqZK8sLLYcwl4zJy5K38Arb8k+XID06TK2BAAeGhqfvvYsKRjklV+5hO49UeC4Uxi2IkBZNi//g95p4dOuggMF/b1qhs6o9I8osAlk9JIma6TPdmOGWY6qjVNzljNU6YiQRg57R9ZnioNmOg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632193522580.3038504301404; Tue, 17 Nov 2020 08:56:33 -0800 (PST) Received: from localhost ([::1]:55500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4HQ-0007An-De for importer@patchew.org; Tue, 17 Nov 2020 11:56:32 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4ES-00029P-Nw for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:28 -0500 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:37596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EQ-00075N-Nl for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:28 -0500 Received: by mail-ej1-x644.google.com with SMTP id f20so30406138ejz.4 for ; Tue, 17 Nov 2020 08:53:26 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=diMMQnnjwdchxcFLq3HawYvuPKfV5ciSzV6TIRp0xJo=; b=N75MFvRJ/308yQq7qQBwaJ+NK2I5Y8qyE22wHOOy+/wdBiJjfKwNuZ3xi+xAEl9CdO ZE0zF0CKL/Lw8MEJsIn5xeYQ2YIdsUmp1i0SyEWdeOcXJSh78EGQpbezy4piQ3uHvDas AJCFSqEjCRm1Vft8DrqsY4J5iZpBrOb+zEHiXSd8hSIkc5eAz3IYeMcbWR6RLH1UIsOK 1wgjsw469Ef0SUfk2TxqhCMBDZC6uxmjwd5NtV5w3s+gf11hAGgQzPwdQlOiZFS04OLs L3ipHpGNpfHVL8xcETcIXZquXQ58Cu/BpfwpCA1x3moqQWZWn0L2c88ntr5uA90KXL19 esqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=diMMQnnjwdchxcFLq3HawYvuPKfV5ciSzV6TIRp0xJo=; b=O8Io66SAXKYjh5gkBx4qkmPKenRiVgtiw/BFwimEoKJLilinjXBrWgkWUXrA9W8xJ2 sqrPgHX9wRXEZ4HrCT/T2dbBjBDTs7XS+S4y3BCMePHuyE3cNtQp4kWypFzRgAlhqDZ/ sdrx/mogj77LIxZ0MyxgyxstgvqMnAfrt+exCxJKR7GXcnSDr11I3aK3tKP+2AOhnwFo hfRZt+Z+vO6SIk5LZwHX9kdiq/qf7JGpK5W1OfBN+mSnPEfds1nqeL65FQUfJ1UAs1J1 vqeCUXR8Ord/QOZq7EUo72z8U6ZWKiO4O2QERlh6NloJ5XIB+FZvAxejX8CWcd8jFusa Yqqw== X-Gm-Message-State: AOAM531BwY9sz0b61eEx18SWelXGf1j8NyJypBPt16M7lBcY1hyOvsJk BgQ8w6uGfem5UG1Tk3d8/WGPn/C/RXw= X-Google-Smtp-Source: ABdhPJwcVocxHEu5CaDlDtY1vjF6/GarnTZrbB2ov85TsdydrYI2s2nQnB/HjT5hFoHsan28NiFNGw== X-Received: by 2002:a17:906:e2c3:: with SMTP id gr3mr19651113ejb.471.1605632005052; Tue, 17 Nov 2020 08:53:25 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 09/29] scripts/kernel-doc: handle function pointer prototypes Date: Tue, 17 Nov 2020 17:52:52 +0100 Message-Id: <20201117165312.118257-10-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::644; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632311; cv=none; d=zohomail.com; s=zohoarc; b=hJNVoIr9q5SFpI3E3CkzR8tzMwyU0QBi6bSO2dNAFS40X6IxJisz9AlGLA4+vDCsVz87HQxkLioG2uz+uNavMMO6mKMfLj98BHWbvLsZVbLOoCVTNO5N5PqvpdOWRsu0l38q4uPAoP9FYZ5f6aawdbfe2E4+2keI2vUJuaMTPLs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632311; h=Content-Transfer-Encoding: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=CkuT4AzM0EgmmRU2e5yZiBSUORJm8C5IBRPPd2PET4E=; b=SdATKOg2IXV2pZUv2qTOTR6583mN4qPU2CzBmKyMF6lxsDKNY2gXX0v1tyAllchqFGS3iGAC1zuuIgXw/sF2LMhKIwnGZ+wCquYqe6b7+3ralMi4ELGb2GYj6qUbq5uw4rU3PGSqGa1x3Kq35greICFzrP8yVmutiBEm5o0o/zs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632311826222.34307066733425; Tue, 17 Nov 2020 08:58:31 -0800 (PST) Received: from localhost ([::1]:35630 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4JJ-0002Ed-M6 for importer@patchew.org; Tue, 17 Nov 2020 11:58:29 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EV-0002Fh-AX for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:31 -0500 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:41161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4ER-00075W-Rt for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:30 -0500 Received: by mail-ej1-x644.google.com with SMTP id gj5so2910101ejb.8 for ; Tue, 17 Nov 2020 08:53:27 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CkuT4AzM0EgmmRU2e5yZiBSUORJm8C5IBRPPd2PET4E=; b=ekbG7hmU9H4M9HgrHNpibdRQAsl2jI1JjKJCg9QxCY3f7tpXtbWk8WMlyFHqp9ebui WAwRIO0/BMcMqCla+6E8pdHU/Qp7beOJ+LHPWSlmJVHZHf5j7FRVtylr3yNekhYx8rCd nhkNakb7jt5J3ZBfpsxNooRuUslqhXyy4ia8NVc8SUz1mSupwJpBmqgM2dIeEEiXgVOg uBQfVed2ZVngmmiY7b7NcYvdSVTW0dUOLJO+ZAHXrko2UHY262dMaPfmOt4FyA1/gmEk /5v80lrw+LJmWR6O/bTb/7ZD4rA0MpFoiNy8JNaWupz/76e3uoh7Nh/F4hQKSZcgE2uw s6QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CkuT4AzM0EgmmRU2e5yZiBSUORJm8C5IBRPPd2PET4E=; b=lEhvLJSi+wFJVsVqhz5F7JPpNcZ2j70Zh+faVkHbwbI/qcA8rfj/Xsb7GX6a5Ub2wJ GmPEztYLW76dk5t8kIHXV5WmKIMRs34D2hbBtRMzjod4GSiiTfSPE1kf6lUQtJqsSvjj Au8XNklomaHBjXi/03rbZFqegM7RPY1HntE65cCVi5hsgViSVtuSgc0WBVo33fxpHacy FkTvSoa2FWjbaJ1F7BLgw9/G0ClxVB5GaM+/Pdsy5bMmh394h0pi2M0A9oikXFAKOErc yrcrxvvKiL39csMDjFESDsoMgaCwbZLNbOtaCVNeNGsNPSW276Hp+DvmuhE5et+mgWEZ MeyQ== X-Gm-Message-State: AOAM531SG3QSB/5hKrkXfIsPj6P6yzxd+e60F/fYHhX+6Sa6vOlLZUa5 0lRB1bJER2BF5Ot/oijJF2RGsDVXXOU= X-Google-Smtp-Source: ABdhPJyfmi0wP41d1FOupXOkdaLdKGSquVK6NZCS39DrS+HFC+0Ew+4HIkNUun5LJKJIPQEZOqXoWA== X-Received: by 2002:a17:906:4104:: with SMTP id j4mr20906108ejk.439.1605632006098; Tue, 17 Nov 2020 08:53:26 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 10/29] scripts/kernel-doc: optionally treat warnings as errors Date: Tue, 17 Nov 2020 17:52:53 +0100 Message-Id: <20201117165312.118257-11-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::644; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632598; cv=none; d=zohomail.com; s=zohoarc; b=Eb4unL0GFKRV6grVa1YJlmyvzHDy7JkDvJjn3IYMX3Xpe7fg2hyMD3QA98qkW5n4S4zo1Gwo5/0R6/6BHDNUvLjM4SEaJ73As/hpLFU2v5kpsFMvDCRgySgnh3Wf2sgYyLSb7SRpOpqfm1KRVfSyog/S3HM5+WJeeyyKQVn3tps= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632598; h=Content-Transfer-Encoding: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=ztc3Pu+lAjCUdGZER5PIFUAkxhZApbW0E7GC3IpMpXw=; b=fX6A/zhQeofLAPHEqem0yuyAVhlIiVqwIjaFmu/GfWeCpK5ZowRitpTaID5LEXvnF33NMkpRH5libvnafvLjLngPOeBMpGbKTykyLoCTRI9LOKzxHTv5uay6baiVyLdDzzvnPGOQRK4A0qbn8qrkRxNhK56Q8g1YlBHaH6RP62A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632597874709.0869300964516; Tue, 17 Nov 2020 09:03:17 -0800 (PST) Received: from localhost ([::1]:52230 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Nu-0000go-9T for importer@patchew.org; Tue, 17 Nov 2020 12:03:14 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EW-0002IH-9T for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:32 -0500 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]:46800) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4ET-00076P-11 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:31 -0500 Received: by mail-ej1-x632.google.com with SMTP id w13so30379041eju.13 for ; Tue, 17 Nov 2020 08:53:28 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ztc3Pu+lAjCUdGZER5PIFUAkxhZApbW0E7GC3IpMpXw=; b=cYe8BIGOv7uElwe4SETkIfo+UEgDbbBpES1f/0gT+rg6FHzQhUf4b1BxkQvZTit7CV tO2kdM+UbWe9eaW5BEuJ9lH+xozi95lmTe+txglw5fmYVvtgwgsJ7H/sPsGuKYrDd8N1 17Q3rrUWKD2EyBLs9cQXaZrce3PF6wdh+EJR3SacVzUgNA/p/exbSl3UPBMgHap1R6rq FD56melD5dgw/AvdNYk5xSgZTaspcgqVSatVSnuQprhqhjBteopDA7KGqwZiWXiFwsg6 LmaDfIWnmO4Q89xc+fBWJApB3Q6TcpmppRD4wilJdQ7QDXpFgFaZfluVuOcCgTpv1MA7 dRhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ztc3Pu+lAjCUdGZER5PIFUAkxhZApbW0E7GC3IpMpXw=; b=r/bfWnSh+y1mRsXLp6aeBVK8SBhWkyqKS9prDvGFliXiC6KgZ2daYDvwzV+Rs/wAqk fojDcsS5NmkTbbCDoOqJ00oOJIi3YA8v39YbabVLXvnPtcyXkROKnPGT4/L05Wc79Wwm jCSrYai4cMh27xTHDXhT6zQlsYdhblnxQ5ZdBh5ONiBGM+21gt9zAV/3bHrKJTiuYYpg 9ZWwE3/AxnbFUh56POw7SRaKfOgOfm4t/wWGfJmKKEuAy+44OspNzgB352DYBoX6PQKu hLEiLUkHCLNpB1aArSKdJqcjjQPa43s7B9UM9/7iAs+/Wd+hL6HZNlLVeZ3pNjTjQpBe HNkg== X-Gm-Message-State: AOAM532Cgu2LxiraCkIs7iO6CkxEFH3zDttfSRcpoNZraFh1vYalaqsi rvng6/SWl//Au/Xn6stDZeUIwA4PnEs= X-Google-Smtp-Source: ABdhPJyyFvDIRmJyL2P+TXgB9AOTnj6o0JtyR9BPJr5USDrnXSg/fJnrkkRiMz7bdbKjcmOnd+WYWg== X-Received: by 2002:a17:906:adcd:: with SMTP id lb13mr19233612ejb.362.1605632007287; Tue, 17 Nov 2020 08:53:27 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 11/29] kernel-doc: include line numbers for function prototypes Date: Tue, 17 Nov 2020 17:52:54 +0100 Message-Id: <20201117165312.118257-12-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::632; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x632.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632452; cv=none; d=zohomail.com; s=zohoarc; b=lHesl7UduAPUBc9yUVUZbiAoqfOrbiqVR4FIO0oG9eB2n6QKa8mWhl1N5GBla98hGMTpu5orDE90++N8Ks1x3OPpbt3h40SE/Aw9RTdKfqNPD8MyrkQP7Kjfqu7CPUXmYCgB9Cxb7d0POAiCjMo2EgtC8c1zdKmughgAQH5iaxg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632452; h=Content-Transfer-Encoding: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=wUVMLQ8eQPnh20+/yBYy2nKewA9e95/iKRnIwP+C0hM=; b=WukR23ZbmVzV2Ojce2VsGPCaNph1msoLjyZpRZo3l4QG4xvdfXZe5cT2acLQPl5YH+YEbbHA7m6ByoSRzdCmBJ7exXMsALiheYtnYM2lLZsQGmmFOAUGWjgJspZrh9dNGbGv7H5haQd7TGebnfJbgBkPnkpbQ6lfCBqlR6RVRTc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632452111422.08020367611437; Tue, 17 Nov 2020 09:00:52 -0800 (PST) Received: from localhost ([::1]:43924 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4LY-0005Yj-QC for importer@patchew.org; Tue, 17 Nov 2020 12:00:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43422) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EW-0002HZ-18 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:32 -0500 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:39450) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4ET-00076d-TW for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:31 -0500 Received: by mail-ej1-x642.google.com with SMTP id s25so30383549ejy.6 for ; Tue, 17 Nov 2020 08:53:29 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=wUVMLQ8eQPnh20+/yBYy2nKewA9e95/iKRnIwP+C0hM=; b=pCbkNqLad5XaHa015uAN1ZpUAdwjYX1zA26wNG/ajvcL2vovmfOY3g3JuA4J1eee1x jZ8W6Hvr58ALDKt0in8eLqkD+kguH4iKe+zCXF+6q7BD3MUKKlF9k6bcukKLk2LkAXCY H+t5C1Jms7AKMxq3VNsiV+ys0b4UhknUylOjEd6XNy7kbfefI8nM7RWNIukO9gyL5L34 iL91Lg8iRLfcUOvX1pkX5XpdrQoS5PkzXESD8YM62p6BYaBjQzQaSVwoTaMAYVPmab+C 5FzUa8cwgWmEHFbDMIZiTbto9EkSRm7YfFKQjbRxKKcQZjKL2joCHjMNWcP6IN9K/W2X jOGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=wUVMLQ8eQPnh20+/yBYy2nKewA9e95/iKRnIwP+C0hM=; b=FEgGZeD+beciN5rPV6YW3UritPfR3EJYs93hVttrGJZeaRQ4pgnQTpTuCHy0nH0UIP z66zE83qvlLpFFHVKciuiOCPtR6WiRV6LfNPpt2SrerHUOZkPxLS27qzwVhb2iknbOTR rfFDiCkEjuQa/hK9IYd932NsqMt8rXoO8RMlpxQ7JC5enH5xoXKyJpj+mTYEeyJ7IHx7 NR8TEmEOVuxWn4Xjo4VlgSMHHrWiEZfnNEXiwij8AGHbgS6hZhZOpsXGNeAlLagw6pVi yGORK9nj/H3Sc3tNJwOWgN4TNcI9jselbcxabKuF9V/Ppu7JEhWjA9VZRNlY4n3k+FeN VJYA== X-Gm-Message-State: AOAM532p87VC6PJ6xHaZFCIhmHZA8frhk1VhpHKmQEuldPymyxyrAaP5 XEdgQ9X0aIvX9M7qWck7IjjYp7NH0og= X-Google-Smtp-Source: ABdhPJzMfTqT3ocGGKFxR/cKGyLcrFnw9qonMoGcCdBWHjEixOFM1247DvB8oupntDEsiybbkezwXQ== X-Received: by 2002:a17:906:f0c3:: with SMTP id dk3mr10413471ejb.366.1605632008288; Tue, 17 Nov 2020 08:53:28 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 12/29] kernel-doc: add support for ____cacheline_aligned attribute Date: Tue, 17 Nov 2020 17:52:55 +0100 Message-Id: <20201117165312.118257-13-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::642; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632196; cv=none; d=zohomail.com; s=zohoarc; b=iFokj32yJiTlDOhDyVNJJ6oENE90U3WjkHUo237I86cJOrJASKXSBzwiXiX61apwB0ITnSpjgVXnVaHAbsAUxJD2wpdlU5PtpIr+fg3/7mhaZa00N6Ggf8KOiAhge4yUQFQ0WKFc3Y/7zagn27idi6/Bus7TUD0zGhm/sbXWLMI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632196; h=Content-Transfer-Encoding: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=9bAK10h4yUsf8f9+DOkJIuR133Dwl6yX38CfWUvQZ4Y=; b=KMEhfxjpUIHiiskcR6FnDtQQpGARQyEE2U1pkRNc5/W2LGWiHj6hNULZCO5fZ3PUofgLtFldtw6bG8hhT+udDG4rIvv3UdEsLYYIjOX8iMPxXrDJa143/EruJoljXXSbg+Va6WkJkUOVLG+9/QvgMBiGvD9X12hgnbeminbRvvw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632196351891.3927509991402; Tue, 17 Nov 2020 08:56:36 -0800 (PST) Received: from localhost ([::1]:55804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4HT-0007Kg-8z for importer@patchew.org; Tue, 17 Nov 2020 11:56:35 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43442) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EX-0002Jv-05 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:33 -0500 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:40279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EV-00076l-8w for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:32 -0500 Received: by mail-ej1-x644.google.com with SMTP id oq3so30378826ejb.7 for ; Tue, 17 Nov 2020 08:53:30 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9bAK10h4yUsf8f9+DOkJIuR133Dwl6yX38CfWUvQZ4Y=; b=k8Pn5fm+jcck3SIQWMCz6JVzvkZLpaUmYo21gBjUD+tcVkNKMKPfRxrdMN0YHmw9Tp 1sQy9uNkfDG6hR517zuifs1dTnTCAB9uOi2VYiNVWmy6IcnU/goZ/yzT0y5+A8FzIa6/ icOArDbLItJ8d/7yNM10lIxLlL4TdtnH3YZWMq8+pptSA+8aTrJ9shTIudKSVHoGyrCL 2bYYI6DYiYLeCv790RnFwr3S5txWdn02Z55uKQg2kt+pyMPnUhZB2V/Ugu4NYThG+Rgp 7xCGOPWjLkRGLP6Yl+S2vNP0NmRnoO31uGe+ajka/vuYIea6P2le0yUnlWsMIdXZOWIV D8dg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=9bAK10h4yUsf8f9+DOkJIuR133Dwl6yX38CfWUvQZ4Y=; b=OH8w4adJ7xLVTLOUTH9ywXY/IZGoqYiR6kqBCH1Tne/IwgnCR2yKqDs1Fzx0DDGbIh MyX4+nxChXHXPEdjBt7C3lE3iVOXEpznrf0LctWJpae7MTtMdfQSZnDu8fxPchX735od BbiQJdGcs1AHTh6KDybMDqM/Z7sAYuslornXagkCIlqw2yAMrr4oPlku0VCBwk4J+3gX SWYxV2z+0QaGDp9A6RgzyC0PBBnWfjuXZzWqnYcVl2lzrcUdtcGFuVrtGCTYA24tVc6f VWkkra6OgKbigPEKr/iBpIP8BiMFy51+1p1OK2sZP2sXs461OlC+lfmPZilsfjtTccxG MM6Q== X-Gm-Message-State: AOAM533/lZ94O/khXqnLmujlvZcJW4Ln0Yf8WNJinmymtOGCEgjEWCil UAgnEDUDoNcOi6nt4T9V5BKBQnSaHzQ= X-Google-Smtp-Source: ABdhPJxeFkU0KWf8AxlypjJzCgGFjPz/Utsdc+/EkIIdk49ZbqVP0ZLQXefhPP3ohSIpKyclbmQA7g== X-Received: by 2002:a17:906:a186:: with SMTP id s6mr20808631ejy.193.1605632009279; Tue, 17 Nov 2020 08:53:29 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 13/29] scripts: kernel-doc: add support for typedef enum Date: Tue, 17 Nov 2020 17:52:56 +0100 Message-Id: <20201117165312.118257-14-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::644; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632747; cv=none; d=zohomail.com; s=zohoarc; b=NOTHHgwfyqIQn9FfUwrH9R114u0a2XUSoDiWvjkUmxbRZmfjvmZSJxDU84417SAUAyBGjVrIM/gVGyV/muCMf1Waejxusw8qhXo73563iJa3B5SBWD4tDPnZepGqybvOv/i6vhZtdawU++wUssSLuCyBA07kLtjBxaZk4fr6Mmk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632747; h=Content-Transfer-Encoding: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=socdrf4cdKgttDc16JUa8TlM2QzhUy6/DdThoPbbylU=; b=Nc2agXQjg8zp/ZUp8NAGgiECLrACjpgBpHhkLc0j/5QniXpHqDmUWknLhu4GXZeEdaB0OVINhutqsgtGJHW+wsgljK2qLguQVpmEdS8xPFHi22TJ42flHJqe/jFmP/asf4YCwXs07qva1tKlaR/LIMA3u6b1X7sFB/yevA2dd3U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632747467229.43297017434145; Tue, 17 Nov 2020 09:05:47 -0800 (PST) Received: from localhost ([::1]:60576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4QL-00042k-OB for importer@patchew.org; Tue, 17 Nov 2020 12:05:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43454) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EX-0002M2-Q0 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:33 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:34858) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EW-00077S-60 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:33 -0500 Received: by mail-ej1-x643.google.com with SMTP id f23so30459567ejk.2 for ; Tue, 17 Nov 2020 08:53:31 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=socdrf4cdKgttDc16JUa8TlM2QzhUy6/DdThoPbbylU=; b=a1JE0VkkvPLVH1y1zfE6YAQIk8yFfO21H5iJD56nwE0/gMHNdH2NUVORo/ppUObc4a eqKl6ea8IETDaA1GKfQzKs+WIfX3vXTyf0QnHGUkwn7M5urBFMq1D388FSxiB2uf+ree L4xEzPNps7Y2n/Yq9j9I6mE0Y2zXpUVaYyD/cagkIayVxa9pTLAR1g2sFDR18FAJn1sH azL/37qWsWuLtWzIV1EP6xicFFJRGBnygVzeUrDJMZxzqzudI8+Ax7/mcigutCDVIMuS wHc7dMk5maW+qvoqM0DqunxbOYvR9gXZ+IirxC5gv+cuq9sr5zhHoVIL4XIoadl+nYMW BOig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=socdrf4cdKgttDc16JUa8TlM2QzhUy6/DdThoPbbylU=; b=h4dL/SQSALMj4NksPMDtQCXd8Y8J6MBzEultmj0VxL42rTvaxlGNS0spWW3gu+Z3uZ vB+8g/GFklnzhKUidMHQyh3KLBtVN+YDAtATNNt2QwPhDgzgk3olT0TueTgRJOuqhVhR JPaZ2VWGBKPYvgCAHOV+33vQUDVYvF0ijiKAe12ZoVzZOz9N0tJ8CEHju84m+HPoi0yS Z/BQaZYhHqWfw4x/k4SNTVNwKFNTRBvaOZJOR4w4Spva/BeDWh2O4iC7gLi8cFJ5DejZ fA61ZKaC9mMdClOpclcu/ds6Gy/HHg6piMXZid7lQkyD6fD4qua7b0P0+whFykAzOVMs RvSw== X-Gm-Message-State: AOAM530iEE1pGrZdCYxpjTSxjeAHx/3bIBT7a352iLRC4reEsasclWjT ZSqrpY8iOyeyYLPKIAL+jBP6n8pBTkg= X-Google-Smtp-Source: ABdhPJxS7R17Iec9AiBKhbBmWM5y31BNxZZIEJ17vaHRuBIh+k67LnxkOcQrgQroUkYXpKu/SCRTOg== X-Received: by 2002:a17:906:868b:: with SMTP id g11mr20502918ejx.263.1605632010403; Tue, 17 Nov 2020 08:53:30 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 14/29] Revert "scripts/kerneldoc: For Sphinx 3 use c:macro for macros with arguments" Date: Tue, 17 Nov 2020 17:52:57 +0100 Message-Id: <20201117165312.118257-15-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632595; cv=none; d=zohomail.com; s=zohoarc; b=DM5Z09sFrzWLuG/oy7aTQe63hhW7yU5GKQkQXKCft+dGcJcCWJeQMhRRXd7nit1R/ldyYGFuX7wAUhR8+s13NDQvnqr18j153oSZ5TZoL2pTIH0In/YUW+d4l8AP8tj4FWnIKxJA68vAvJazywr9n7pkY+W72wCYV0beonKnhcc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632595; h=Content-Transfer-Encoding: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=q+PlRwjOPb/KcvEK/B0VStlPrSATDGDH8ddyO3b8qDc=; b=fZLFi6GV7NPNxOmp0UA74gqvoUkF+tLN7beqiIF+qRHv3DHKht9OLVFY1nPtIqEqvPAfj7p+sUChsKQlSWwMC2rqxQkbcedKn9k9k0yd03RZRfocipnmt4phdiHQTrBC9sGoT5hbn0MNIl/isWuS9F5Dk5wAAS39T/MsCL0K6gQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 160563259462031.330867573575915; Tue, 17 Nov 2020 09:03:14 -0800 (PST) Received: from localhost ([::1]:52054 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Nq-0000bL-LG for importer@patchew.org; Tue, 17 Nov 2020 12:03:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43484) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4EZ-0002QH-KR for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:35 -0500 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:38820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EX-000784-4s for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:35 -0500 Received: by mail-ej1-x644.google.com with SMTP id a16so2628956ejj.5 for ; Tue, 17 Nov 2020 08:53:32 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=q+PlRwjOPb/KcvEK/B0VStlPrSATDGDH8ddyO3b8qDc=; b=KWuVQO2jszagXPZTpeSAqYhsGbqy7Xo2Su+GSowq1pXEDJnO52offrGAhMb0oV2i+i bxDV+wYyj1j39o0Bkb4AeFMHPIIaYT1rbW/X72eE34ozpqBGqTwIVdj6eeuv7bHCcBrK wa72udlaOz3j8FelvqdY+wM1Z1jKxTYoQ1K/OEWXAXggPfkJfX439M/jD/3/+WKhr23X emBzKP2uhBcjKE8oJRC5GaSmHxodvTFmQjZYPjTou6i7pgN6TyvheLTdpZzhNv5KuMtJ RJHW6lADj4ZqH0RUnxW/qfR1wK1s8fqMa8lIxS8z8upEk7hjWDPjZpWw65MNN+1Rh1td sYxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=q+PlRwjOPb/KcvEK/B0VStlPrSATDGDH8ddyO3b8qDc=; b=m3uEDDiBMhS1g+8Lcj1qRh1ya/xMWDQzrllb2b41yHqepRcgHJV3h5fWoZvoyVwQ3W gmYMj1VYD7loroZgI/G02oD8wRmCjQhzxdY/nQ2kuJ9uKeLW2H19v0GKroiHFAIq1atQ TYGulZNyTFTrtDT1uCSFFj6L1zE2D4Hc9x6UZwxbSe81F08P/JHVJCKaXbLD9+TdCKLt MVW/FtJm2/icsValb83+55FXtdYn6EhV6oEH21q4k+SKqf80dtN+PhyHtT0fw1Kai4YW a1px70Sl9CLb9Gk8PdbBAiSYhHWPe+QzIZhAqtrB2+d2xei9bxk62lOi+60k4XWbuaYG IHQA== X-Gm-Message-State: AOAM5337nHbRwm/3B4jNR07+V2Ich4OClkYDRx+k1AcTPsNb7ZncKfb/ v/kTqCT9vpoRBTdnOHOBUkfeErtNC14= X-Google-Smtp-Source: ABdhPJx8ALdfMymWtPqPvKMZFE9HHSJkQk/zXe4AwlAL+9bxfMPemXL59o283PNiD1HpbwztwOsFFw== X-Received: by 2002:a17:906:5052:: with SMTP id e18mr19485780ejk.530.1605632011503; Tue, 17 Nov 2020 08:53:31 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 15/29] Revert "kernel-doc: Use c:struct for Sphinx 3.0 and later" Date: Tue, 17 Nov 2020 17:52:58 +0100 Message-Id: <20201117165312.118257-16-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::644; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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 3ac277d162..0df6a0814d 100644 --- a/docs/sphinx/kerneldoc.py +++ b/docs/sphinx/kerneldoc.py @@ -99,7 +99,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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632662; cv=none; d=zohomail.com; s=zohoarc; b=anfGav7BKMQiQ3ppYgpEoh3dvgpwi/+JoJxOtHETbQT2BSHt1EjK42uhBH7nmJeqvodl1ZLIAhU9LG0HoClS33G/m/o4AMnLPE7Ro4llOH8CjV5f3zSfdoBl4C+/b9RYBHxvJv+ujZFAyXHNuLE/t56bIpNtoOvBg6f/LOaG+6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632662; h=Content-Transfer-Encoding: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=JiBKF0E6FiMup6R9bsft7VN6TIyWEK2T0aPfO/9H7dc=; b=VaPQ6ulPiYwk4v1hkjqtJBKqYmFtz1+VotWoKMbcrR844GdvESfgVoWbqiWyBLOiBCgUuq+VsVe5XlDlhlM41V3g+q8gsIAJtUJ87V6VYzGeBgKLOfVUZJDU7AOK3v/MHPWHD/xho3r4tHrpF/271j3HTxxtyUHioVNYLLk7WuM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632661983634.4318235466882; Tue, 17 Nov 2020 09:04:21 -0800 (PST) Received: from localhost ([::1]:54898 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Ox-0001m7-P9 for importer@patchew.org; Tue, 17 Nov 2020 12:04:19 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43514) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Ea-0002T0-LR for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:36 -0500 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:45346) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4EY-00078G-At for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:36 -0500 Received: by mail-ed1-x542.google.com with SMTP id q3so23169565edr.12 for ; Tue, 17 Nov 2020 08:53:33 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JiBKF0E6FiMup6R9bsft7VN6TIyWEK2T0aPfO/9H7dc=; b=AEq2FxPnv2bcUfRQvBWqZ2KTkcBw+oJa9qVCxPwsuSWKmVJ6DmAuyoW/TpxMy8OaKH 8J6cU7mFpqsWEkulmRuZA1kkZfskbhQB+XaajT/zal6QAd2nkgIq8fULmAEaEUq0tr3u 15FR6fgnRk4rJnAPohT8UK5ZQO/JoLuMi+T7cMCjImwAmac2xIWk52yK35wHQUeHRqrC ykLL3zc1shsAg2XEOxb0uQRYIhtXMhGkBkX959wPPWjyPL5fhHICikvH+Wg5K/f4HkbF 1U5WittHvvIvXn4/441xjtu33tz/8soqRQ81PPj+0H28deh7lyh0nz6PyfZUZroGxXKs Zutg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=JiBKF0E6FiMup6R9bsft7VN6TIyWEK2T0aPfO/9H7dc=; b=GKbSiT/O3bBpPRIjjic9Q1gTBQOmKMo6KMstcYnPTi9ucMa96b+oOZiuPwZYT2kSMY YDhxpgCOdMxBgy5IYj4PztPfxR+ejkU07PPiic3XCvzS8nWurj8RJ3LQAlUjwzDv+4NG 6WXKcPMECWUH9cUHljFcFFuMr5XRZ4AtxpMzQiECYC/SKkMNAsV2+tv3lW09odkiNE2/ eJQrRWpLdF6heiWG1qH5Ai/uKxWVjRDsTgoOXqZXHAY35QSMf1mTTIziu4f4QM1uswkF v2jBbZztDvJW1HG3tAkENFjpuEHrFyzFLuJActhDPa5BiUnPznzGybNW5PT9Jnr0K+ge viMQ== X-Gm-Message-State: AOAM533fPWNfWCJvs6cFgEksL5utYaBwNFivKfAKxzJResDHNH9oEeyY wRdBVJf6br+JxU81wMoK2Yz5WGg4lCM= X-Google-Smtp-Source: ABdhPJzCpipD621MrbM/Gth/tPQILSTiQUZo3dJzDgOMxVzD13T/P4mJc0rxF7g4zJ4e8CUpaWiLhA== X-Received: by 2002:a50:9f61:: with SMTP id b88mr22685885edf.282.1605632012495; Tue, 17 Nov 2020 08:53:32 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 16/29] scripts: kernel-doc: make it more compatible with Sphinx 3.x Date: Tue, 17 Nov 2020 17:52:59 +0100 Message-Id: <20201117165312.118257-17-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::542; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632865; cv=none; d=zohomail.com; s=zohoarc; b=GJj2bYFV7LaG3WSuyLJriVEkrz7taDgVh0mui4xI1UqU6pTIEtj3XVJ06Ync9q91xUkT8BAAIFQH7CJaK9RY5XBTSe4OHBT7Q8mTw/vVClq/xTcf0OrYBkYItpvqdTd02au+kXw3KSWVSMa8GlF4pWzRQAAcNjTlZBgdcxE/c40= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632865; h=Content-Transfer-Encoding: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=75gEYtq9Ky2PPCOSrVNxJPp6/3R4c+TBPdu4iuXk1tk=; b=imZRWB1qTIK77XLmxqnS6QMZmaLCybtZwvTZWHZy4eCiN7YMLzluwoEutJ3lThqTTHrCfKp9fJjlWYFSfHaguqLHleFbXfuDEQYjORQTvqxKdkQqZ1hdfdsCutDrWvz5hgd8T8ao8m1Waas2nmuvjCCnZdZaNARWGHRXv9VjOjo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 160563286505520.40614169598871; Tue, 17 Nov 2020 09:07:45 -0800 (PST) Received: from localhost ([::1]:40742 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4SF-0007Vi-Td for importer@patchew.org; Tue, 17 Nov 2020 12:07:43 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43712) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Em-0002to-3h for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:48 -0500 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:45347) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Ek-0007Dc-2I for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:47 -0500 Received: by mail-ed1-x542.google.com with SMTP id q3so23170180edr.12 for ; Tue, 17 Nov 2020 08:53:45 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=75gEYtq9Ky2PPCOSrVNxJPp6/3R4c+TBPdu4iuXk1tk=; b=fPL/I+yTSWynl6WBugtzQPmHrML5/q2cJBedQM5qeiXLp1TzPtjYTjgxXc1JotjZzu Pem/In7TfEUysK1c/AdQOSKllbHH/RbXviGXpgPPJ8847zIDCLu772Ghj4ckBDZ1N11+ Mbl4LeV6DMIbjskKNUqf9uL42YfRjdU3mYrnQiGREklxdIJ/DFiwJ75We8W4N0vSmwWh 5W54mmoFoyMLF4WSH1zPm+g7xCRF2Gxrkp2zY3vPlbBoIG3NJepT3D6Tl4DgOfCIAVG9 RajhpC4OCcslXSiUAcq8DhTle1CgWibo61eos0Z4dclmJhLn+raspHquYf4v8ZIftlj4 dPTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=75gEYtq9Ky2PPCOSrVNxJPp6/3R4c+TBPdu4iuXk1tk=; b=SV1MhkR7yAfQ1GoYwoge761XPxqQ44kL7OkQox6FtTomOPYjL0zupSI6dJaMO5g/Ov jqAgXjABB075jB2oI1/xPySNPR5QsRHcclFbeSH52Jeu64QGdd25osty6NM2SNtCXGrj 0Po+9xOWmMPGNQRALfsqix8cgazE07QwMBILcloeuwulgrNBX7u8KeSblQE+lLMxCuaO I4nytgd/a4xI0Y9QETwuF69mvb7kdaXnu6oCXJ1hQxekliENVkzJ6bqsGnbYk9UO2oY3 pbd37S5VFLTvL7kcjaXL58R8Mhry99Gep/fwrPpL6Rhxi5lQ78/A5kAZ/0tt3/+yNfMa PP1g== X-Gm-Message-State: AOAM5310R7r+gzzAMmK/nXyhB1+z9sEpcLnZ1Vo7LrMywLBvf7LuE8Tb MtsozTj/XD5UybM9e8fx+20ANGeThEw= X-Google-Smtp-Source: ABdhPJy1fV/oZRBtEZzLayvrYrsDD6nHz2gwntfdMGrZwykOIc+wOORSr4IwBY7cviPxElCcpEGLSQ== X-Received: by 2002:a05:6402:16d5:: with SMTP id r21mr21503282edx.149.1605632015757; Tue, 17 Nov 2020 08:53:35 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 17/29] scripts: kernel-doc: use a less pedantic markup for funcs on Sphinx 3.x Date: Tue, 17 Nov 2020 17:53:00 +0100 Message-Id: <20201117165312.118257-18-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::542; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632789; cv=none; d=zohomail.com; s=zohoarc; b=PM2xp7hIsyjneNl11nhitKneaSrQ8q6B28sglqySb1TFAWTk69lfCYO0n1UQtzQy7KZabLbnqmAdsajuKGc1IZcwR3Ri7fVzokDft2nU1FZ3CBqOF7q1jtInQf601b1ewVaHKWQYRxEGdzJRjedAKEr+pWhM77ZZX3qKeKKSNIk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632789; h=Content-Transfer-Encoding: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=DUmfTNjlKy0Q9IhZ7wEbjJoGFlCIUy8CMRbJxon/jUY=; b=druwBC6bVxm7+v0yKCJxmikTcATizYtTn24uck3wK+Occey1wVBocBf+oZyEH/mDP1LWEJq178HXN5BprdILQ21MdCI9BGB7UazRPo6JLKDjl1piIRBQ0fphEUhiF6+tF9jpWlsXm+aDcwMAdrNQWforPlQ/L4n6zIVGnHZIHiU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632789140621.8564327501723; Tue, 17 Nov 2020 09:06:29 -0800 (PST) Received: from localhost ([::1]:35040 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4R2-0005Dk-0H for importer@patchew.org; Tue, 17 Nov 2020 12:06:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4El-0002sS-Gt for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:47 -0500 Received: from mail-ed1-x541.google.com ([2a00:1450:4864:20::541]:43670) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Ej-0007DW-IU for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:47 -0500 Received: by mail-ed1-x541.google.com with SMTP id q16so7995237edv.10 for ; Tue, 17 Nov 2020 08:53:45 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DUmfTNjlKy0Q9IhZ7wEbjJoGFlCIUy8CMRbJxon/jUY=; b=TiYEwZf4V5gjaz1FDKXBdeEfvcV6bPClWt80nRUNAf1R900c9O+kpSUG6PXVq1YPW0 5mlPdTZ0FPAKCDa81p9VT9XuV5BO/ms9xt8i3FEBb3uw6XJzE730z/hr8+lCMR8tfJhe C/8JK3AEI5uEANeuRklPRi4DxqL1l4QRvercKUL3V7rOgMTkihYoupdnbtczjc8WC5YK TEwY6XFkeg0453wt4/qActlKql8lRSpKEwu0ytxd5/3imWP8Eb62uWq198oiwQHkaUo+ 2UFH08GHF9cO7pzuRa3q4Id/25oyfYd9Ii90h5zASMMgiWIzdR/Nf9S7cCOus35DTfIL CQQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=DUmfTNjlKy0Q9IhZ7wEbjJoGFlCIUy8CMRbJxon/jUY=; b=N1l/rw5hXAOCXPIMRJ0+0PF+TSZLRU4LZPC99vR/X0FHSBO8asRD/hdk1QALst4xOh nqLJlj9gCOQN3dA9nbD+ih+vVycDV1sjpC+cF6A9J9SMCIWw/QRIC4sZJQLvPe1zFIix TlTyTNPk9a1Ch19a/D6w2B10M4K1OK+dll7Sgh9ttjIWh3KWjvp//28XexJfrzuEtIk3 FPYfjjtyD901aL4iSD4MT/mK2gk05U+YkV4gwVnLAXw5hDUitFbqC1jYAx4NsUdaSC1S TLvRdPf3M8BLq0p9o/n9+IdwH1GnQy/ou/zJfM1lfQClK/u+iF5npsABm4/GiTGQY2Xw wBjA== X-Gm-Message-State: AOAM5316gfWcwr+ERKxF+j4xyY4W+TbwD54xgwfW3Pnbs63YpCMi9MML B5AX466mW3OEdVPRBaYScYvFREPIJjs= X-Google-Smtp-Source: ABdhPJyN+ZnMmXBe4gyOASStVpUJHkBiNcbBez1WOgLZb51sT2J+8WnKF80CoILVMFFsxfmzhkSxBw== X-Received: by 2002:a05:6402:1d3b:: with SMTP id dh27mr20622536edb.183.1605632024020; Tue, 17 Nov 2020 08:53:44 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 18/29] scripts: kernel-doc: fix troubles with line counts Date: Tue, 17 Nov 2020 17:53:01 +0100 Message-Id: <20201117165312.118257-19-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::541; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x541.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632314; cv=none; d=zohomail.com; s=zohoarc; b=l6NaKgmyy+eBOvbAuYZnkmrXYQyW2kB92JNeT/XW7M3jhxKGm9aFxXLYcgtk/4l88EP7e0GMgQ2LlNbQU3uojiKxrPhW/2mckpL9hI+HxUh97KeMaffjAn1wilX7UH7b+kfVUWnOAubZehXApzXj3W+MNdrOBkJZhJ0/n6tQXwQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632314; h=Content-Transfer-Encoding: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=Dr8gMwgBg3UV8aY4p4ptlc+t94D+s2hF4B9N6GvwKs8=; b=LYCEcUp/SzXpUj/OOFHDbJucM2AkeZhmfesXYUOf5E+OQ2AiKX5DD11OuccHh8rPxDDgTsw2/WYwMsN+jnhfBZd2N9ta4WMfOP28ZWV2eENsegumeuCVZCFOqD2DGyEgApsynMZfdIcaDS2MVb9AEGoKm4tPvRBt0E6+HcrsLDU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632314256507.84710738961996; Tue, 17 Nov 2020 08:58:34 -0800 (PST) Received: from localhost ([::1]:35958 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4JN-0002Mf-2I for importer@patchew.org; Tue, 17 Nov 2020 11:58:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43732) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4En-0002wl-A4 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:49 -0500 Received: from mail-ed1-x543.google.com ([2a00:1450:4864:20::543]:32801) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Ek-0007Di-IQ for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:48 -0500 Received: by mail-ed1-x543.google.com with SMTP id k4so6473354edl.0 for ; Tue, 17 Nov 2020 08:53:46 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Dr8gMwgBg3UV8aY4p4ptlc+t94D+s2hF4B9N6GvwKs8=; b=svtgP5Dj9JZNWhyzirN9MdvqaUeF3/+W/Gbms7sj3VR1RmEMSOglp4J/+IHznfafW7 T3h4PmADmbacwx3/PA2BrA7TM94dM0ciMVpvWMuZ+EHDEI5XY3ZajAFpwlhtZkdSeGda VuMqJthvh3llh6OiXIs5mLocEkhPIur24xv6SGR9iaq7kxshKsxLgB3tQPJ9U+nfAHao 4dL43pkcXfkZgmZpsClKM43rLQc36B+H+Spa9MVZuPE5L46yWnr/4LWWL/Sk09GZo069 LuSvOuYZGi6z8WDIEY33bNY7vh7TNgnKaN+Nxmj5prIUJPa4OaZqda725pzOGVxXBx11 5WPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=Dr8gMwgBg3UV8aY4p4ptlc+t94D+s2hF4B9N6GvwKs8=; b=OCpgLoDJIA0ccE+XeUpHaPR3GNGKTH270h0uJy+BzupkCGzppRjYqqgAnwJEdWMGUm yIqVQdeC/VXWJGZbEfAwifea79Q8n55oJOObDF9V5vg6SOgZomicpjxPcScUcOc+6P/D eTmp5gnMOfIZDe+Tr3gotw2+fT1GfKbkpdmrQ7C0N0/S0waPyUAfF5b/oddkRushz1Q/ hijGgQOlh3RZI++twFn8PflhlCjsGhsf3eVswqmfltdc1J3wSpDu0McQgtpO3sglVFnP /W5fZ0UYP3+n1rxnPRW9IkQZuem6Oy9AmX5BoE8RbWXxFmbY7d5NgI/mn6/Hxzyct9cE tLWA== X-Gm-Message-State: AOAM532/QtMCOSlX+iTymfMRIdHpqu+kU3jKzLvSTv/6o9pnkPsTmYbh 4inxXtwPIWsuQy63FfGMH1F5ovCreic= X-Google-Smtp-Source: ABdhPJwZ5pvVuVCxwDe0tfeOPxxpvRVrCh9APPVkw05dGIl1GTOQfyz0n5JS9roDn764qeT0pvOZnA== X-Received: by 2002:aa7:da44:: with SMTP id w4mr21824259eds.131.1605632024869; Tue, 17 Nov 2020 08:53:44 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 19/29] scripts: kernel-doc: reimplement -nofunction argument Date: Tue, 17 Nov 2020 17:53:02 +0100 Message-Id: <20201117165312.118257-20-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::543; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x543.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632890; cv=none; d=zohomail.com; s=zohoarc; b=PkMLLhV8os7w6x8UqGDgBzQwGax5KcaoSOr7nu6tLjH1ZLApr0nTHhI9F5rfUFZtJpiqgJvmSR722JSdOHoCPfBAPIRqw/GGoKgtoyl5FKSRy3WcRlbGH1tGhn2x2uWMvwWFapUYFCsEvEBz4QIF8CuookTjLIacowACZnG979Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632890; h=Content-Transfer-Encoding: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=xnRU/+C+RBHC9xmiriPbBDTgdYPtBV1fZ8ucza31GT8=; b=hI2bJkQUBxH+8DfWSkUT3FtQPvHkN6ntAoOuQsE/M3kcozn5r+2ss3xGhiwr1XcTyD3BekRkHvmpV0VX6uVDc69R6BwnzH/M7TkcAomillq6r1aers+SoZr5Uc6AG/32V77T6KXD1xrpbgneHUrEX+mWnmQ84Jzr/f+0I/pwhYg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632890737428.2997283406751; Tue, 17 Nov 2020 09:08:10 -0800 (PST) Received: from localhost ([::1]:43346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Sf-00007J-MQ for importer@patchew.org; Tue, 17 Nov 2020 12:08:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43746) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4En-0002zN-Sl for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:51 -0500 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:38822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4El-0007E5-Ho for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:49 -0500 Received: by mail-ej1-x644.google.com with SMTP id a16so2630045ejj.5 for ; Tue, 17 Nov 2020 08:53:47 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xnRU/+C+RBHC9xmiriPbBDTgdYPtBV1fZ8ucza31GT8=; b=CXaMqqJbNs7MYvub9e5YFZvQlA8kMlRG+bbcNaQZvS9B1tjxY8lQJjAtRnvhkb+NoL ypBjWZwrgUZ6WnxdM5tU60tvePdfhKM3w8tXv+qmFafb/4k41peS1XRkWcG7VfgKP++w 8qvgGRvQRTl1C4iz1MU2bhvoHLVj59FnKq1WZ+Ael42gUCKNrEx12Moj+diRxJ20P8JM u/OB2cBV9omThG4nDoLOWCJzXJvOp7alt/PcmZUlJIeR0a/PzV0SlmN6A8P+b3TdjC/1 u2asfR86R2g+/AY9zhFpqx+RrsS8lbgZvDiimryoDnStlJc4CifmHpbkvABV5/NSSi6Q bklg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=xnRU/+C+RBHC9xmiriPbBDTgdYPtBV1fZ8ucza31GT8=; b=YJ245nPMQ4y4ZfmN6USpak4ZBKtXtAol4Wn3Wt2OGOFmhvAnabaEdgLsZvsw1/03qh Ifh2gIwzIJNDrxpcFoV4TyfAvwABwiCvPCaUlTcX9QzuVzs6A7bPlrperPjzkbC7jCIU D+EmfYK1jM8LVlVQdSoHQZLsUC13wt1nnUjebbwOLv7+AD6tWEstH4JvgjI1x5hJxw74 DRAGzK95XiNhHhBy4psTNwkwYPOQOVYG1U7K64BNZLmLhP8H+VQGaXrklpwnzb4/moxm WBQDyhjJVvsm1FWClK3NgpNDGpF/qeHXwOzn6NhCaFvNEe0oBR6YiQXQb/QiyPglSkbJ jh/w== X-Gm-Message-State: AOAM533aQu3CoFoNOH7mwfdmMGsE1+bbLnK95JmKSXXcJnS1fgbhcpyB rrIAFu8ZURm/dvf/rplIn7St4ASjSn4= X-Google-Smtp-Source: ABdhPJyNS7EZg3c6d5ESGbW9WgaEOKmhp5SPefGU/iFMtMki/JYUyESguQBYAxCmvDPdLDsLIGwvGA== X-Received: by 2002:a17:906:2886:: with SMTP id o6mr21110581ejd.259.1605632025877; Tue, 17 Nov 2020 08:53:45 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 20/29] scripts: kernel-doc: fix typedef identification Date: Tue, 17 Nov 2020 17:53:03 +0100 Message-Id: <20201117165312.118257-21-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::644; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632975; cv=none; d=zohomail.com; s=zohoarc; b=UEyYTkTcwGVx3NyncN2jWgSh1L48fZetZGftjxdsjM141xmcJu2XrXYRkucKlDk0sAzmXfNZ76BzDOLWj6Sl3+efDJFaYJXsPywcz777+2YkPhqk00/wonpm/HdyHlMVqaZyiyBljnfyezhRY2i5lwZjtuhgnhdxKGT9svPAzVo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632975; h=Content-Transfer-Encoding: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=N5gZJAJK4fXqO+74lu1SvTAsbKiMd18NcoO5xUvOas8=; b=n/Vx3yfkytqlTYulTFaMb8ssy0+JJEhKOF8fIsD43KdB4apnAQRRnbEYjujaOJXNuuqYH9GdVHejSKqLQxDa/z4voIh11mYmX9ShAEqvSZqDwpDilapq5bjexk1aPywFmnFkEot/GLIflpyT/ZYv7VWD5ROgUn6bOvD98bg2geI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632975514802.6572922646958; Tue, 17 Nov 2020 09:09:35 -0800 (PST) Received: from localhost ([::1]:49196 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4U2-0002Tv-DA for importer@patchew.org; Tue, 17 Nov 2020 12:09:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43760) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Eo-0002zw-G9 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:51 -0500 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:44534) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Em-0007Ep-Jl for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:50 -0500 Received: by mail-ed1-x542.google.com with SMTP id l5so23151308edq.11 for ; Tue, 17 Nov 2020 08:53:48 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=N5gZJAJK4fXqO+74lu1SvTAsbKiMd18NcoO5xUvOas8=; b=uOTDMUWuMsu/Tsn3qlAO8Vs6SHwPrY1xn1BzRnsyOjo0M530Pi++sTuWCeg8KC6Aef JltwgEkaobH+IvFpTEk+7hczPsKKwQOVimZFbCUN+B0WRlo3k7M9tsZuPkQoAk0AP4n1 UeBUpXB68ZhoaWyKWNf+R1QqIZPal+ntvR9ktZx23vPsxh24GqvKk2Gf7NzYpKvGDEm1 CWXENUynOkrj4dJOLk3VzrNilEsiAi26tuvfiDLAkwGmqssWCKxVhE/RRILuKKWAc5DH 32gVZ6EnbaY2gMFqnJuPk+jRbtfFdblD9apyUZVYKjnTUWwOJrvGmInQQNZT21aNZRWV 4Sgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=N5gZJAJK4fXqO+74lu1SvTAsbKiMd18NcoO5xUvOas8=; b=Wbllow5txJbHqpFGQ8mPY9mdyrHLil2IEFHE/FYUUFgCluzGrvliB0koJQNd2PET8w n3TxYv4Hse0/4s+XVLWMbn6dL83EPWjBZms9YMPnNmu4FY7n58jb3RaXhbcmORLmG4b6 67lnf96uysG6PnteghjNbV4wuvOVacBNIz+48AAFg62Tr6W4CahB0jSq67pLnGvP7CbC bBrGSuwpgQddBFqE9ddW2rSmlF5Rb/jGnjF7BzAkY37mYmoqGLPWm6zOJQT43pD+NKjs T8v4kfB015Dvp5O6ZY9iyRnMfLVNzipSpITgie7uPBQR4UGQs9ZbDh72DNMDECNo+neB DT1w== X-Gm-Message-State: AOAM531h/a6AOWk8ANETXKR+s8cdIj7hKd9ax5Yzfqzd954AElkUTXby De9tjRprbRflKuI+wYNBTE2RLrxeuo4= X-Google-Smtp-Source: ABdhPJympmPmKjumJIqkPmUxM1nlrOuOFYR33msVoqxgxiX62ONQnblju0dsfEOsELoc1mbtQ5/6hg== X-Received: by 2002:a05:6402:18:: with SMTP id d24mr2487022edu.382.1605632026945; Tue, 17 Nov 2020 08:53:46 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 21/29] scripts: kernel-doc: don't mangle with parameter list Date: Tue, 17 Nov 2020 17:53:04 +0100 Message-Id: <20201117165312.118257-22-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::542; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605633011; cv=none; d=zohomail.com; s=zohoarc; b=GfiwACn0ZYt1G1X1xoiRK1a4esQoGGItLZPnahwJWfTkQ2kYMhaZ974+2TYqew1lhBNwK2tbRscMzeB5yfJ6flIvg84qEjbP/hrLJVMEI1TSUmN7KtuW4pB6ePDlKmqJEwTGDIVA+khTcfNJWOCRepTysgIyHae6cGHYwn7IgPw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605633011; h=Content-Transfer-Encoding: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=uAgpvqohpBXsyMVNyA8GR5izit02yQRNmZMUYiepav8=; b=JQ2W3TO9eh5sVlNgElbezAURwfO29GkmDFcFTSUXmOgBRIiD+4A3mJ37/9R5xob8CLwqOy+pVedXjnu8ayIrQ+rSVtA1ikkkg2FE6EDjytULEvlAcuPfmkKFpin1L4fqqBhr85/pVUnza1cd70kczRz5R1CGwn75bDg3cYKFZxo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605633011807560.9846000993081; Tue, 17 Nov 2020 09:10:11 -0800 (PST) Received: from localhost ([::1]:51636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Uc-0003RM-Kf for importer@patchew.org; Tue, 17 Nov 2020 12:10:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Ep-00030Q-NN for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:52 -0500 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]:39452) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4En-0007F1-Nw for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:51 -0500 Received: by mail-ej1-x641.google.com with SMTP id s25so30385081ejy.6 for ; Tue, 17 Nov 2020 08:53:49 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uAgpvqohpBXsyMVNyA8GR5izit02yQRNmZMUYiepav8=; b=X9BPg9UapgtZph3d6U1aNS7OiBlNZRBUnDJyS7GMrqg7AVViSnWENLEjt1JB2ZLGVb OV6spRdfrQNMjhntqZnQVW9SEN/hDk05TQMvuPsCnJpUoImqwUdZwdgcuCePHmqkhOTA vHmW5BRfBgIyH3bO5Y9AMdmo5Vcsl9Hcu+XRLQgUz7SdcTqpxu1pach53HdDfMGszE6g sUOrrxWR91ZfWJ269DkOFAzVAfTvI2VWFXZuhAoPedjaa95EHFGDWgT+sERr42ZxGadE NbdFmAm19MJT70hDr9CzAODn8AoNSWkJMwclt30jX9HzqN+qD0WVB+K7TqIKsG0bxpsU BUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=uAgpvqohpBXsyMVNyA8GR5izit02yQRNmZMUYiepav8=; b=hWjBfP58IgGDS30hKL7f5EybsLNpD0QaM9spL3MBE8lDqQ+7b9/xf/aBmEq0aQH5ZE g8lz3fP3ZGBFeJOwr7C1UBxC8hrCwLroD+HH//bw+0wYwkSgwN/MKhHpn3QQ62fEW2PF hPzdiGPO5wQw/Ym1R9WU5LjQ2PtqdeNz7iv9rlk1Z03/5Mlv3P4EL4wOWILU4tL4MD+q iZ83vVgRcysgeJSaO/VvVI9CMmNiVKz0RNPER62elqqs09Flbq8DjdnoHIzGDakC/ylp UMx8+vrkpnUwhCpsprKk8S/om0NxWIDLScva+fENQHshpYS1FjMEv2pwR57V2Whkv9xI 0Tbg== X-Gm-Message-State: AOAM532t/mOh/KE79ky1n6a7tjiHLhnPh4yAq6pxCR7E9j5phxTiv5dP iVRBP0n/nR1yXlouP5Rlj3fkf/fPTt8= X-Google-Smtp-Source: ABdhPJzwjrftEpDwCSkGeYtZnsb80uf8lmLT4OWpMtZciony9fj18ZO4B3OADvQYXweQahycvhLb/Q== X-Received: by 2002:a17:906:2756:: with SMTP id a22mr7902925ejd.81.1605632027978; Tue, 17 Nov 2020 08:53:47 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 22/29] scripts: kernel-doc: allow passing desired Sphinx C domain dialect Date: Tue, 17 Nov 2020 17:53:05 +0100 Message-Id: <20201117165312.118257-23-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::641; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x641.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- scripts/kernel-doc | 51 ++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 8 deletions(-) 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632461; cv=none; d=zohomail.com; s=zohoarc; b=IAf6daDDfOQpfutNlEGo1FYQk8W45BncUSGGbfcUgr6JEreuv8X8Gr63cdkV+u6kq7MhRxxcP+Sizho2Yp0XN73RPTgZDtlFr97/A46BM4tcPQzq/m3sKdTVTcSJ4VYgWpA9isKJYEQs0EVRcy8fy6r1+sHZWbve9jW7dv9p61M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632461; h=Content-Transfer-Encoding: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=l8OWihoDLGOUB+IKO0uLTru1BYpQyrVbsBOdCF81cxk=; b=XfdxYIsk5IZcqlDYYVoit6jBrIP6MztTx559TzaLs2QIomPziP3ukXdbaJ0mm/PW9B0CTRLGgtJMKjoMAKbhydvscxJ5jLTJ7Tvn7dpiay8iKC7iccs9o4tbwfCRjwLlLUTnzDOth5aQkllmU9DhTkGHNVrv7jozL6G0Z4wlN8M= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632461201653.6310783860536; Tue, 17 Nov 2020 09:01:01 -0800 (PST) Received: from localhost ([::1]:44404 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Li-0005mP-Vk for importer@patchew.org; Tue, 17 Nov 2020 12:00:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Eq-00030b-8Z for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:52 -0500 Received: from mail-ej1-x644.google.com ([2a00:1450:4864:20::644]:40281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Eo-0007FA-HA for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:51 -0500 Received: by mail-ej1-x644.google.com with SMTP id oq3so30380289ejb.7 for ; Tue, 17 Nov 2020 08:53:50 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=l8OWihoDLGOUB+IKO0uLTru1BYpQyrVbsBOdCF81cxk=; b=PIIM6+VKREMAfKDyQXJyn4jNTiGV8sVl2T1wfMBPkZuGUsW4MU6SVcT/mACmUsGCLb iTnzTJ5/sCm6CZLBLf+Ttyhm3Yj+XR9d9KglOFSwQheUC0nGQ7CnsskU9bJtPx76HnNq flQZXLaBAwzAEC13xGpNgU9hgPCeUN/0n1vCYYLqJy7A2q4wWCBmEiB5sXmkBTaJhV5/ bOc+FqXnoTy4+sFhKglBZrR94PgrNCMJBAISh3+5Aeqa5zSHV6AAOsn1J9qiehZxyr/Y v1b4/z/fIl7fxJ6r9n13IyiuTr4miSJZSCQDSUkEKEEj17qdlzhlCQk59H2hS0omo83F cyGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=l8OWihoDLGOUB+IKO0uLTru1BYpQyrVbsBOdCF81cxk=; b=uf5DmNZx6nb6Hb9HM4axyO7/t1P3xteFpbOuCjT0WNOZTfGGZYSkPSA+2+KF+rElql IeebVrgxos7jS7K6UdAt3G7vh+H8bjcHo+pGLzGlqeOUiBO+ikMrSoF1bCmcSQeZFsY6 ahkkQCLRKDCst1aL1S+e5eACKTX36Gsdzx3QY+gtdRFynRKBrlbXqHxp3MoTyOX7ossW A+Hf6B9x+Mg1WsLUk8eMUCRnC3UHtlujUG15PPvOzG0rTn4HHMPP23lrAkCpx2wQoL3J aGXeZSvk2L0OyQQTjBwDBPZxMrTA2sBGw+NWNop3KXnIj4y1bO7uVbC28XKKScOwJ3mU 7ZEQ== X-Gm-Message-State: AOAM5300EjVycNz8zr84xIKX1rkYIchHnWAmiPD65i2uH1Id8JjPimxk KBuceROx6+gY4No7W66OQ6xoAucakW0= X-Google-Smtp-Source: ABdhPJxsbijP2ir7//8TSnM+NbEWsv3bgGGVTlfZHJ53K+hyztJTOmlITC9ShhFSz6jku3bMqeFHzw== X-Received: by 2002:a17:906:36d9:: with SMTP id b25mr2568850ejc.155.1605632028951; Tue, 17 Nov 2020 08:53:48 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 23/29] scripts: kernel-doc: fix line number handling Date: Tue, 17 Nov 2020 17:53:06 +0100 Message-Id: <20201117165312.118257-24-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::644; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x644.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632745; cv=none; d=zohomail.com; s=zohoarc; b=g2Iq8Bwd6mdacjmaCkG3eggoMvSnxfSE307eQbbtYHUfJldtexhsGKLM/3U2XSzk50a5RCEbsXocWYTOuu4oEDTSQtD1ywgqMdprIU1GWT84DD2RZS/c/BjpvIyCnyGYEdS34otoRx7CXOSsp7zAr2i/SSvNHOkzxebCp4VRJl8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632745; h=Content-Transfer-Encoding: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=ryf6omjdRP3QKleQxuXUTo2JT7FTp9P5wBUuqReBuz8=; b=Xhp9vaW1v4udiQj1CBq2tDIN2ZD07yJNOkfgdN3zSoxZhlAX73XxTtHdTe7MfUi87LhhRTsB3PKZaGK66xg+wfPlGu/5eSfcbhXQuW5LfNu68rOyNuCprFLLAMFyrBI06596IPU1961paHBlzDBetByLNf01fmnkMfHzIqIURK4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 16056327457401002.3806843437839; Tue, 17 Nov 2020 09:05:45 -0800 (PST) Received: from localhost ([::1]:60540 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4QJ-00041z-9T for importer@patchew.org; Tue, 17 Nov 2020 12:05:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43806) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Er-00032C-Vo for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:54 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:41163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Ep-0007GA-I5 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:53 -0500 Received: by mail-ej1-x643.google.com with SMTP id gj5so2911885ejb.8 for ; Tue, 17 Nov 2020 08:53:51 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ryf6omjdRP3QKleQxuXUTo2JT7FTp9P5wBUuqReBuz8=; b=gvYl4B09s9rdssuKsWHn3EgBKNQztmmbriK+/Wa87Zu4SECdI+cQSnbtbAN3vaN90U 3huXnUejKoCGBPn+AzbL0NVw++q1SnrCjBN/QTWrG2WG9V87kJNXiYDLaeKObQqbUFLp XGZWLRXICgdqiuBlRx0R7odaV8tunXlUl7UlI5qEMjBtrGYC9YYYQyVEdylNfRl3DiHD KF37EljQPTD9lF6GhJ4EnPt4kpIVPU/T6M6wiqHExeZcRKpHzd1IxM63e8x+LpHx/j+M 0s7I1kXnFHAvRH4nkwgHxg0UY93z3uJdn4C9JWCyQB7rx02QeHdCbnHk0h+K2BfNawIs DDPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ryf6omjdRP3QKleQxuXUTo2JT7FTp9P5wBUuqReBuz8=; b=Q4SKFZXq4hcNGTh6o19IroGzNFlJXQtqMCZiKkW3iSS8egLual4Z3uV8QcOr0mr96r MRUZKTd1qrl55ZpSj6+ukXLyOErav8JNd1Jk3Gwn5WSRW7pm0AyCcTw9inhoQFu8nQRn Q0FZu8mDN2XPUd/Izjw1IEnXca8dayP0LV/2JoRv+5feh9SoFCzMDnleI/ex2KM0HSwG kqF6HUxztB3te8mFgpaPZMD4ryF/RdzRbfT0RFir6FL1QXRLapcNKP1hGtzAbzIt2MYy e3oCceOShP0XL6Goa4wpTqTftweu/ylWRDgrJ82jxnJxGBRlT4y8z1pmH4k4kK5MEFPR BzJg== X-Gm-Message-State: AOAM533CvYRH8mzN0ZkIeeZ3trZ/wHdHehoLT98PmGIIIfWtVL7L70DK Cq3V0htO1uWhSWY+WG79j/0ZDsWyLCQ= X-Google-Smtp-Source: ABdhPJyrjU4GOHFYFgmnpu3VZO23R6r5+pMAmJPaLoHphEGoBIzPbZP0HOifm4fEfV1b/5Ow92HNSQ== X-Received: by 2002:a17:906:892:: with SMTP id n18mr19578559eje.1.1605632030002; Tue, 17 Nov 2020 08:53:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 24/29] scripts: kernel-doc: try to use c:function if possible Date: Tue, 17 Nov 2020 17:53:07 +0100 Message-Id: <20201117165312.118257-25-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632862; cv=none; d=zohomail.com; s=zohoarc; b=B3j+2KjsjSrnlKzcq6HnDF0fOC7xnE0FD5/g3n/x1Cx6GyUGmfs0DjWFuDB6uAVTxk4yXKcov2DhE4bYXydrCrrt57g90cqxPGTEeFBlYv48h5zD8RrUvGXPcBgyWEyxPvRqY89FaUBzXdR9ODgOwDCNIYelg0Aj5AnUChb2MGo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632862; h=Content-Transfer-Encoding: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=8iCIsS6iawpdK6Fw8H0eciTPNsaXNfuGScuB1cNwv4Q=; b=EoaNXrbNgnWBQIpkX0eHkhKv4LB13SBzMV+RdsQ+DXeEqm2rPNHWxNZj/HeuVxbXNwH7b9Y09jeM493tv7MTgoFheWonEh0jiYE4ZdRzP0vVWLe0ZRf9lgbXunyBj115CpWj+PeiVkGB/vzfPSXVM02Dlx82NEQ/y0y642kqQ3k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 160563286272250.2891914090369; Tue, 17 Nov 2020 09:07:42 -0800 (PST) Received: from localhost ([::1]:40640 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4SD-0007TD-LE for importer@patchew.org; Tue, 17 Nov 2020 12:07:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43822) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Es-00033K-P7 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:54 -0500 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]:38820) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Er-0007GN-3K for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:54 -0500 Received: by mail-ej1-x641.google.com with SMTP id a16so2630405ejj.5 for ; Tue, 17 Nov 2020 08:53:52 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8iCIsS6iawpdK6Fw8H0eciTPNsaXNfuGScuB1cNwv4Q=; b=BUfDXxRQpHAxeJStCXJwMfOD+Z1c0ypMLkhDrZNv8XnfwlTPvQYRi+j8/2btF8auEi /mlYnHltJKbs5kitmebDgtlKaldgQtfs29rCY6E5kGduSw31nYPhZXAxUWIIClXsWsVx 03VMnoUZsl2ZGQ3jZD32s7ZikTdIMZtJPffxW+2rXq7WRKX50+5vExgSfL8CYR9t+kax Z/f9zvMj/mjMuU2NtWfFQMDbvzNT1/A4+0MQqmeZT1CvkFxxVhfP/gFpBem5Dux0pBjc 52gl3h9fXjOxgRnC4Hh73EPTpjUOYJwv4LKv0WiERnD1E+A95n1bUE9uKly16CnfOPAy XGdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=8iCIsS6iawpdK6Fw8H0eciTPNsaXNfuGScuB1cNwv4Q=; b=pyIc1FB07x6UdiBeRHWbfnbklisWRgTKnnVpeFOS8B6SGQ5B2e4t6bkC61AL1MI5L7 tJzOatCHo6KPjJY1bmRdfVpHB4gEX1q6Nia/wKk825jsOPWsXrAaFpkxxx9cZEefDe+p xcec9H/gpVkOg2llkHhtdrZSOrNMG7SUhYZ21lWLggVe6Pd2v+n+t0TjJfC1I5OLWvxq rgqM4IDTpwK85feALLYrqSoErJp6T+a04KVS2aNffmaahP9Cc8cLSTLih1oJrwII9Fpl Jri+q0n+S58Dd/YLBEc7S3XPzrk5DQn9rUcB0/SIa+Lm2dfMFXx82FHih5w2rJgn12SV tz9g== X-Gm-Message-State: AOAM530LBAbbL6rw8LA0CP/kQNHdRG2pixL8k7H3jzjjoSBnjKbgrXvY LU7VmI7BcYI4GMcEm7R+3knplY3YlfI= X-Google-Smtp-Source: ABdhPJzT/EB5ZJN2eVWmVjte7wkqVCmpVWRmXiYtSonRLCC2dsuGswierfDUGC1fQ+03OBawBE+Zmg== X-Received: by 2002:a17:906:6013:: with SMTP id o19mr19585693ejj.348.1605632030933; Tue, 17 Nov 2020 08:53:50 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 25/29] Revert "kernel-doc: Handle function typedefs without asterisks" Date: Tue, 17 Nov 2020 17:53:08 +0100 Message-Id: <20201117165312.118257-26-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::641; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x641.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605633160; cv=none; d=zohomail.com; s=zohoarc; b=P3hgL62nFrVTSXWe/duhzB0hguxdmjWwOY78jRnb6nv9x/fHZ7ITjjxxINu982a6huJ+++Qpii8181V9HKlJbYdhnIqaofBlaedGMzvXSoyBI/WaqG8NOTxWGnu1BjizG1rdyW2SbTF36sZyEg7+cldNKJdOm7Sqce4E9R0GoEk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605633160; h=Content-Transfer-Encoding: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=MtelKqLZh4dFsPBgnxF0HdQsyjUnFNYeWjU1dgG+VRk=; b=V8uEDipdIFFkYCWtD16UyKuuHuTeXvCxY157iE9vJUrC3AmVQehnQaSUh4/hp31XHeih0jgPj5s1An7pyq0vLXGZdD/73VTYtUeZjcJLwuzf6PEI8tQXpSqBMlrvt6pGzSHdJQXp2Gc8tfsl5H8RAE1sOQAPYj1Sh7pmhPJFBaw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605633160697566.3571216011446; Tue, 17 Nov 2020 09:12:40 -0800 (PST) Received: from localhost ([::1]:59804 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4X1-0006qE-Jn for importer@patchew.org; Tue, 17 Nov 2020 12:12:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43824) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Et-00033c-5A for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:55 -0500 Received: from mail-ej1-x643.google.com ([2a00:1450:4864:20::643]:38822) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Er-0007GY-HX for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:54 -0500 Received: by mail-ej1-x643.google.com with SMTP id a16so2630502ejj.5 for ; Tue, 17 Nov 2020 08:53:53 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=MtelKqLZh4dFsPBgnxF0HdQsyjUnFNYeWjU1dgG+VRk=; b=otzhKc24ftE4TuOMMiA57FfCRGYzgu8zcYUhndgfy7eHtHZf8al1kgYWePpEGNTLbo wT6RTQf+ZLSNW+0L4Tctvxe1AS8ykCwd0USBIPPR+k60FprD9tJ9Ef4T5SkpGmnIW6mK /WHvNil5AH9dIFTicW+ITUhPZIdf7ryBsSO39SNaVoxorYGoaFbvTXT10Sl2pemj7Q7s uSk5aP2Dys8W/n1ZHwUyOeY6LtN+L7jHguacKF+RphgHMJrz8m/FTis4iZOZnH12lkuB XWKQlWUju6jdh7NPEmHv2p5yf/C2DI//1PhuFHDTnJ2f9Mw3KsHXLSDygh3dUOPjmDuO DpvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=MtelKqLZh4dFsPBgnxF0HdQsyjUnFNYeWjU1dgG+VRk=; b=r+lag4hZlrP96aVy1WtiByNVxxWL4l5/DHTYV5/HzrBbSi92vKQCHJcuPy7L6h8R/e BzausuZ7Y78qxifA2bTX9P5e1WuyPTEaRWGaOY5uRAwY0fo5jRGBtwgX8givi+v3GULe Wif6oUGfhInPg/DUsAkrZSXmHPwa8nTIeTMqiE5rf0x/xkEJKb6RjNxEoFJahOhy/1U2 H4HDU78/cKUtWIsdxWWeLbrMupEQA/53uraEqmKo/LDHC/ZYSFWl5Y8OtCof0XdPy5W3 IdLnn5a/h99dQZ2JINiE864AxEF49pvkb+9ja1PJ0JQxtk/pwgswDJWvHDSJo4pqgvzA Pbvw== X-Gm-Message-State: AOAM530mH0LBiVrAciXDYKuiLyVhHyKLOAZVy9W+I8Vc2i/G4qLiOMSQ sypWwAKwWlr8dDdT8QQ1x+p1gBnKgjk= X-Google-Smtp-Source: ABdhPJy4DAPN2S3C681sIu74xowUUge9GNL8NHPjx7zsSGwC3E+Fap1gntJgONrr6YTX6OkCQsjAXw== X-Received: by 2002:a17:906:ca93:: with SMTP id js19mr21281011ejb.537.1605632031930; Tue, 17 Nov 2020 08:53:51 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 26/29] Revert "kernel-doc: Handle function typedefs that return pointers" Date: Tue, 17 Nov 2020 17:53:09 +0100 Message-Id: <20201117165312.118257-27-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::643; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x643.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632613; cv=none; d=zohomail.com; s=zohoarc; b=AtJQo0hSMRUOzoIvpckd8gKroAFomoBT+mlW0+L2fKOWrcKReOyvblOspW66j7fQJxX0rZmd+cRLJ0yOjXGmPtYZsfhNivKpzxP14J2oHyujEyz3btS0DnR53gGuxfTIDBDPVDefWq1S7C1XQjYzbOiJx4YdXG3DU7bpMpih5FQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632613; h=Content-Transfer-Encoding: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=0hpNhB+71NE6300hqz+D0elj2q3QPE1W5PnnI+BNNPw=; b=jNGbGW2JMS4c7kxQKopyrB4bDGx79gNlR/Uj4N+EOtefG2eGFHmgAvmApqdfQpx+H+lYiKcKPlnnOjs5BFVCieZOtNJzKXD+bw1dWJcGsA7H8Xr0W2lq8v+u8XQhhNxCpFnFPM9+ekYq73kaeRU/rP/bi0b/atADuibzSWDfSjs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632613046159.88937552567893; Tue, 17 Nov 2020 09:03:33 -0800 (PST) Received: from localhost ([::1]:52790 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4O9-0000uh-MR for importer@patchew.org; Tue, 17 Nov 2020 12:03:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Eu-00036O-Oz for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:56 -0500 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:38265) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Es-0007H9-L7 for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:56 -0500 Received: by mail-ed1-x542.google.com with SMTP id y4so17364967edy.5 for ; Tue, 17 Nov 2020 08:53:54 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0hpNhB+71NE6300hqz+D0elj2q3QPE1W5PnnI+BNNPw=; b=W+7WnU7jvKgxvRXF8ksUHmp3hWjLQf1xnuWrGyTMKVIJTRXCIJbNqY4uWhB51U9BBd jeE9TmBfOWjlMmg1TPw09EhJG+DyTFHIFm1RB2PiarWL2lUPTz9MWGGKvg3F1mCzI7gD PiqRksLlOEkCy9P/f1E19CPur6aEWlipDadt3TKy/DdRWH4A5xqgVsMU9enKRbjCQSXU 8fpKN0Yu+LON7fR+cgPkwzMWA/xt/y5fEeOXcPRlyY+0FTXdSIZ3IakX096aeMwbWw2f wR3y6Rh+9RiZsBU3zW0qyu9PROlnoXYKPb8xKceVU4hM2dZBoTH+JVjwgqAerYVd3IxR GUmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=0hpNhB+71NE6300hqz+D0elj2q3QPE1W5PnnI+BNNPw=; b=qwP/C/GVZ9VEcNbMFOTgz6WK+WCDqg8IzJyfWP4e4XQ/TUQtaI1oTv/2irJxNARl28 AjFEe7zafsgwdL3XtHypwAMNIQt0eaQcIgOTXwlJUjDhBufYOkBIqRCL9xLrDTRRC4fx PUgjz1pE50m1WgV6yB571DkUh8pnjbuxCINgcu0nFLOBrLiWVMA707XitAFug2JvvEuQ DY/fY0kvK9JjECZqflvWR/WFzpX+4pgwh+GcxTPwkemHR0VAuPy3sTLeG5jqCF+A7rUJ GgewQTmlooqhIjTSIItBIBDuERy9GTkeaYuTAmN/HsjyqT8QPpSFiWNlnkPbVeCddVhD GQsQ== X-Gm-Message-State: AOAM530Ln16tHQzqsOHz9E9Ty1YSFzmjM7u23/C7IzS1QbRQPsJSZ6gS vpsgJIbqjVWy7Ke/Q8eOLT4EuSbf3ws= X-Google-Smtp-Source: ABdhPJyy75BWfKEy9/G9uQDhf4fG/QNQXeG0yhcgVKyHlqeuspHz8Ts/0E4PtaWnRPnhyMlv4YBKaA== X-Received: by 2002:a05:6402:a51:: with SMTP id bt17mr20774118edb.328.1605632032876; Tue, 17 Nov 2020 08:53:52 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 27/29] scripts: kernel-doc: fix typedef parsing Date: Tue, 17 Nov 2020 17:53:10 +0100 Message-Id: <20201117165312.118257-28-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::542; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605632765; cv=none; d=zohomail.com; s=zohoarc; b=A2jAsSASF+j8aWg3XC92JnbPDT4Bo3isjWpN4qrImwRKD2A4iJxsfL3uoNQ5Co6qXyqo+WDvAOksfqyTqvwY9g2QH/Dr2Kur1q6CFrsDU6CNLKSbx8un8Sq6gbLTCUEBM8jDnxFpIcOv4bXoA2UgRloVAJgqcI2eSTyXQupal+A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605632765; h=Content-Transfer-Encoding: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=R47RebFwpB3UEbuBQ1d7o5hCrsXuVfaPA/oJ9sZEmas=; b=c4l7oENgAM5Qjie+TjQLH3I4zZhNGMV+i17BC3ZiIr5GUKa6LxOkWy4mYmuh3mjqBz3ujjDaJ1XYu9Ty8c5XkRAltQOf0MTXbjca0ax4D8H8c8td8YNh06Z2TUW9J843ZERZGfP9+Zk6L5RYAUvZWl4ivAXi3JMCluI0U6QPVZE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605632765373849.0007989128426; Tue, 17 Nov 2020 09:06:05 -0800 (PST) Received: from localhost ([::1]:32952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4Qe-0004HZ-27 for importer@patchew.org; Tue, 17 Nov 2020 12:06:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Ey-0003BP-6r for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:54:00 -0500 Received: from mail-ed1-x542.google.com ([2a00:1450:4864:20::542]:35455) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Et-0007Hh-Rk for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:59 -0500 Received: by mail-ed1-x542.google.com with SMTP id ay21so23235873edb.2 for ; Tue, 17 Nov 2020 08:53:55 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=R47RebFwpB3UEbuBQ1d7o5hCrsXuVfaPA/oJ9sZEmas=; b=uF7RfRNf1GzkYoPY8pdmN1kz89FV3XNtfswSJKZQJaCWqtP1EC7nI/+Or1wsZJ2ydQ 27Sjql3nI0lg/wXssWba3J8k2TTSNjc9+3hFvHDtvXvhRyzFOw+iTaUyGx2pXH3c7bgc Jv9anAN8NcCODhUxaeEcDoZH5NeLjCgI2ZAjPt+cJYy+BLdBWCC/ez9nxm9iZYQxA06L C6xnx5uCpCydJE/VCTrYR9PZZoSa4BgNIgfcA+XnPDHqLMkcRW1kcPnoklVYRpgCgVuJ l28dgzuKeWdPM6/HQEAwCsd39IgAWAL7tcUPJl//owCHj/v+74FGG4SmImZ7jp6gtBQA VfkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=R47RebFwpB3UEbuBQ1d7o5hCrsXuVfaPA/oJ9sZEmas=; b=a2tAqVS5Sh1dosE4ni8tb140rSQfDbSWTq6H3V+q2Oh9isIepIcnVk97gWaAqbRcFW rfmsCBrjpq5jKFNFuzmfTKWxZgNeuuDSyzcKoPN+NgKXOElxWHEbeLl/Rg6u/Nu2IJOq /FFrXJh7gapjkZp88Wj5TDkQgG3pcKpMZ+ZsgYwJ6m1d+niBEx7c6gWEVLJqvTYrRrq2 1h3VKJc6GPr+WwmUCpdm8vzyuH7hwXimWwOmARA2h7lCbW3gfWb3CAPgraCH1pm75Xe+ eY+oj2FQa8v4YBOqeSOF6q5X3n0KkyW+O+09f4R9M6dJIrd7xE3x6HEmw/6KWe2adLtu hS6w== X-Gm-Message-State: AOAM531qTap+Hb05aGQ0dBQSbzRLxeXcc6YAfbnmfJZa0KXH3lrGpZI/ V/8nzKwC6XQTWWDZJE8xpSV/KPqRNxw= X-Google-Smtp-Source: ABdhPJzp1qwegibNoNzvP/K13GXwzJ2FWPHg47A88LzFiPeK/wPua8aYrsi9AMMNY0Zd+4n5p/Csnw== X-Received: by 2002:a05:6402:c83:: with SMTP id cm3mr21534049edb.189.1605632034114; Tue, 17 Nov 2020 08:53:54 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 28/29] scripts: kernel-doc: split typedef complex regex Date: Tue, 17 Nov 2020 17:53:11 +0100 Message-Id: <20201117165312.118257-29-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::542; envelope-from=paolo.bonzini@gmail.com; helo=mail-ed1-x542.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0 From nobody Mon Apr 29 12:07:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; 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=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1605633100; cv=none; d=zohomail.com; s=zohoarc; b=XybI9KtrSHmklamak2E1c/UbcIXFW63RwxqH3Jf7DSbKsHoWgVVJUJ2KxJt8vgiNWx6l2fPzxECS7dqAzvFBKAUAxFEQedsSuV5LO8nVhTCj9UcRHG8JLyIyVrYp2AAnDBgzkSbSYnUo0tkR3dsf1LBCWNHEVNO6aX/le5v8jdE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1605633100; h=Content-Transfer-Encoding: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=ax4JFkEmtB9bFkwgtcdzLquJHfwUo36YwYi9uzfBSKY=; b=mfJggsAWqXrR5eUJiMSDgYuDQyMP2uj4lqZmOMLuP/mcAzOQlmxKXSi9PGmrLCSACA3C4+zg6i7GCX6/EwGelwvwa9oTyV7TpfhrLvpe/Fi7buByiiY68+qJ0Wy+gRCKjTy0TdNe8NzqNzuWxASGCA0BsyfBZrfR+r8jOGRfIkg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; 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=fail 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 1605633100568720.2738923757099; Tue, 17 Nov 2020 09:11:40 -0800 (PST) Received: from localhost ([::1]:57100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kf4W3-0005iO-20 for importer@patchew.org; Tue, 17 Nov 2020 12:11:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:43868) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kf4Ew-00039A-LU for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:58 -0500 Received: from mail-ej1-x642.google.com ([2a00:1450:4864:20::642]:42192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kf4Eu-0007Hp-PC for qemu-devel@nongnu.org; Tue, 17 Nov 2020 11:53:58 -0500 Received: by mail-ej1-x642.google.com with SMTP id i19so30379426ejx.9 for ; Tue, 17 Nov 2020 08:53:56 -0800 (PST) Received: from localhost.localdomain ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id u7sm639067ejf.83.2020.11.17.08.53.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Nov 2020 08:53:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ax4JFkEmtB9bFkwgtcdzLquJHfwUo36YwYi9uzfBSKY=; b=NJKHokCZvr50w62/FWf4TTt2ZHDVEgZMvS2nxl/1AKTd7YYghIdNTsM926Lg/bXAGa 3BkhOVHOSWgu17AVQQiouh9qslkK6DNxgoG6Sc+GNplyB0EP7jQfxHQSIOFaEwYZ8DsK Fhsrp7FVtBCfZXuABq4WL93ilnc92RSYLg40+lYIYrxDP5YYQmYXRfxVa0GqX/U2Lhl1 Vjgr/XJwKGDDY/ByLwRu/ylAWfhOxq++W8UCpwp5ArAfVVyJUSvVJ/CI9XheFsFoo5es oV0nic+zOS3E+yI9qp1r0qDjf7PUXTmHjg8W6KaRA/0fkQzBrF3Q6dULbjWDyP83R9/R sGPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=ax4JFkEmtB9bFkwgtcdzLquJHfwUo36YwYi9uzfBSKY=; b=KKduinzOEnBQ+GnDUTVgIy+uRI201rcsIyHJwJznUOFzYePk+CIFim88eX1bKNaoqN YpPXpvOyt9DI3BY05QiM83zez6AM7gbmCB6F2ygIUsl92IVXkhZRJXsIrSeQL4qzRMoE pC537nYxUNefi+Xsxd8yLnpjAyVN3WMRpRuf5iaSFP0fPw9qLk/CuPiUKedX/Rf/053w +LJxtsrf1z2pgCjESVVgx2eNUKLzOLMyplHBN3Q64vJlqexzJC+Fz6YQzMgZ5m6y2DBq 7uJvEeVuIoyK77B+VTFzDJg6ts9/oMwJVic0c7wZxRrQ05jiUjgSF4MT3C0TiG7eJrUH Ckag== X-Gm-Message-State: AOAM533FINWgup55O5a/QOfcUlQWmjqQMGodeJkSu0e4egttQ8LCIZ8Z W/dYdwAxuSBOluZs2LK7+PAdRsxfJGY= X-Google-Smtp-Source: ABdhPJzwWLy7KVpTf74wlqX1A3l0afNNpHOn/YQQ11XyGpdb3Pp/XwfMgpkXMl1n1fOBvmjKR/LOcg== X-Received: by 2002:a17:906:e2c3:: with SMTP id gr3mr19653166ejb.471.1605632035158; Tue, 17 Nov 2020 08:53:55 -0800 (PST) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PATCH 29/29] scripts: kernel-doc: use :c:union when needed Date: Tue, 17 Nov 2020 17:53:12 +0100 Message-Id: <20201117165312.118257-30-pbonzini@redhat.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201117165312.118257-1-pbonzini@redhat.com> References: <20201117165312.118257-1-pbonzini@redhat.com> MIME-Version: 1.0 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=2a00:1450:4864:20::642; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x642.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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 --- 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.28.0