All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@s-opensource.com>
To: Linux Doc Mailing List <linux-doc@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@s-opensource.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Markus Heiser <markus.heiser@darmarit.de>,
	Jonathan Corbet <corbet@lwn.net>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH v3 09/21] Documentation/CodingStyle: replace underline markups
Date: Wed, 14 Sep 2016 08:06:38 -0300	[thread overview]
Message-ID: <6e45b1c497a4c1be3e0c46d045ac9c32eaf5d328.1473849886.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <cover.1473849886.git.mchehab@s-opensource.com>
In-Reply-To: <cover.1473849886.git.mchehab@s-opensource.com>

Sphinx doesn't accept underline markups by purpose.
While there are ways to support underline via CSS, this won't
be portable with non-html outputs.

As we want CodingStyle to do emphasis, replace _foo_ by **foo**,
using bold emphasis.

Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
 Documentation/CodingStyle | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/Documentation/CodingStyle b/Documentation/CodingStyle
index d23a91d0c073..e669ecdcd8fe 100644
--- a/Documentation/CodingStyle
+++ b/Documentation/CodingStyle
@@ -3,7 +3,7 @@ Linux kernel coding style
 =========================
 
 This is a short document describing the preferred coding style for the
-linux kernel.  Coding style is very personal, and I won't _force_ my
+linux kernel.  Coding style is very personal, and I won't **force** my
 views on anybody, but this is what goes for anything that I have to be
 able to maintain, and I'd prefer it for most other things too.  Please
 at least consider the points made here.
@@ -137,10 +137,10 @@ opening brace at the beginning of the next line, thus:
 
 Heretic people all over the world have claimed that this inconsistency
 is ...  well ...  inconsistent, but all right-thinking people know that
-(a) K&R are _right_ and (b) K&R are right.  Besides, functions are
+(a) K&R are **right** and (b) K&R are right.  Besides, functions are
 special anyway (you can't nest them in C).
 
-Note that the closing brace is empty on a line of its own, _except_ in
+Note that the closing brace is empty on a line of its own, **except** in
 the cases where it is followed by a continuation of the same statement,
 ie a ``while`` in a do-statement or an ``else`` in an if-statement, like
 this:
@@ -294,10 +294,10 @@ HOWEVER, while mixed-case names are frowned upon, descriptive names for
 global variables are a must.  To call a global function ``foo`` is a
 shooting offense.
 
-GLOBAL variables (to be used only if you _really_ need them) need to
+GLOBAL variables (to be used only if you **really** need them) need to
 have descriptive names, as do global functions.  If you have a function
 that counts the number of active users, you should call that
-``count_active_users()`` or similar, you should _not_ call it ``cntusr()``.
+``count_active_users()`` or similar, you should **not** call it ``cntusr()``.
 
 Encoding the type of a function into the name (so-called Hungarian
 notation) is brain damaged - the compiler knows the types anyway and can
@@ -319,7 +319,7 @@ Typedefs
 --------
 
 Please don't use things like ``vps_t``.
-It's a _mistake_ to use typedef for structures and pointers. When you see a
+It's a **mistake** to use typedef for structures and pointers. When you see a
 
 .. code-block:: c
 
@@ -338,7 +338,7 @@ you can actually tell what ``a`` is.
 Lots of people think that typedefs ``help readability``. Not so. They are
 useful only for:
 
- (a) totally opaque objects (where the typedef is actively used to _hide_
+ (a) totally opaque objects (where the typedef is actively used to **hide**
      what the object is).
 
      Example: ``pte_t`` etc. opaque objects that you can only access using
@@ -346,15 +346,15 @@ useful only for:
 
      NOTE! Opaqueness and ``accessor functions`` are not good in themselves.
      The reason we have them for things like pte_t etc. is that there
-     really is absolutely _zero_ portably accessible information there.
+     really is absolutely **zero** portably accessible information there.
 
- (b) Clear integer types, where the abstraction _helps_ avoid confusion
+ (b) Clear integer types, where the abstraction **helps** avoid confusion
      whether it is ``int`` or ``long``.
 
      u8/u16/u32 are perfectly fine typedefs, although they fit into
      category (d) better than here.
 
-     NOTE! Again - there needs to be a _reason_ for this. If something is
+     NOTE! Again - there needs to be a **reason** for this. If something is
      ``unsigned long``, then there's no reason to do
 
 	typedef unsigned long myflags_t;
@@ -363,7 +363,7 @@ useful only for:
      might be an ``unsigned int`` and under other configurations might be
      ``unsigned long``, then by all means go ahead and use a typedef.
 
- (c) when you use sparse to literally create a _new_ type for
+ (c) when you use sparse to literally create a **new** type for
      type-checking.
 
  (d) New types which are identical to standard C99 types, in certain
@@ -392,7 +392,7 @@ Maybe there are other cases too, but the rule should basically be to NEVER
 EVER use a typedef unless you can clearly match one of those rules.
 
 In general, a pointer, or a struct that has elements that can reasonably
-be directly accessed should _never_ be a typedef.
+be directly accessed should **never** be a typedef.
 
 
 Functions
@@ -520,7 +520,7 @@ Commenting
 
 Comments are good, but there is also a danger of over-commenting.  NEVER
 try to explain HOW your code works in a comment: it's much better to
-write the code so that the _working_ is obvious, and it's a waste of
+write the code so that the **working** is obvious, and it's a waste of
 time to explain badly written code.
 
 Generally, you want your comments to tell WHAT your code does, not HOW.
@@ -671,14 +671,14 @@ Data structures that have visibility outside the single-threaded
 environment they are created and destroyed in should always have
 reference counts.  In the kernel, garbage collection doesn't exist (and
 outside the kernel garbage collection is slow and inefficient), which
-means that you absolutely _have_ to reference count all your uses.
+means that you absolutely **have** to reference count all your uses.
 
 Reference counting means that you can avoid locking, and allows multiple
 users to have access to the data structure in parallel - and not having
 to worry about the structure suddenly going away from under them just
 because they slept or did something else for a while.
 
-Note that locking is _not_ a replacement for reference counting.
+Note that locking is **not** a replacement for reference counting.
 Locking is used to keep data structures coherent, while reference
 counting is a memory management technique.  Usually both are needed, and
 they are not to be confused with each other.
@@ -734,7 +734,7 @@ Things to avoid when using macros:
 				return -EBUGGERED;	\
 		} while (0)
 
-is a _very_ bad idea.  It looks like a function call but exits the ``calling``
+is a **very** bad idea.  It looks like a function call but exits the ``calling``
 function; don't break the internal parsers of those who will read the code.
 
 2) macros that depend on having a local variable with a magic name:
-- 
2.7.4

  parent reply	other threads:[~2016-09-14 11:15 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-14 11:06 [PATCH v3 00/21] Create a book for Kernel development Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 01/21] doc: development-process: convert it to ReST markup Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 02/21] doc: development-process: rename files to rst Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 03/21] docs-rst: create a book for the development process Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 04/21] Documentation/HOWTO: convert to ReST notation Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 05/21] Documentation/applying-patches.txt: convert it to ReST markup Mauro Carvalho Chehab
2016-09-16 17:10   ` Jonathan Corbet
2016-09-16 17:20     ` Joe Perches
2016-09-16 21:36       ` Mauro Carvalho Chehab
2016-09-16 20:25     ` Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 06/21] Documentation/Changes: " Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 07/21] Documentation/CodingStyle: Convert " Mauro Carvalho Chehab
2016-09-16 17:13   ` Jonathan Corbet
2016-09-16 20:34     ` Mauro Carvalho Chehab
2016-09-17  9:58       ` Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 08/21] Documentation/CodingStyle: use the proper tag for verbatim font Mauro Carvalho Chehab
2016-09-14 11:06 ` Mauro Carvalho Chehab [this message]
2016-09-14 11:06 ` [PATCH v3 10/21] Documentation/CodingStyle: use the .. note:: markup where needed Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 11/21] Documentation/kernel-docs.txt: convert it to ReST markup Mauro Carvalho Chehab
2016-09-16 17:15   ` Jonathan Corbet
2016-09-16 20:42     ` Mauro Carvalho Chehab
2016-09-16 21:00       ` Jonathan Corbet
2016-09-16 21:28         ` Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 12/21] Documentation/ManagementStyle: " Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 13/21] Documentation/SecurityBugs: " Mauro Carvalho Chehab
2016-09-16 17:17   ` Jonathan Corbet
2016-09-16 20:53     ` Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 14/21] Documentation/stable_api_nonsense.txt: " Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 15/21] Documentation/stable_kernel_rules.txt: " Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 16/21] Documentation/SubmittingDrivers: " Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 17/21] Documentation/SubmittingPatches: " Mauro Carvalho Chehab
2016-09-16 17:21   ` Jonathan Corbet
2016-09-16 22:14     ` Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 18/21] Documentation/HOWTO: add cross-references to other documents Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 19/21] docs-rst: move HOWTO and mentioned documents to development-process/ Mauro Carvalho Chehab
2016-09-16 17:23   ` Jonathan Corbet
2016-09-14 11:06 ` [PATCH v3 20/21] doc: adjust references to development-process Mauro Carvalho Chehab
2016-09-16 17:25   ` Jonathan Corbet
2016-09-16 22:21     ` Mauro Carvalho Chehab
2016-09-14 11:06 ` [PATCH v3 21/21] doc-rst: Add the new development-process/ files to Sphinx build Mauro Carvalho Chehab

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=6e45b1c497a4c1be3e0c46d045ac9c32eaf5d328.1473849886.git.mchehab@s-opensource.com \
    --to=mchehab@s-opensource.com \
    --cc=corbet@lwn.net \
    --cc=jani.nikula@linux.intel.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=markus.heiser@darmarit.de \
    --cc=mchehab@infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.