audit: add missing unlikely hint to audit_dummy_context() wrappers
PATCH 1/1 audit: add missing unlikely hint to audit_dummy_context() wrappers
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.
--- include/linux/audit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
include/linux/audit.h +3 -3
@@ -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); }
Signature · 1 line
2.55.0
Paul Moore
maintainerQuoted 11 lines · On Aug 7, 2026 Ricardo Robaina <[email protected]> wrote:
The inline wrappers:
audit_log_kern_module(),audit_tk_injoffset(), andaudit_ntp_log()checkaudit_dummy_context()withoutunlikely(), unlike every other wrapper in the file.Add the missing annotations for consistency.
Signed-off-by Ricardo Robaina <[email protected]>--- include/linux/audit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Thanks. Merged into audit/dev-staging due to the merge window, this will move to audit/dev next week.
--
paul-moore.com
Thanks, Paul!
Quoted 20 lines · Paul Moore
Quoted 11 lines · On Aug 7, 2026 Ricardo Robaina <[email protected]> wrote:
The inline wrappers:
audit_log_kern_module(),audit_tk_injoffset(), andaudit_ntp_log()checkaudit_dummy_context()withoutunlikely(), unlike every other wrapper in the file.Add the missing annotations for consistency.
Signed-off-by Ricardo Robaina <[email protected]>--- include/linux/audit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)Thanks. Merged into audit/dev-staging due to the merge window, this will move to audit/dev next week.
--
paul-moore.com
Paul Moore
maintainerQuoted 8 lines · Paul Moore
Quoted 7 lines · On Aug 7, 2026 Ricardo Robaina <[email protected]> wrote:
The inline wrappers:
audit_log_kern_module(),audit_tk_injoffset(), andaudit_ntp_log()checkaudit_dummy_context()withoutunlikely(), unlike every other wrapper in the file.Add the missing annotations for consistency.
Quoted 7 lines
Quoted 4 lines
Signed-off-by Ricardo Robaina <[email protected]>--- include/linux/audit.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)Thanks. Merged into audit/dev-staging due to the merge window, this will move to audit/dev next week.
... now in audit/dev, thanks!
Signature · 1 line
paul-moore.com