From: Christian Göttsche Date: Fri, 5 Apr 2024 15:15:23 +0000 (+0200) Subject: selinux: avoid printk_ratelimit() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=851541709afc1a0e4fe9e8a67afd4c517223138b;p=linux.git 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 Signed-off-by: Paul Moore --- diff --git a/security/selinux/ss/services.c b/security/selinux/ss/services.c index e88b1b6c4adbb..f20e1968b7f7a 100644 --- a/security/selinux/ss/services.c +++ b/security/selinux/ss/services.c @@ -633,8 +633,7 @@ static void context_struct_compute_av(struct policydb *policydb, } if (unlikely(!tclass || tclass > policydb->p_classes.nprim)) { - if (printk_ratelimit()) - pr_warn("SELinux: Invalid class %hu\n", tclass); + pr_warn_ratelimited("SELinux: Invalid class %u\n", tclass); return; }