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>,
linux-kernel@vger.kernel.org, Jonathan Corbet <corbet@lwn.net>
Subject: [PATCH v2 20/31] flexible-arrays.txt: standardize document format
Date: Sat, 17 Jun 2017 12:25:39 -0300 [thread overview]
Message-ID: <4c8e25176b6fed4db2e1429a280e0392c7ebb110.1497713142.git.mchehab@s-opensource.com> (raw)
In-Reply-To: <f0f77a106d183325dce9eecd3c11214154050e11.1497713142.git.mchehab@s-opensource.com>
In-Reply-To: <f0f77a106d183325dce9eecd3c11214154050e11.1497713142.git.mchehab@s-opensource.com>
Each text file under Documentation follows a different
format. Some doesn't even have titles!
Change its representation to follow the adopted standard,
using ReST markups for it to be parseable by Sphinx:
- use :Author: and :Updated: markups;
- use proper markup for the document title;
- mark the literal-blocks.
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
---
Documentation/flexible-arrays.txt | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/Documentation/flexible-arrays.txt b/Documentation/flexible-arrays.txt
index df904aec9904..a0f2989dd804 100644
--- a/Documentation/flexible-arrays.txt
+++ b/Documentation/flexible-arrays.txt
@@ -1,6 +1,9 @@
+===================================
Using flexible arrays in the kernel
-Last updated for 2.6.32
-Jonathan Corbet <corbet@lwn.net>
+===================================
+
+:Updated: Last updated for 2.6.32
+:Author: Jonathan Corbet <corbet@lwn.net>
Large contiguous memory allocations can be unreliable in the Linux kernel.
Kernel programmers will sometimes respond to this problem by allocating
@@ -26,7 +29,7 @@ operation. It's also worth noting that flexible arrays do no internal
locking at all; if concurrent access to an array is possible, then the
caller must arrange for appropriate mutual exclusion.
-The creation of a flexible array is done with:
+The creation of a flexible array is done with::
#include <linux/flex_array.h>
@@ -40,14 +43,14 @@ argument is passed directly to the internal memory allocation calls. With
the current code, using flags to ask for high memory is likely to lead to
notably unpleasant side effects.
-It is also possible to define flexible arrays at compile time with:
+It is also possible to define flexible arrays at compile time with::
DEFINE_FLEX_ARRAY(name, element_size, total);
This macro will result in a definition of an array with the given name; the
element size and total will be checked for validity at compile time.
-Storing data into a flexible array is accomplished with a call to:
+Storing data into a flexible array is accomplished with a call to::
int flex_array_put(struct flex_array *array, unsigned int element_nr,
void *src, gfp_t flags);
@@ -63,7 +66,7 @@ running in some sort of atomic context; in this situation, sleeping in the
memory allocator would be a bad thing. That can be avoided by using
GFP_ATOMIC for the flags value, but, often, there is a better way. The
trick is to ensure that any needed memory allocations are done before
-entering atomic context, using:
+entering atomic context, using::
int flex_array_prealloc(struct flex_array *array, unsigned int start,
unsigned int nr_elements, gfp_t flags);
@@ -73,7 +76,7 @@ defined by start and nr_elements has been allocated. Thereafter, a
flex_array_put() call on an element in that range is guaranteed not to
block.
-Getting data back out of the array is done with:
+Getting data back out of the array is done with::
void *flex_array_get(struct flex_array *fa, unsigned int element_nr);
@@ -89,7 +92,7 @@ involving that number probably result from use of unstored array entries.
Note that, if array elements are allocated with __GFP_ZERO, they will be
initialized to zero and this poisoning will not happen.
-Individual elements in the array can be cleared with:
+Individual elements in the array can be cleared with::
int flex_array_clear(struct flex_array *array, unsigned int element_nr);
@@ -97,7 +100,7 @@ This function will set the given element to FLEX_ARRAY_FREE and return
zero. If storage for the indicated element is not allocated for the array,
flex_array_clear() will return -EINVAL instead. Note that clearing an
element does not release the storage associated with it; to reduce the
-allocated size of an array, call:
+allocated size of an array, call::
int flex_array_shrink(struct flex_array *array);
@@ -106,12 +109,12 @@ This function works by scanning the array for pages containing nothing but
FLEX_ARRAY_FREE bytes, so (1) it can be expensive, and (2) it will not work
if the array's pages are allocated with __GFP_ZERO.
-It is possible to remove all elements of an array with a call to:
+It is possible to remove all elements of an array with a call to::
void flex_array_free_parts(struct flex_array *array);
This call frees all elements, but leaves the array itself in place.
-Freeing the entire array is done with:
+Freeing the entire array is done with::
void flex_array_free(struct flex_array *array);
--
2.9.4
next prev parent reply other threads:[~2017-06-17 15:42 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-17 15:25 [PATCH v2 01/31] bcache.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 02/31] bt8xxgpio.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 03/31] btmrvl.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 04/31] bus-virt-phys-mapping.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 05/31] cachetlb.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 06/31] circular-buffers.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 07/31] clk.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 08/31] cpu-load: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 09/31] cputopology.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 10/31] crc32.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 11/31] dcdbas.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 12/31] digsig.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 13/31] DMA-API.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 14/31] DMA-API-HOWTO.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 15/31] DMA-attributes.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 16/31] DMA-ISA-LPC.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 17/31] debugging-via-ohci1394.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 18/31] efi-stub.txt: " Mauro Carvalho Chehab
2017-06-20 7:02 ` Ard Biesheuvel
2017-06-17 15:25 ` [PATCH v2 19/31] eisa.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` Mauro Carvalho Chehab [this message]
2017-06-17 15:25 ` [PATCH v2 21/31] futex-requeue-pi.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 22/31] gcc-plugins.txt: " Mauro Carvalho Chehab
2017-06-19 18:58 ` Kees Cook
2017-06-17 15:25 ` [PATCH v2 23/31] highuid.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 24/31] hw_random.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 25/31] hwspinlock.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 26/31] intel_txt.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 27/31] Intel-IOMMU.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 28/31] io-mapping.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 29/31] io_ordering.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 30/31] iostats.txt: " Mauro Carvalho Chehab
2017-06-17 15:25 ` [PATCH v2 31/31] iostats.txt: update it to cover recent Kernels 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=4c8e25176b6fed4db2e1429a280e0392c7ebb110.1497713142.git.mchehab@s-opensource.com \
--to=mchehab@s-opensource.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--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 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®