Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2265759pja; Thu, 26 Mar 2020 12:17:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv7EuVXvsKmsEO6NiUieBx5VZ5bOWrzlsD5GtFdT+h4YEmiW7F7ze8Ft+Rqo1vvTJ9B6kkA X-Received: by 2002:aca:d9c1:: with SMTP id q184mr1352282oig.6.1585250272576; Thu, 26 Mar 2020 12:17:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585250272; cv=none; d=google.com; s=arc-20160816; b=q2NJJqqmyulwtEaOaxrOufa82hL0ZE8RdMwZm8C8xXwNkbEnxMRDWn591UJZGw0yw7 s0QoMFNtGmMNQR5JXPO+jikrKcwc9CdCAuOnH//lWYYKnulLF+8tU464ILT4Waj5UsbU JA6oR8zmy16JbEohOLbq7oFkLY7ACTi4qZqE3b5Rt894v0UBsZpoKnQLeJ0dLIYzLQHl wEjDL6yel3Epc61U/4gIcnbWGGBljB4vPhl0egURIbHJ09QAIwJWmVjp0dH8CY4+m/Qy 8wbnYjlqmqAOwMnzv16NT3WckDzbKXHVh4RVc84PhkW3W252jHKd8/9WWS7+yWN4rj+M rgLQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=LOkAo6NlFzNUYPD7rXz5arEXk1MfU3hhDOd6VpTqTLo=; b=NqO4a2GPiW/QweTCrIYjqrnH+ZvK01Gl69vDdsYhQ5tU1uMz3u36GFjt/USLt9iRTB WVOSj/k6MG4P1e26nT+6iAqg1uucszmstJhtZunNnw6TvRhuTQLZjG4oFQEGKL7SgcJI tlpKfSw+jeNGI2QtRxenf9zvVYmy4twb+P46AMwh5jIHQAjKX3jYAx05Ra+1rRYJ5F4n +UAtSLGAzOgkMsMHmNPz/+VnRMm59+Joh0yIvSA8/b34QceTqtb2fVR5jWhf6rMKaQ5D +f/iyg3Fe2XhhThrKUsJqgShrNf/JVPOugFaWsCU+chHsPw9AE0zMYcnMpNHkxvA8fuA /Duw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7si1551238otj.7.2020.03.26.12.17.37; Thu, 26 Mar 2020 12:17:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728069AbgCZTRN (ORCPT + 99 others); Thu, 26 Mar 2020 15:17:13 -0400 Received: from balrog.mythic-beasts.com ([46.235.227.24]:34699 "EHLO balrog.mythic-beasts.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726359AbgCZTRN (ORCPT ); Thu, 26 Mar 2020 15:17:13 -0400 Received: from [87.115.226.141] (port=49586 helo=slartibartfast.quignogs.org.uk) by balrog.mythic-beasts.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jHY04-00037G-J0; Thu, 26 Mar 2020 19:17:08 +0000 From: peter@bikeshed.quignogs.org.uk To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-doc@vger.kernel.org, Jonathan Corbet , Peter Lister Subject: [PATCH v2 0/1] Compactly make code examples into literal blocks Date: Thu, 26 Mar 2020 19:16:27 +0000 Message-Id: <20200326191628.10052-1-peter@bikeshed.quignogs.org.uk> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200311133027.2c77f348@lwn.net> References: <20200311133027.2c77f348@lwn.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BlackCat-Spam-Score: 50 X-Spam-Status: No, score=5.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Lister In a previous patch, I fixed a couple of doc build warnings due to a section heading "Example:" which didn't have the intended effect of inserting a heading and literal quoting the following code snippet. I added an explicit double colon to fix warnings and produce nice ReST. Jon suggested that I could have used a minimal form "Example::". Unfortunately not - kernel-doc munges the output so that the formatted output ends up as a stray colon and no literal block. Looking around in the source tree, it seems that parameter definitions can be more complex than the original authors of kernel-doc allowed for. Return values often need lists and examples often should be literal blocks. Many comments in the source are "ASCII formatted" but kernel-doc can make a mess of them and generate doc build warnings along the way. It seems useful to support some terse idioms which serve as compact source annotation and also generate well formed ReST. Here is a first try to let a heading directly introduce a literal block - the "Example::" form for code snippets and an update to platform.c to use it, just as Jon suggested. Peter Lister (1): Provide a compact idiom to add code examples in kerneldoc comments. drivers/base/platform.c | 4 ++-- scripts/kernel-doc | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) -- 2.25.1