mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 20:54:03 +02:00
docs: kernel-doc.rst: document private: scope propagation
This was an undefined behavior, but at least one place used private: inside a nested struct meant to not be propagated outside it. Kernel-doc now defines how this is propagated. So, document that. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <bbe0ed698c21f3f930a561b885bc8a47824f7f1d.1773770483.git.mchehab+huawei@kernel.org>
This commit is contained in:
parent
024e200e2a
commit
827b9458c9
|
|
@ -213,6 +213,10 @@ The ``private:`` and ``public:`` tags must begin immediately following a
|
||||||
``/*`` comment marker. They may optionally include comments between the
|
``/*`` comment marker. They may optionally include comments between the
|
||||||
``:`` and the ending ``*/`` marker.
|
``:`` and the ending ``*/`` marker.
|
||||||
|
|
||||||
|
When ``private:`` is used on nested structs, it propagates only to inner
|
||||||
|
structs/unions.
|
||||||
|
|
||||||
|
|
||||||
Example::
|
Example::
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -256,8 +260,10 @@ It is possible to document nested structs and unions, like::
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
int memb1;
|
int memb1;
|
||||||
|
/* private: hides memb2 from documentation */
|
||||||
int memb2;
|
int memb2;
|
||||||
};
|
};
|
||||||
|
/* Everything here is public again, as private scope finished */
|
||||||
struct {
|
struct {
|
||||||
void *memb3;
|
void *memb3;
|
||||||
int memb4;
|
int memb4;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user