From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xenproject.org>
Cc: "Andrew Cooper" <andrew.cooper3@citrix.com>,
"Jan Beulich" <JBeulich@suse.com>,
"Roger Pau Monné" <roger.pau@citrix.com>, "Wei Liu" <wl@xen.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
"Julien Grall" <julien@xen.org>,
"Volodymyr Babchuk" <Volodymyr_Babchuk@epam.com>,
"Bertrand Marquis" <bertrand.marquis@arm.com>
Subject: [PATCH 3/3] common/spinlock: Drop inline from _spin_lock_cb()
Date: Mon, 9 May 2022 13:24:09 +0100 [thread overview]
Message-ID: <20220509122409.14184-4-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <20220509122409.14184-1-andrew.cooper3@citrix.com>
This is undefined behaviour, because there is no _spin_lock_cb() in a separate
translation unit (C11 6.7.4.11).
Moreover, MISRA prohibits this construct because, in the case where it is well
defined, the compiler is free to use either implementation and nothing
prevents the two from being different.
This function has external users, so drop the inline.
Spotted by Eclair MISRA scanner.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
CC: Julien Grall <julien@xen.org>
CC: Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>
CC: Bertrand Marquis <bertrand.marquis@arm.com>
---
xen/common/spinlock.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/xen/common/spinlock.c b/xen/common/spinlock.c
index 62c83aaa6a73..8cb3b316c5b1 100644
--- a/xen/common/spinlock.c
+++ b/xen/common/spinlock.c
@@ -159,7 +159,7 @@ static always_inline u16 observe_head(spinlock_tickets_t *t)
return read_atomic(&t->head);
}
-void inline _spin_lock_cb(spinlock_t *lock, void (*cb)(void *), void *data)
+void _spin_lock_cb(spinlock_t *lock, void (*cb)(void *), void *data)
{
spinlock_tickets_t tickets = SPINLOCK_TICKET_INC;
LOCK_PROFILE_VAR;
--
2.11.0
next prev parent reply other threads:[~2022-05-09 12:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-09 12:24 [PATCH 0/3] xen: Trivial MISRA fixes Andrew Cooper
2022-05-09 12:24 ` [PATCH 1/3] x86/p2m.h: Add include guards Andrew Cooper
2022-05-09 12:32 ` Bertrand Marquis
2022-05-09 13:18 ` Roger Pau Monné
2022-05-09 13:23 ` Andrew Cooper
2022-05-17 15:38 ` Jan Beulich
2022-05-17 18:42 ` Roberto Bagnara
2022-05-18 6:26 ` Jan Beulich
2022-05-09 12:24 ` [PATCH 2/3] x86/shadow: Don't use signed bitfield in sh_emulate_ctxt Andrew Cooper
2022-05-09 12:40 ` Bertrand Marquis
2022-05-09 13:19 ` Roger Pau Monné
2022-05-09 12:24 ` Andrew Cooper [this message]
2022-05-09 12:34 ` [PATCH 3/3] common/spinlock: Drop inline from _spin_lock_cb() Bertrand Marquis
2022-05-09 13:53 ` Roger Pau Monné
2022-05-17 15:42 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220509122409.14184-4-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=JBeulich@suse.com \
--cc=Volodymyr_Babchuk@epam.com \
--cc=bertrand.marquis@arm.com \
--cc=julien@xen.org \
--cc=roger.pau@citrix.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.