Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp5248197rwd; Mon, 5 Jun 2023 00:11:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hld78/KwwRDD1RMysj9qg7Oh/+QLx8AL9lwAEQLsfKccDtiGZXzs4Awc8xIMv7n0dKYmA X-Received: by 2002:a05:6a00:2488:b0:654:3dac:f107 with SMTP id c8-20020a056a00248800b006543dacf107mr2169429pfv.4.1685949093020; Mon, 05 Jun 2023 00:11:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685949093; cv=none; d=google.com; s=arc-20160816; b=jeFPh+tuWXBqziYrhKkzD5ZD0ZNtaCcqGJU001UZBZUgCTKk466iUJ0e1+PeTODHZZ odxti3UO2A62m77QyjtQAGAkT9R3HJSNIc8yA2wXMa1OLTv2NxJAaVmYccwCXOJ4+hvn gC59Q7VFKQYo0/dfribpyORX9oPhhJD7/xAuQrFvrRXD6PW6pMgIpPCJlztLjpam2/CZ Ko2eMrtLQmu06G2mpnzoKpBTNy7tU3/epYaCYlsWe0Yy+bfRG3+9pfPx784xRyre/IVW u0Oovk3y17Lmu0YJVx6xXg4XJYu8G3TYSGYXQSnwHVhoBOwdVMwK5SnMlwAVMg04vMdO 0iSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=OZfBGqxcmfrO+pJvAmBTMskX0JCCxkCrf73Hbad1qlo=; b=g3phYlgi2Hn7imtGMaFtv+7Swp8nxKGrlaYmL5neAQBu3YViLp2jbclx/jjZk9wfn4 xRBIA0TcNmPQJ12+Jp7R7MMq7pAzb+m2icaCL4kRTIkeuVw4KUVumPJUqco2b9hUM1Yo DvQ1JhgXk4KQYGF37cA34nIWd4XtDnBb6zrKH7i+teevK8VmRB5wWw3ba/PY50DhYFLw Xm6srGU7Gf9lHH98dNfeGEqC3lfIuK+VQg5SYDSuRjUOJ+k1F8EBZD/U6SkbTMJQr9At urPG0IUsDDfk1AnJdkybaw9W36AAcQLWd0KMcPd2JSo7TSCgT6p6eWF8WTr7ktCRq5zU +fog== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p6-20020a622906000000b0064feff26183si4894635pfp.3.2023.06.05.00.11.20; Mon, 05 Jun 2023 00:11:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229512AbjFEHEl (ORCPT + 99 others); Mon, 5 Jun 2023 03:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231180AbjFEHES (ORCPT ); Mon, 5 Jun 2023 03:04:18 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id BD10710FE; Mon, 5 Jun 2023 00:03:33 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2BEC11596; Mon, 5 Jun 2023 00:03:23 -0700 (PDT) Received: from lakrids.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DB3913F793; Mon, 5 Jun 2023 00:02:35 -0700 (PDT) From: Mark Rutland To: linux-kernel@vger.kernel.org Cc: akiyks@gmail.com, boqun.feng@gmail.com, corbet@lwn.net, keescook@chromium.org, linux@armlinux.org.uk, linux-doc@vger.kernel.org, mark.rutland@arm.com, mchehab@kernel.org, paulmck@kernel.org, peterz@infradead.org, rdunlap@infradead.org, sstabellini@kernel.org, will@kernel.org Subject: [PATCH v2 24/27] docs: scripts: kernel-doc: accept bitwise negation like ~@var Date: Mon, 5 Jun 2023 08:01:21 +0100 Message-Id: <20230605070124.3741859-25-mark.rutland@arm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230605070124.3741859-1-mark.rutland@arm.com> References: <20230605070124.3741859-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In some cases we'd like to indicate the bitwise negation of a parameter, e.g. ~@var This will be helpful for describing the atomic andnot operations, where we'd like to write comments of the form: Atomically updates @v to (@v & ~@i) Which kernel-doc currently transforms to: Atomically updates **v** to (**v** & ~**i**) Rather than the preferable form: Atomically updates **v** to (**v** & **~i**) This is similar to what we did for '!@var' in commit: ee2aa7590398 ("scripts: kernel-doc: accept negation like !@var") This patch follows the same pattern that commit used to permit a '!' prefix on a param ref, allowing a '~' prefix on a param ref, cuasing kernel-doc to generate the preferred form above. Suggested-by: Akira Yokosawa Link: https://lore.kernel.org/lkml/a5405368-d04c-f95c-ad18-95f429120dbe@gmail.com Signed-off-by: Mark Rutland Cc: Boqun Feng Cc: Jonathan Corbet Cc: Mauro Carvalho Chehab Cc: Paul E. McKenney Cc: Peter Zijlstra Cc: Randy Dunlap Cc: Will Deacon --- scripts/kernel-doc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 2486689ffc7b4..eb70c1fd4e868 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc @@ -64,7 +64,7 @@ my $type_constant = '\b``([^\`]+)``\b'; my $type_constant2 = '\%([-_\w]+)'; my $type_func = '(\w+)\(\)'; my $type_param = '\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; -my $type_param_ref = '([\!]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; +my $type_param_ref = '([\!~]?)\@(\w*((\.\w+)|(->\w+))*(\.\.\.)?)'; my $type_fp_param = '\@(\w+)\(\)'; # Special RST handling for func ptr params my $type_fp_param2 = '\@(\w+->\S+)\(\)'; # Special RST handling for structs with func ptr params my $type_env = '(\$\w+)'; -- 2.30.2