]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
audit: use 'unsigned int' instead of 'unsigned'
authorRicardo Robaina <rrobaina@redhat.com>
Thu, 14 May 2026 15:13:20 +0000 (12:13 -0300)
committerPaul Moore <paul@paul-moore.com>
Tue, 26 May 2026 21:15:30 +0000 (17:15 -0400)
Address checkpatch.pl warning below, across the audit subsystem:

  WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Minor cleanup, no functional changes.

Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
include/linux/audit.h
include/linux/audit_arch.h
kernel/audit.c
kernel/audit.h
kernel/audit_tree.c
kernel/audit_watch.c
kernel/auditfilter.c
kernel/auditsc.c
lib/compat_audit.c

index 803b0183d98dd2c459b64c31c457d9fda7e75f96..45abb3722d304cbcc0aca0006d1aeb15944ca680 100644 (file)
@@ -133,8 +133,8 @@ enum audit_nfcfgop {
        AUDIT_NFT_OP_INVALID,
 };
 
-extern int __init audit_register_class(int class, unsigned *list);
-extern int audit_classify_syscall(int abi, unsigned syscall);
+extern int __init audit_register_class(int class, unsigned int *list);
+extern int audit_classify_syscall(int abi, unsigned int syscall);
 extern int audit_classify_arch(int arch);
 
 /* audit_names->type values */
index 2b8153791e6a5d7a29f58a281a5697575e567599..a35069a6c15de2da786d52ca61717cd6184378f5 100644 (file)
@@ -21,13 +21,13 @@ enum auditsc_class_t {
        AUDITSC_NVALS /* count */
 };
 
-extern int audit_classify_compat_syscall(int abi, unsigned syscall);
+extern int audit_classify_compat_syscall(int abi, unsigned int syscall);
 
 /* only for compat system calls */
-extern unsigned compat_write_class[];
-extern unsigned compat_read_class[];
-extern unsigned compat_dir_class[];
-extern unsigned compat_chattr_class[];
-extern unsigned compat_signal_class[];
+extern unsigned int compat_write_class[];
+extern unsigned int compat_read_class[];
+extern unsigned int compat_dir_class[];
+extern unsigned int compat_chattr_class[];
+extern unsigned int compat_signal_class[];
 
 #endif
index e1d489bc2dff99c27272106de879448b9deb7621..a6f367a0d424a2e65c05e92d7ea8ad5cea768536 100644 (file)
@@ -2030,7 +2030,7 @@ void audit_log_vformat(struct audit_buffer *ab, const char *fmt, va_list args)
                 * here and AUDIT_BUFSIZ is at least 1024, then we can
                 * log everything that printk could have logged. */
                avail = audit_expand(ab,
-                       max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail));
+                       max_t(unsigned int, AUDIT_BUFSIZ, 1+len-avail));
                if (!avail)
                        goto out_va_end;
                len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);
index ac81fa02bcd7501e31461a346c4e599841525001..a5926c83e61bdcb5a83fc238738e33417b53165e 100644 (file)
@@ -233,7 +233,7 @@ static inline int audit_hash_ino(u64 ino)
 /* Indicates that audit should log the full pathname. */
 #define AUDIT_NAME_FULL -1
 
-extern int audit_match_class(int class, unsigned syscall);
+extern int audit_match_class(int class, unsigned int syscall);
 extern int audit_comparator(const u32 left, const u32 op, const u32 right);
 extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right);
 extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right);
index ee84777fdfad6f5fd00300564b5e8a17960cf356..1ed19b7759129a355aa4f55f45d3f62b93c3eee3 100644 (file)
@@ -33,7 +33,7 @@ struct audit_chunk {
        struct audit_node {
                struct list_head list;
                struct audit_tree *owner;
-               unsigned index;         /* index; upper bit indicates 'will prune' */
+               unsigned int index;     /* index; upper bit indicates 'will prune' */
        } owners[] __counted_by(count);
 };
 
index 33577f0f54eff1eafe48a94dd2839b00fe7dffcc..c9fe64f73ffc9635a4f9ecb68a5aefe0a7ea1365 100644 (file)
@@ -244,7 +244,7 @@ static void audit_watch_log_rule_change(struct audit_krule *r, struct audit_watc
 /* Update inode info in audit rules based on filesystem event. */
 static void audit_update_watch(struct audit_parent *parent,
                               const struct qstr *dname, dev_t dev,
-                              u64 ino, unsigned invalidating)
+                              u64 ino, unsigned int invalidating)
 {
        struct audit_watch *owatch, *nwatch, *nextw;
        struct audit_krule *r, *nextr;
index 093425123f6c7b3bafe45aa0251861478dd2b815..b97c974958079ae4071d1668937b9f8fafdc128b 100644 (file)
@@ -165,13 +165,13 @@ static inline int audit_to_inode(struct audit_krule *krule,
 
 static __u32 *classes[AUDIT_SYSCALL_CLASSES];
 
-int __init audit_register_class(int class, unsigned *list)
+int __init audit_register_class(int class, unsigned int *list)
 {
        __u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
        if (!p)
                return -ENOMEM;
        while (*list != ~0U) {
-               unsigned n = *list++;
+               unsigned int n = *list++;
                if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
                        kfree(p);
                        return -EINVAL;
@@ -186,7 +186,7 @@ int __init audit_register_class(int class, unsigned *list)
        return 0;
 }
 
-int audit_match_class(int class, unsigned syscall)
+int audit_match_class(int class, unsigned int syscall)
 {
        if (unlikely(syscall >= AUDIT_BITMASK_SIZE * 32))
                return 0;
@@ -237,7 +237,7 @@ static int audit_match_signal(struct audit_entry *entry)
 /* Common user-space to kernel rule translation. */
 static inline struct audit_entry *audit_to_entry_common(struct audit_rule_data *rule)
 {
-       unsigned listnr;
+       unsigned int listnr;
        struct audit_entry *entry;
        int i, err;
 
index ab54fccba215ca61d56335d1a22a7f26297e28ee..b0e809d4d2f271ff2b5020daf891fd21053aaea6 100644 (file)
@@ -150,7 +150,7 @@ static const struct audit_nfcfgop_tab audit_nfcfgs[] = {
 
 static int audit_match_perm(struct audit_context *ctx, int mask)
 {
-       unsigned n;
+       unsigned int n;
 
        if (unlikely(!ctx))
                return 0;
index 3d6b8996f027dfc93d16da6c3fc52e9e17963a00..fee1dfccd116b06c6bee37ab158c11b690cc4f85 100644 (file)
@@ -4,32 +4,32 @@
 #include <linux/audit_arch.h>
 #include <asm/unistd32.h>
 
-unsigned compat_dir_class[] = {
+unsigned int compat_dir_class[] = {
 #include <asm-generic/audit_dir_write.h>
 ~0U
 };
 
-unsigned compat_read_class[] = {
+unsigned int compat_read_class[] = {
 #include <asm-generic/audit_read.h>
 ~0U
 };
 
-unsigned compat_write_class[] = {
+unsigned int compat_write_class[] = {
 #include <asm-generic/audit_write.h>
 ~0U
 };
 
-unsigned compat_chattr_class[] = {
+unsigned int compat_chattr_class[] = {
 #include <asm-generic/audit_change_attr.h>
 ~0U
 };
 
-unsigned compat_signal_class[] = {
+unsigned int compat_signal_class[] = {
 #include <asm-generic/audit_signal.h>
 ~0U
 };
 
-int audit_classify_compat_syscall(int abi, unsigned syscall)
+int audit_classify_compat_syscall(int abi, unsigned int syscall)
 {
        switch (syscall) {
 #ifdef __NR_open