Received: by 2002:a17:90a:1609:0:0:0:0 with SMTP id n9csp2300458pja; Thu, 26 Mar 2020 12:54:27 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtCAE5cOsw+u5DCnIeO//y1lJvjXqGYzhbW/8ebMaHlsKsANQ8Z4k9iH9BL1X7akjrGp4Lv X-Received: by 2002:a05:6808:aaa:: with SMTP id r10mr1425133oij.111.1585252466940; Thu, 26 Mar 2020 12:54:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585252466; cv=none; d=google.com; s=arc-20160816; b=tIUWW5ONNjKuM60f4HlQzp9Tilk8V72yJetEI/M3pwo1XV/eKWomuOSejEeuhv5KDB klH6tipsNkBjMzdtQ3331rCgSA9ZzZ5ZNPBd4yTurhjJCRhuU6EAw25T8mEU1mg4xld7 kVE3jlzOM7oGufXSRaOrGWVOyC8hXy9DChg1hS9d1rUiY6uVZm0FO8OXGhRPOwU8c2vC pj4lBMYuuGtAP3md14NufxFd24UafZZ7burhB+Llvb/S5+aHRtwPQyoHy42Tfkr9gMIm 5q1gTMJh/wR7e6BKBz7/dr0mRfaG1f7iVTJmrFnb4iFXtqDUrDfAV62j1f8O20fnsBRv sOHg== 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=Z15woxGYqyiFTNA5wUH+9MiyA2ReI+nizsOxgrGy/UQ=; b=pm9LroyB3Gf6roL/nG2TkGa38Gx4KpnhpUbuW2vMKx0Y/G20tYQjRQPl+AK1nBaZ2i NIND5/T1kZFoshBjaD9zLGETy39XKOY+oJHb8xydBbLzoOC9ktQ9c+GsDuO/NxROkmpq h50wa/GQa/TID+5zB1sYEQWPEcrP94yVMXvvRx7VtnQXWTF9MfJYDSPM4KsrQKbdRmhF 7G0QT2oRZlA8XrIL3joi40D8KAw7lEneWdEhl2eOz0PCIP4yJFGiO7h+IGsgHNcaZXUD xKQa3bHWkWxaXdZ0AqtFYH6JmGEU0DYyPszi9jqy+mTp5mQYQmAgJQtiVbXS6cqxsvqq FoKg== 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 c22si1434004oib.266.2020.03.26.12.54.12; Thu, 26 Mar 2020 12:54:26 -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 S1728531AbgCZTwE (ORCPT + 99 others); Thu, 26 Mar 2020 15:52:04 -0400 Received: from haggis.mythic-beasts.com ([46.235.224.141]:41771 "EHLO haggis.mythic-beasts.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbgCZTwE (ORCPT ); Thu, 26 Mar 2020 15:52:04 -0400 Received: from [87.115.226.141] (port=56456 helo=slartibartfast.quignogs.org.uk) by haggis.mythic-beasts.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jHYXo-0002h8-AC; Thu, 26 Mar 2020 19:52:00 +0000 From: peter@bikeshed.quignogs.org.uk To: Matthew Wilcox , linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-doc@vger.kernel.org, Jonathan Corbet , Peter Lister Subject: [PATCH v3 0/1] Compactly make code examples into literal blocks Date: Thu, 26 Mar 2020 19:51:55 +0000 Message-Id: <20200326195156.11858-1-peter@bikeshed.quignogs.org.uk> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200326192947.GM22483@bombadil.infradead.org> References: <20200326192947.GM22483@bombadil.infradead.org> 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 [ A couple of typos corrected. Thanks, Matthew ] 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): 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