All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] Document klp_modinfo using kdoc
@ 2023-02-03 12:22 Marcos Paulo de Souza
  2023-02-03 12:22 ` [PATCH v2 1/2] module.h: Document klp_modinfo struct " Marcos Paulo de Souza
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2023-02-03 12:22 UTC (permalink / raw)
  To: mcgrof, linux-modules, linux-kernel, live-patching, linux-doc,
	jpoimboe, mbenes, joe.lawrence, corbet, pmladek
  Cc: Marcos Paulo de Souza

Originally it was only one patch, but it was divided in two. The second one
removed the local declaration to klp_modinfo and also refers to it using kdoc
format.

Changes from v1:
* Use kdoc (Luis)

Original commit message:
The struct members description can be found on
Documentation/livepatch/module-elf-format.rst, but for a developer it's
easier to search for such information looking at the struct definition.

Marcos Paulo de Souza (2):
  module.h: Document klp_modinfo struct using kdoc
  Documentation: livepatch: module-elf-format: Remove local klp_modinfo
    definition

 Documentation/livepatch/module-elf-format.rst | 11 ++---------
 include/linux/module.h                        |  8 ++++++++
 2 files changed, 10 insertions(+), 9 deletions(-)

-- 
2.39.1


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

* [PATCH v2 1/2] module.h: Document klp_modinfo struct using kdoc
  2023-02-03 12:22 [PATCH v2] Document klp_modinfo using kdoc Marcos Paulo de Souza
@ 2023-02-03 12:22 ` Marcos Paulo de Souza
  2023-02-03 12:22 ` [PATCH v2 2/2] Documentation: livepatch: module-elf-format: Remove local klp_modinfo definition Marcos Paulo de Souza
  2023-02-06 17:09 ` [PATCH v2] Document klp_modinfo using kdoc Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2023-02-03 12:22 UTC (permalink / raw)
  To: mcgrof, linux-modules, linux-kernel, live-patching, linux-doc,
	jpoimboe, mbenes, joe.lawrence, corbet, pmladek
  Cc: Marcos Paulo de Souza

Previously the documentation existed only in Documentation/livepatch
directory.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 include/linux/module.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/module.h b/include/linux/module.h
index ec61fb53979a..3382ef8f66a8 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -352,6 +352,14 @@ struct mod_kallsyms {
 };
 
 #ifdef CONFIG_LIVEPATCH
+/**
+ * struct klp_modinfo - Elf information preserved from the livepatch module
+ *
+ * @hdr: Elf header
+ * @sechdrs: Section header table
+ * @secstrings: String table for the section headers
+ * @symndx: The symbol table section index
+ */
 struct klp_modinfo {
 	Elf_Ehdr hdr;
 	Elf_Shdr *sechdrs;
-- 
2.39.1


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

* [PATCH v2 2/2] Documentation: livepatch: module-elf-format: Remove local klp_modinfo definition
  2023-02-03 12:22 [PATCH v2] Document klp_modinfo using kdoc Marcos Paulo de Souza
  2023-02-03 12:22 ` [PATCH v2 1/2] module.h: Document klp_modinfo struct " Marcos Paulo de Souza
@ 2023-02-03 12:22 ` Marcos Paulo de Souza
  2023-02-06 17:09 ` [PATCH v2] Document klp_modinfo using kdoc Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Marcos Paulo de Souza @ 2023-02-03 12:22 UTC (permalink / raw)
  To: mcgrof, linux-modules, linux-kernel, live-patching, linux-doc,
	jpoimboe, mbenes, joe.lawrence, corbet, pmladek
  Cc: Marcos Paulo de Souza

Refer to klp_modinfo declaration using kdoc.

Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
---
 Documentation/livepatch/module-elf-format.rst | 11 ++---------
 1 file changed, 2 insertions(+), 9 deletions(-)

diff --git a/Documentation/livepatch/module-elf-format.rst b/Documentation/livepatch/module-elf-format.rst
index 72a072514581..2f2ee33539f7 100644
--- a/Documentation/livepatch/module-elf-format.rst
+++ b/Documentation/livepatch/module-elf-format.rst
@@ -334,12 +334,5 @@ A livepatch module's symbol table is accessible through module->symtab.
 Since apply_relocate_add() requires access to a module's section headers,
 symbol table, and relocation section indices, Elf information is preserved for
 livepatch modules and is made accessible by the module loader through
-module->klp_info, which is a klp_modinfo struct. When a livepatch module loads,
-this struct is filled in by the module loader. Its fields are documented below::
-
-	struct klp_modinfo {
-		Elf_Ehdr hdr; /* Elf header */
-		Elf_Shdr *sechdrs; /* Section header table */
-		char *secstrings; /* String table for the section headers */
-		unsigned int symndx; /* The symbol table section index */
-	};
+module->klp_info, which is a :c:type:`klp_modinfo` struct. When a livepatch module
+loads, this struct is filled in by the module loader.
-- 
2.39.1


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

* Re: [PATCH v2] Document klp_modinfo using kdoc
  2023-02-03 12:22 [PATCH v2] Document klp_modinfo using kdoc Marcos Paulo de Souza
  2023-02-03 12:22 ` [PATCH v2 1/2] module.h: Document klp_modinfo struct " Marcos Paulo de Souza
  2023-02-03 12:22 ` [PATCH v2 2/2] Documentation: livepatch: module-elf-format: Remove local klp_modinfo definition Marcos Paulo de Souza
@ 2023-02-06 17:09 ` Luis Chamberlain
  2 siblings, 0 replies; 4+ messages in thread
From: Luis Chamberlain @ 2023-02-06 17:09 UTC (permalink / raw)
  To: Marcos Paulo de Souza
  Cc: linux-modules, linux-kernel, live-patching, linux-doc, jpoimboe,
	mbenes, joe.lawrence, corbet, pmladek

On Fri, Feb 03, 2023 at 09:22:20AM -0300, Marcos Paulo de Souza wrote:
> Originally it was only one patch, but it was divided in two. The second one
> removed the local declaration to klp_modinfo and also refers to it using kdoc
> format.
> 
> Changes from v1:
> * Use kdoc (Luis)
> 
> Original commit message:
> The struct members description can be found on
> Documentation/livepatch/module-elf-format.rst, but for a developer it's
> easier to search for such information looking at the struct definition.
> 
> Marcos Paulo de Souza (2):
>   module.h: Document klp_modinfo struct using kdoc
>   Documentation: livepatch: module-elf-format: Remove local klp_modinfo
>     definition

Thanks! Merged and pushed onto modules-next! If you can get more modules
stuff into kdoc that would be appreciated!

  Luis

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

end of thread, other threads:[~2023-02-06 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-03 12:22 [PATCH v2] Document klp_modinfo using kdoc Marcos Paulo de Souza
2023-02-03 12:22 ` [PATCH v2 1/2] module.h: Document klp_modinfo struct " Marcos Paulo de Souza
2023-02-03 12:22 ` [PATCH v2 2/2] Documentation: livepatch: module-elf-format: Remove local klp_modinfo definition Marcos Paulo de Souza
2023-02-06 17:09 ` [PATCH v2] Document klp_modinfo using kdoc Luis Chamberlain

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.