Skip to content

Commit ee59951

Browse files
rprobainagregkh
authored andcommitted
audit: use 'unsigned int' instead of 'unsigned'
[ Upstream commit 8b22677 ] 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> Stable-dep-of: 81905b5 ("audit: fix recursive locking deadlock in audit_dupe_exe()") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 09fe393 commit ee59951

8 files changed

Lines changed: 22 additions & 22 deletions

File tree

include/linux/audit.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ enum audit_nfcfgop {
123123
AUDIT_NFT_OP_INVALID,
124124
};
125125

126-
extern int __init audit_register_class(int class, unsigned *list);
127-
extern int audit_classify_syscall(int abi, unsigned syscall);
126+
extern int __init audit_register_class(int class, unsigned int *list);
127+
extern int audit_classify_syscall(int abi, unsigned int syscall);
128128
extern int audit_classify_arch(int arch);
129129

130130
/* audit_names->type values */

include/linux/audit_arch.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ enum auditsc_class_t {
2121
AUDITSC_NVALS /* count */
2222
};
2323

24-
extern int audit_classify_compat_syscall(int abi, unsigned syscall);
24+
extern int audit_classify_compat_syscall(int abi, unsigned int syscall);
2525

2626
/* only for compat system calls */
27-
extern unsigned compat_write_class[];
28-
extern unsigned compat_read_class[];
29-
extern unsigned compat_dir_class[];
30-
extern unsigned compat_chattr_class[];
31-
extern unsigned compat_signal_class[];
27+
extern unsigned int compat_write_class[];
28+
extern unsigned int compat_read_class[];
29+
extern unsigned int compat_dir_class[];
30+
extern unsigned int compat_chattr_class[];
31+
extern unsigned int compat_signal_class[];
3232

3333
#endif

kernel/audit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1985,7 +1985,7 @@ static void audit_log_vformat(struct audit_buffer *ab, const char *fmt,
19851985
* here and AUDIT_BUFSIZ is at least 1024, then we can
19861986
* log everything that printk could have logged. */
19871987
avail = audit_expand(ab,
1988-
max_t(unsigned, AUDIT_BUFSIZ, 1+len-avail));
1988+
max_t(unsigned int, AUDIT_BUFSIZ, 1+len-avail));
19891989
if (!avail)
19901990
goto out_va_end;
19911991
len = vsnprintf(skb_tail_pointer(skb), avail, fmt, args2);

kernel/audit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ static inline int audit_hash_ino(u64 ino)
227227
/* Indicates that audit should log the full pathname. */
228228
#define AUDIT_NAME_FULL -1
229229

230-
extern int audit_match_class(int class, unsigned syscall);
230+
extern int audit_match_class(int class, unsigned int syscall);
231231
extern int audit_comparator(const u32 left, const u32 op, const u32 right);
232232
extern int audit_uid_comparator(kuid_t left, u32 op, kuid_t right);
233233
extern int audit_gid_comparator(kgid_t left, u32 op, kgid_t right);

kernel/audit_tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct audit_chunk {
3333
struct audit_node {
3434
struct list_head list;
3535
struct audit_tree *owner;
36-
unsigned index; /* index; upper bit indicates 'will prune' */
36+
unsigned int index; /* index; upper bit indicates 'will prune' */
3737
} owners[] __counted_by(count);
3838
};
3939

kernel/auditfilter.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ static inline int audit_to_inode(struct audit_krule *krule,
165165

166166
static __u32 *classes[AUDIT_SYSCALL_CLASSES];
167167

168-
int __init audit_register_class(int class, unsigned *list)
168+
int __init audit_register_class(int class, unsigned int *list)
169169
{
170170
__u32 *p = kcalloc(AUDIT_BITMASK_SIZE, sizeof(__u32), GFP_KERNEL);
171171
if (!p)
172172
return -ENOMEM;
173173
while (*list != ~0U) {
174-
unsigned n = *list++;
174+
unsigned int n = *list++;
175175
if (n >= AUDIT_BITMASK_SIZE * 32 - AUDIT_SYSCALL_CLASSES) {
176176
kfree(p);
177177
return -EINVAL;
@@ -186,7 +186,7 @@ int __init audit_register_class(int class, unsigned *list)
186186
return 0;
187187
}
188188

189-
int audit_match_class(int class, unsigned syscall)
189+
int audit_match_class(int class, unsigned int syscall)
190190
{
191191
if (unlikely(syscall >= AUDIT_BITMASK_SIZE * 32))
192192
return 0;
@@ -237,7 +237,7 @@ static int audit_match_signal(struct audit_entry *entry)
237237
/* Common user-space to kernel rule translation. */
238238
static inline struct audit_entry *audit_to_entry_common(struct audit_rule_data *rule)
239239
{
240-
unsigned listnr;
240+
unsigned int listnr;
241241
struct audit_entry *entry;
242242
int i, err;
243243

kernel/auditsc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static const struct audit_nfcfgop_tab audit_nfcfgs[] = {
150150

151151
static int audit_match_perm(struct audit_context *ctx, int mask)
152152
{
153-
unsigned n;
153+
unsigned int n;
154154

155155
if (unlikely(!ctx))
156156
return 0;

lib/compat_audit.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,32 @@
44
#include <linux/audit_arch.h>
55
#include <asm/unistd32.h>
66

7-
unsigned compat_dir_class[] = {
7+
unsigned int compat_dir_class[] = {
88
#include <asm-generic/audit_dir_write.h>
99
~0U
1010
};
1111

12-
unsigned compat_read_class[] = {
12+
unsigned int compat_read_class[] = {
1313
#include <asm-generic/audit_read.h>
1414
~0U
1515
};
1616

17-
unsigned compat_write_class[] = {
17+
unsigned int compat_write_class[] = {
1818
#include <asm-generic/audit_write.h>
1919
~0U
2020
};
2121

22-
unsigned compat_chattr_class[] = {
22+
unsigned int compat_chattr_class[] = {
2323
#include <asm-generic/audit_change_attr.h>
2424
~0U
2525
};
2626

27-
unsigned compat_signal_class[] = {
27+
unsigned int compat_signal_class[] = {
2828
#include <asm-generic/audit_signal.h>
2929
~0U
3030
};
3131

32-
int audit_classify_compat_syscall(int abi, unsigned syscall)
32+
int audit_classify_compat_syscall(int abi, unsigned int syscall)
3333
{
3434
switch (syscall) {
3535
#ifdef __NR_open

0 commit comments

Comments
 (0)