Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

audit: remove redundant initialization of static variables to 0

Static variables are automatically initialized to 0 by the compiler.
Remove the redundant explicit assignments in kernel/audit.c to clean
up the code, align with standard kernel coding style, and fix the
following checkpatch.pl errors:

./scripts/checkpatch.pl kernel/audit.c | grep -A2 ERROR:
ERROR: do not initialise statics to 0
+ static unsigned long last_check = 0;
--
ERROR: do not initialise statics to 0
+ static int messages = 0;
--
ERROR: do not initialise statics to 0
+ static unsigned long last_msg = 0;

Signed-off-by: Ricardo Robaina <rrobaina@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>

authored by

Ricardo Robaina and committed by
Paul Moore
a6053fef f6c29967

+3 -3
+3 -3
kernel/audit.c
··· 355 355 356 356 static inline int audit_rate_check(void) 357 357 { 358 - static unsigned long last_check = 0; 359 - static int messages = 0; 358 + static unsigned long last_check; 359 + static int messages; 360 360 static DEFINE_SPINLOCK(lock); 361 361 unsigned long flags; 362 362 unsigned long now; ··· 391 391 */ 392 392 void audit_log_lost(const char *message) 393 393 { 394 - static unsigned long last_msg = 0; 394 + static unsigned long last_msg; 395 395 static DEFINE_SPINLOCK(lock); 396 396 unsigned long flags; 397 397 unsigned long now;