From: Ricardo Robaina <rrobaina@redhat.com>
To: audit@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: paul@paul-moore.com, eparis@redhat.com,
Ricardo Robaina <rrobaina@redhat.com>
Subject: [PATCH] audit: add missing unlikely hint to audit_dummy_context() wrappers
Date: Fri, 7 Aug 2026 11:05:21 -0300 [thread overview]
Message-ID: <20260807140521.510904-1-rrobaina@redhat.com> (raw)
The inline wrappers: audit_log_kern_module(), audit_tk_injoffset(),
and audit_ntp_log() check audit_dummy_context() without unlikely(),
unlike every other wrapper in the file.
Add the missing annotations for consistency.
Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
---
include/linux/audit.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 45abb3722d30..18b44a1c5397 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -547,7 +547,7 @@ static inline void audit_openat2_how(struct open_how *how)
static inline void audit_log_kern_module(const char *name)
{
- if (!audit_dummy_context())
+ if (unlikely(!audit_dummy_context()))
__audit_log_kern_module(name);
}
@@ -563,7 +563,7 @@ static inline void audit_tk_injoffset(struct timespec64 offset)
if (offset.tv_sec == 0 && offset.tv_nsec == 0)
return;
- if (!audit_dummy_context())
+ if (unlikely(!audit_dummy_context()))
__audit_tk_injoffset(offset);
}
@@ -586,7 +586,7 @@ static inline void audit_ntp_set_new(struct audit_ntp_data *ad,
static inline void audit_ntp_log(const struct audit_ntp_data *ad)
{
- if (!audit_dummy_context())
+ if (unlikely(!audit_dummy_context()))
__audit_ntp_log(ad);
}
--
2.55.0
next reply other threads:[~2026-08-07 14:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-07 14:05 Ricardo Robaina [this message]
2026-08-24 22:11 ` [PATCH] audit: add missing unlikely hint to audit_dummy_context() wrappers Paul Moore
2026-08-25 12:16 ` Ricardo Robaina
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=20260807140521.510904-1-rrobaina@redhat.com \
--to=rrobaina@redhat.com \
--cc=audit@vger.kernel.org \
--cc=eparis@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=paul@paul-moore.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox