From patchwork Mon Jun 5 07:01:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Rutland X-Patchwork-Id: 103115 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp2500654vqr; Mon, 5 Jun 2023 00:11:03 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6f1TmGPzMA4PzZ2XmQk1dXgz3Ivpc9DXW85MEETvWa18uUaCfpKSWuedU8xstMlHGQQFDR X-Received: by 2002:a17:902:c1c4:b0:1af:f8a8:5ba4 with SMTP id c4-20020a170902c1c400b001aff8a85ba4mr2104833plc.4.1685949063175; Mon, 05 Jun 2023 00:11:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685949063; cv=none; d=google.com; s=arc-20160816; b=DIZ6qCTz9I3Ww43/ktwYrJ3pP7FqqaI5kR7mnykaSk72qsYZCEaaScnNPMhKnoitnP skn07ZfOudqPzKkS4Rle8NKqx9HBTj9FychtkJ/qd7Y7PHC7ZmC4iBxuG7oo+TEvUxqV +mHPD0G6Y3LxvjfcaXMybS3t/u8iP/ya96uGkjcMwIvM3eQmW4Q7ub3NkmtrBv9+V4oF 2nDDM3ze3Jeps07TJe4QvoKeqY18jwtLhtOAUY38e5vh/36UytAOtoCs+LqVymu7EWOS 6aVzQmGcIxoGNHdcc20CPPsN96eYKK1cUVmmx+j/BdFIi22JKZF8tyl0yoqt26kr4smt /Ing== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id jb4-20020a170903258400b001b063904086si4821476plb.628.2023.06.05.00.10.50; Mon, 05 Jun 2023 00:11:03 -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 S230490AbjFEHEl (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767845724808684027?= X-GMAIL-MSGID: =?utf-8?q?1767845724808684027?= 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+)';