Skip to contentSkip to conversation

copy_signal cleanup: clean acct_init_pacct() and taskstats_tgid_init()

PATCH In review Veaceslav Falico 2 participants 2 messages Dec 1, 2009 – Dec 2, 2009 Taskstats statistics interface

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 copy_signal cleanup: clean acct_init_pacct() and taskstats_tgid_init()

Remove unneeded initializations in acct_init_pacct() and taskstats_tgid_init(). These are accessed only via copy_signal().

---

include/linux/taskstats_kern.h +0 -1
index 3398f45..d66167a 100644
@@ -16,7 +16,6 @@ extern struct mutex taskstats_exit_mutex;
 
 static inline void taskstats_tgid_init(struct signal_struct *sig)
 {
-	sig->stats = NULL;
 }
 
 static inline void taskstats_tgid_free(struct signal_struct *sig)
kernel/acct.c +0 -2
index 9a4715a..8909c26 100644
@@ -592,8 +592,6 @@ out:
  */
 void acct_init_pacct(struct pacct_struct *pacct)
 {
-	memset(pacct, 0, sizeof(struct pacct_struct));
-	pacct->ac_utime = pacct->ac_stime = cputime_zero;
 }
 
 /**
#1 lore raw
Quoted 24 lines · Veaceslav Falico

Remove unneeded initializations in acct_init_pacct() and taskstats_tgid_init(). These are accessed only via copy_signal().

---

include/linux/taskstats_kern.h +0 -1
index 3398f45..d66167a 100644
@@ -16,7 +16,6 @@ extern struct mutex taskstats_exit_mutex;
 
 static inline void taskstats_tgid_init(struct signal_struct *sig)
 {
-	sig->stats = NULL;
 }
 
 static inline void taskstats_tgid_free(struct signal_struct *sig)
kernel/acct.c +0 -0
index 9a4715a..8909c26 100644

kernel/acct.c out: · line 595

Quoted 6 lines
kernel/acct.c +0 -2
@@ -592,8 +592,6 @@ out:
  */
 void acct_init_pacct(struct pacct_struct *pacct)
 {
-	memset(pacct, 0, sizeof(struct pacct_struct));
-	pacct->ac_utime = pacct->ac_stime = cputime_zero;
 }

Looks good imho. But please note that with this patch both taskstats_tgid_init() and acct_init_pacct() become empty, and we already have "empty" definitions for #ifndef case.

Perhaps it makes sense to move this (now empty) helper outside of #ifdef, or just kill it.

Up to maintainres.

Oleg.