On 2023-11-22 23:20, Andrew Cooper wrote:
On 22/11/2023 10:13 pm, Stefano Stabellini wrote:
On Wed, 22 Nov 2023, Andrew Cooper wrote:
The differences between inline, __inline and __inline__ keywords are a vestigial remnant of older C standards, and in Xen we use inline almost
exclusively.

Replace __inline and __inline__ with regular inline, and remove their
exceptions from the MISRA configuration.

Signed-off-by: Andrew Cooper <andrew.coop...@citrix.com>

diff --git a/docs/misra/C-language-toolchain.rst b/docs/misra/C-language-toolchain.rst
index 2866cb191b1a..b7c2000992ac 100644
--- a/docs/misra/C-language-toolchain.rst
+++ b/docs/misra/C-language-toolchain.rst
@@ -84,7 +84,7 @@ The table columns are as follows:
see Sections "6.48 Alternate Keywords" and "6.47 How to Use Inline Assembly Language in C Code" of GCC_MANUAL.
        __volatile__:
see Sections "6.48 Alternate Keywords" and "6.47.2.1 Volatile" of GCC_MANUAL.
-       __const__, __inline__, __inline:
+       __const__:
           see Section "6.48 Alternate Keywords" of GCC_MANUAL.
        typeof, __typeof__:
see Section "6.7 Referring to a Type with typeof" of GCC_MANUAL.
Asking the Bugseng guys as well, do we need to add to
C-language-toolchain.rst:
inline __attribute__((__always_inline__))
inline __attribute__((__gnu_inline__))

__attribute__ itself is in the list of permitted non-standard tokens, in
both files.

However, neither file has anything concerning the parameter(s) to the
__attribute__, and we do use an awful lot of them.

If they want discussing, then that's going to be a lot of work.


Just __attribute__ is fine, since we point to
Section "6.39 Attribute Syntax" of GCC_MANUAL.
which describes the syntax for the token and gives pointers to other relevant sections of the manual.

Given that the problem was also present before this patch:

Reviewed-by: Stefano Stabellini <sstabell...@kernel.org>

Thanks.

--
Nicola Vetrini, BSc
Software Engineer, BUGSENG srl (https://bugseng.com)

Reply via email to