[PATCH] docs/misra: add always_inline to C-language-toolchain

Stefano Stabellini posted 1 patch 8 months, 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20230804013438.2894725-1-sstabellini@kernel.org
docs/misra/C-language-toolchain.rst | 2 ++
1 file changed, 2 insertions(+)
[PATCH] docs/misra: add always_inline to C-language-toolchain
Posted by Stefano Stabellini 8 months, 4 weeks ago
From: Stefano Stabellini <stefano.stabellini@amd.com>

Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>
---
 docs/misra/C-language-toolchain.rst | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 785aed1eaf..21b292898c 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -84,6 +84,8 @@ The table columns are as follows:
           see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
        __const__, __inline__, __inline:
           see Section "6.48 Alternate Keywords" of GCC_MANUAL.
+       always_inline:
+          see Section "6.45 An Inline Function is As Fast As a Macro" of GCC_MANUAL.
        typeof, __typeof__:
           see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
        __alignof__, __alignof:
-- 
2.25.1
Re: [PATCH] docs/misra: add always_inline to C-language-toolchain
Posted by Jan Beulich 8 months, 4 weeks ago
On 04.08.2023 03:34, Stefano Stabellini wrote:
> --- a/docs/misra/C-language-toolchain.rst
> +++ b/docs/misra/C-language-toolchain.rst
> @@ -84,6 +84,8 @@ The table columns are as follows:
>            see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
>         __const__, __inline__, __inline:
>            see Section "6.48 Alternate Keywords" of GCC_MANUAL.
> +       always_inline:
> +          see Section "6.45 An Inline Function is As Fast As a Macro" of GCC_MANUAL.
>         typeof, __typeof__:
>            see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
>         __alignof__, __alignof:

This is the "Non-standard tokens" section. What you add is a macro of our
own. In its expansion we don't use the similarly named attribute in this
very spelling, but with underscores prefixed and suffixed to it.

If we mean to enumerate __attribute__(()) identifier tokens here as well,
then I think we should add all of them that we use. But that's going to
be an ever expanding list.

In any event I don't think such an addition can come with an empty
description.

Jan
Re: [PATCH] docs/misra: add always_inline to C-language-toolchain
Posted by Stefano Stabellini 8 months, 4 weeks ago
On Fri, 4 Aug 2023, Jan Beulich wrote:
> On 04.08.2023 03:34, Stefano Stabellini wrote:
> > --- a/docs/misra/C-language-toolchain.rst
> > +++ b/docs/misra/C-language-toolchain.rst
> > @@ -84,6 +84,8 @@ The table columns are as follows:
> >            see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
> >         __const__, __inline__, __inline:
> >            see Section "6.48 Alternate Keywords" of GCC_MANUAL.
> > +       always_inline:
> > +          see Section "6.45 An Inline Function is As Fast As a Macro" of GCC_MANUAL.
> >         typeof, __typeof__:
> >            see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
> >         __alignof__, __alignof:
> 
> This is the "Non-standard tokens" section. What you add is a macro of our
> own. In its expansion we don't use the similarly named attribute in this
> very spelling, but with underscores prefixed and suffixed to it.
> 
> If we mean to enumerate __attribute__(()) identifier tokens here as well,
> then I think we should add all of them that we use. But that's going to
> be an ever expanding list.

Ah! Now it makes sense. I missed this:

#define always_inline __inline__ __attribute__ ((__always_inline__))

That is why it wasn't already listed in the document: we didn't list all
the __attribute__(()) and this is just one of them. They are clearly
marked extensions so there is no strict need to list them also here.

I'll drop the patch.