mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Tobin C. Harding" <me@tobin.cc>
To: Jonathan Corbet <corbet@lwn.net>
Cc: "Tobin C. Harding" <me@tobin.cc>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Josh Triplett <josh@joshtriplett.org>,
	Linux docs <linux-doc@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [RFC] doc: fix code snippet build warnings
Date: Wed, 10 Jan 2018 15:04:53 +1100	[thread overview]
Message-ID: <1515557093-7036-1-git-send-email-me@tobin.cc> (raw)

Posting as RFC in the hope that someone knows how to massage sphinx
correctly to fix this patch.

Currently function kernel-doc contains a multi-line code snippet. This
is causing sphinx to emit 5 build warnings

	WARNING: Unexpected indentation.
	WARNING: Unexpected indentation.
	WARNING: Block quote ends without a blank line; unexpected unindent.
	WARNING: Block quote ends without a blank line; unexpected unindent.
	WARNING: Inline literal start-string without end-string.

And the snippet is not rendering correctly in HTML.

We can stop shpinx complaining by using '::' instead of the currently
used '``' however this still does not render correctly in HTML. The
rendering is [arguably] better but still incorrect. Sphinx renders two
function calls thus:

	:c:func:`rcu_read_lock()`;

The rest of the snippet does however have correct spacing.

Use '::' to pre-fix code snippet. Clears build warnings but does not
render correctly.

Signed-off-by: Tobin C. Harding <me@tobin.cc>
---

To view current broken rendering see

https://www.kernel.org/doc/html/latest/core-api/kernel-api.html?highlight=rcu_pointer_handoff#c.rcu_pointer_handoff

 include/linux/rcupdate.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index a6ddc42f87a5..cc10e772e3e9 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -568,7 +568,8 @@ static inline void rcu_preempt_sleep_check(void) { }
  * is handed off from RCU to some other synchronization mechanism, for
  * example, reference counting or locking.  In C11, it would map to
  * kill_dependency().  It could be used as follows:
- * ``
+ * ::
+ *
  *	rcu_read_lock();
  *	p = rcu_dereference(gp);
  *	long_lived = is_long_lived(p);
@@ -579,7 +580,6 @@ static inline void rcu_preempt_sleep_check(void) { }
  *			p = rcu_pointer_handoff(p);
  *	}
  *	rcu_read_unlock();
- *``
  */
 #define rcu_pointer_handoff(p) (p)
 
-- 
2.7.4

             reply	other threads:[~2018-01-10  4:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  4:04 Tobin C. Harding [this message]
2018-01-10 16:37 ` Paul E. McKenney
2018-01-10 20:30   ` Tobin C. Harding
2018-01-10 21:08     ` Paul E. McKenney
2018-01-10 21:59 ` Jonathan Corbet
2018-01-10 22:25   ` Tobin C. Harding
2018-01-10 22:26     ` Tobin C. Harding
2018-01-16 10:26     ` Jani Nikula
2018-01-16 10:22   ` Jani Nikula
2018-01-16 12:36     ` Markus Heiser
2018-01-16 13:14       ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1515557093-7036-1-git-send-email-me@tobin.cc \
    --to=me@tobin.cc \
    --cc=corbet@lwn.net \
    --cc=josh@joshtriplett.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®