Skip to content

Commit 8515417

Browse files
cgzonespcmoore
authored andcommitted
selinux: avoid printk_ratelimit()
The usage of printk_ratelimit() is discouraged, see include/linux/printk.h, thus use pr_warn_ratelimited(). While editing this line address the following checkpatch warning: WARNING: Integer promotion: Using 'h' in '%hu' is unnecessary Signed-off-by: Christian Göttsche <[email protected]> Signed-off-by: Paul Moore <[email protected]>
1 parent fc98317 commit 8515417

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

security/selinux/ss/services.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,7 @@ static void context_struct_compute_av(struct policydb *policydb,
633633
}
634634

635635
if (unlikely(!tclass || tclass > policydb->p_classes.nprim)) {
636-
if (printk_ratelimit())
637-
pr_warn("SELinux: Invalid class %hu\n", tclass);
636+
pr_warn_ratelimited("SELinux: Invalid class %u\n", tclass);
638637
return;
639638
}
640639

0 commit comments

Comments
 (0)