All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86: Improve documentation for low-level device I/O functions
@ 2017-01-27 23:17 Jonathan Corbet
  2017-01-28  8:38 ` Ingo Molnar
  2017-01-28 22:17 ` [tip:x86/mm] x86/mm: " tip-bot for Jonathan Corbet
  0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Corbet @ 2017-01-27 23:17 UTC (permalink / raw)
  To: LKML; +Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin

Add kerneldoc comments for memcpy_{to,from}io() and memset_io().  The
existing documentation for ioremap() was distant from the definition,
causing kernel-doc to miss it; move it appropriately.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
---
 arch/x86/include/asm/io.h | 47 ++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 36 insertions(+), 11 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index d34bd370074b..a8a6c856a08f 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -164,6 +164,18 @@ static inline unsigned int isa_virt_to_bus(volatile void *address)
 #define virt_to_bus virt_to_phys
 #define bus_to_virt phys_to_virt
 
+/*
+ * The default ioremap() behavior is non-cached; if you need something
+ * else, you probably want one of the following.
+ */
+extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
+extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
+#define ioremap_uc ioremap_uc
+
+extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
+extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
+				unsigned long prot_val);
+
 /**
  * ioremap     -   map bus memory into CPU space
  * @offset:    bus address of the memory
@@ -178,17 +190,6 @@ static inline unsigned int isa_virt_to_bus(volatile void *address)
  * If the area you are trying to map is a PCI BAR you should have a
  * look at pci_iomap().
  */
-extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
-extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
-#define ioremap_uc ioremap_uc
-
-extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
-extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
-				unsigned long prot_val);
-
-/*
- * The default ioremap() behavior is non-cached:
- */
 static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
 {
 	return ioremap_nocache(offset, size);
@@ -207,18 +208,42 @@ extern void set_iounmap_nonlazy(void);
  */
 #define xlate_dev_kmem_ptr(p)	p
 
+/**
+ * memset_io	Set a range of I/O memory to a constant value
+ * @addr:	The beginning of the I/O-memory range to set
+ * @val:	The value to set the memory to
+ * @count:	The number of bytest to set
+ *
+ * Set a range of I/O memory to a given value.
+ */
 static inline void
 memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
 {
 	memset((void __force *)addr, val, count);
 }
 
+/**
+ * memcpy_fromio	Copy a block of data from I/O memory
+ * @dst:		The (RAM) destination for the copy
+ * @src:		The (I/O memory) source for the data
+ * @count:		The number of bytes to copy
+ *
+ * Copy a block of data from I/O memory.
+ */
 static inline void
 memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
 {
 	memcpy(dst, (const void __force *)src, count);
 }
 
+/**
+ * memcpy_toio		Copy a block of data into I/O memory
+ * @dst:		The (I/O memory) destination for the copy
+ * @src:		The (RAM) source for the data
+ * @count:		The number of bytes to copy
+ *
+ * Copy a block of data to I/O memory.
+ */
 static inline void
 memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
 {
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86: Improve documentation for low-level device I/O functions
  2017-01-27 23:17 [PATCH] x86: Improve documentation for low-level device I/O functions Jonathan Corbet
@ 2017-01-28  8:38 ` Ingo Molnar
  2017-01-28 22:17 ` [tip:x86/mm] x86/mm: " tip-bot for Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: Ingo Molnar @ 2017-01-28  8:38 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: LKML, Thomas Gleixner, Ingo Molnar, H. Peter Anvin


* Jonathan Corbet <corbet@lwn.net> wrote:

> Add kerneldoc comments for memcpy_{to,from}io() and memset_io().  The
> existing documentation for ioremap() was distant from the definition,
> causing kernel-doc to miss it; move it appropriately.
> 
> Signed-off-by: Jonathan Corbet <corbet@lwn.net>
> ---
>  arch/x86/include/asm/io.h | 47 ++++++++++++++++++++++++++++++++++++-----------
>  1 file changed, 36 insertions(+), 11 deletions(-)
> 
> diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
> index d34bd370074b..a8a6c856a08f 100644
> --- a/arch/x86/include/asm/io.h
> +++ b/arch/x86/include/asm/io.h
> @@ -164,6 +164,18 @@ static inline unsigned int isa_virt_to_bus(volatile void *address)
>  #define virt_to_bus virt_to_phys
>  #define bus_to_virt phys_to_virt
>  
> +/*
> + * The default ioremap() behavior is non-cached; if you need something
> + * else, you probably want one of the following.
> + */
> +extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
> +extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
> +#define ioremap_uc ioremap_uc
> +
> +extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
> +extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
> +				unsigned long prot_val);
> +
>  /**
>   * ioremap     -   map bus memory into CPU space
>   * @offset:    bus address of the memory
> @@ -178,17 +190,6 @@ static inline unsigned int isa_virt_to_bus(volatile void *address)
>   * If the area you are trying to map is a PCI BAR you should have a
>   * look at pci_iomap().
>   */
> -extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
> -extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
> -#define ioremap_uc ioremap_uc
> -
> -extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
> -extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
> -				unsigned long prot_val);
> -
> -/*
> - * The default ioremap() behavior is non-cached:
> - */
>  static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
>  {
>  	return ioremap_nocache(offset, size);
> @@ -207,18 +208,42 @@ extern void set_iounmap_nonlazy(void);
>   */
>  #define xlate_dev_kmem_ptr(p)	p
>  
> +/**
> + * memset_io	Set a range of I/O memory to a constant value
> + * @addr:	The beginning of the I/O-memory range to set
> + * @val:	The value to set the memory to
> + * @count:	The number of bytest to set

I fixed this 'bytest' typo and applied the patch, thanks Jon!

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:x86/mm] x86/mm: Improve documentation for low-level device I/O functions
  2017-01-27 23:17 [PATCH] x86: Improve documentation for low-level device I/O functions Jonathan Corbet
  2017-01-28  8:38 ` Ingo Molnar
@ 2017-01-28 22:17 ` tip-bot for Jonathan Corbet
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jonathan Corbet @ 2017-01-28 22:17 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: corbet, tglx, linux-kernel, mingo, hpa, torvalds, peterz

Commit-ID:  f58576666ccdcfb9cf7cae8669dffe1eed844f88
Gitweb:     http://git.kernel.org/tip/f58576666ccdcfb9cf7cae8669dffe1eed844f88
Author:     Jonathan Corbet <corbet@lwn.net>
AuthorDate: Fri, 27 Jan 2017 16:17:52 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 28 Jan 2017 09:37:51 +0100

x86/mm: Improve documentation for low-level device I/O functions

Add kerneldoc comments for memcpy_{to,from}io() and memset_io().  The
existing documentation for ioremap() was distant from the definition,
causing kernel-doc to miss it; move it appropriately.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20170127161752.0b95e95b@lwn.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/include/asm/io.h | 46 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 35 insertions(+), 11 deletions(-)

diff --git a/arch/x86/include/asm/io.h b/arch/x86/include/asm/io.h
index d34bd37..7afb0e2 100644
--- a/arch/x86/include/asm/io.h
+++ b/arch/x86/include/asm/io.h
@@ -164,6 +164,17 @@ static inline unsigned int isa_virt_to_bus(volatile void *address)
 #define virt_to_bus virt_to_phys
 #define bus_to_virt phys_to_virt
 
+/*
+ * The default ioremap() behavior is non-cached; if you need something
+ * else, you probably want one of the following.
+ */
+extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
+extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
+#define ioremap_uc ioremap_uc
+
+extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
+extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size, unsigned long prot_val);
+
 /**
  * ioremap     -   map bus memory into CPU space
  * @offset:    bus address of the memory
@@ -178,17 +189,6 @@ static inline unsigned int isa_virt_to_bus(volatile void *address)
  * If the area you are trying to map is a PCI BAR you should have a
  * look at pci_iomap().
  */
-extern void __iomem *ioremap_nocache(resource_size_t offset, unsigned long size);
-extern void __iomem *ioremap_uc(resource_size_t offset, unsigned long size);
-#define ioremap_uc ioremap_uc
-
-extern void __iomem *ioremap_cache(resource_size_t offset, unsigned long size);
-extern void __iomem *ioremap_prot(resource_size_t offset, unsigned long size,
-				unsigned long prot_val);
-
-/*
- * The default ioremap() behavior is non-cached:
- */
 static inline void __iomem *ioremap(resource_size_t offset, unsigned long size)
 {
 	return ioremap_nocache(offset, size);
@@ -207,18 +207,42 @@ extern void set_iounmap_nonlazy(void);
  */
 #define xlate_dev_kmem_ptr(p)	p
 
+/**
+ * memset_io	Set a range of I/O memory to a constant value
+ * @addr:	The beginning of the I/O-memory range to set
+ * @val:	The value to set the memory to
+ * @count:	The number of bytes to set
+ *
+ * Set a range of I/O memory to a given value.
+ */
 static inline void
 memset_io(volatile void __iomem *addr, unsigned char val, size_t count)
 {
 	memset((void __force *)addr, val, count);
 }
 
+/**
+ * memcpy_fromio	Copy a block of data from I/O memory
+ * @dst:		The (RAM) destination for the copy
+ * @src:		The (I/O memory) source for the data
+ * @count:		The number of bytes to copy
+ *
+ * Copy a block of data from I/O memory.
+ */
 static inline void
 memcpy_fromio(void *dst, const volatile void __iomem *src, size_t count)
 {
 	memcpy(dst, (const void __force *)src, count);
 }
 
+/**
+ * memcpy_toio		Copy a block of data into I/O memory
+ * @dst:		The (I/O memory) destination for the copy
+ * @src:		The (RAM) source for the data
+ * @count:		The number of bytes to copy
+ *
+ * Copy a block of data to I/O memory.
+ */
 static inline void
 memcpy_toio(volatile void __iomem *dst, const void *src, size_t count)
 {

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-01-28 22:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 23:17 [PATCH] x86: Improve documentation for low-level device I/O functions Jonathan Corbet
2017-01-28  8:38 ` Ingo Molnar
2017-01-28 22:17 ` [tip:x86/mm] x86/mm: " tip-bot for Jonathan Corbet

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.