kernel: replace "kmalloc+memset" with kzalloc in kernel/ dir
PATCH 1/1 kernel: replace "kmalloc+memset" with kzalloc in kernel/ dir
Replace kmalloc()+memset() combination with kzalloc().
---
auditfilter.c | 3 +-- futex.c | 4 +--- kexec.c | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-)
kernel/auditfilter.c +1 -2
@@ -636,10 +636,9 @@ static struct audit_rule *audit_krule_tostruct audit_rule *rule;int i; - rule =kmalloc (sizeof (*rule),GFP_KERNEL ); + rule =kzalloc (sizeof (*rule),GFP_KERNEL );if (unlikely (!rule))return NULL ; -memset (rule,0 ,sizeof (*rule)); rule->flags = krule->flags | krule->listnr; rule->action = krule->action;
kernel/futex.c +1 -3
@@ -324,12 +324,10 @@ static int refill_pi_state_cache(void)if (likely (current->pi_state_cache))return 0 ; - pi_state =kmalloc (sizeof (*pi_state),GFP_KERNEL ); - + pi_state =kzalloc (sizeof (*pi_state),GFP_KERNEL );if (!pi_state)return -ENOMEM ; -memset (pi_state,0 ,sizeof (*pi_state));INIT_LIST_HEAD (&pi_state->list);/* pi_mutex gets initialized later */ pi_state->owner =NULL ;
kernel/kexec.c +1 -2
@@ -108,11 +108,10 @@ static int do_kimage_alloc(struct kimage/* Allocate a controlling structure */ result = -ENOMEM ; - image =kmalloc (sizeof (*image),GFP_KERNEL ); + image =kzalloc (sizeof (*image),GFP_KERNEL );if (!image) goto out; -memset (image,0 ,sizeof (*image)); image->head =0 ; image->entry = &image->head; image->last_entry = &image->head;
Quoted 4 lines · On Sun, 3 Dec 2006 08:31:50 -0500 (EST) "Robert P. J. Day"…
Replace kmalloc()+memset() combination with
kzalloc().Signed-off-by Robert P. J. Day <[email protected]>
Quoted 11 lines · On Sun, 3 Dec 2006 08:31:50 -0500 (EST) Robert P. J. Day wrote:
Replace kmalloc()+memset() combination with
kzalloc().Signed-off-by Robert P. J. Day <[email protected]>---
auditfilter.c | 3 +-- futex.c | 4 +--- kexec.c | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-)
Please use diffstat -p1 -w70 as indicated inDocumentation/SubmittingPatches.
---
~Randy
Quoted 9 lines · Randy Dunlap
Quoted 7 lines · On Sun, 3 Dec 2006 08:31:50 -0500 (EST) Robert P. J. Day wrote:
Replace kmalloc()+memset() combination with
kzalloc().Signed-off-by Robert P. J. Day <[email protected]>---
Quoted 7 lines
Quoted 4 lines
auditfilter.c | 3 +-- futex.c | 4 +--- kexec.c | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-)Please use diffstat -p1 -w70 as indicated in
Documentation/SubmittingPatches.
whoops, sorry. i hadn't noticed that before. should i resubmit that patch with the correct diffstat formatting?
rday
Quoted 14 lines · Robert P. J. Day
Quoted 12 lines · Randy Dunlap
Quoted 10 lines · On Sun, 3 Dec 2006 08:31:50 -0500 (EST) Robert P. J. Day wrote:
Replace kmalloc()+memset() combination with
kzalloc().Signed-off-by Robert P. J. Day <[email protected]>---
auditfilter.c | 3 +-- futex.c | 4 +--- kexec.c | 3 +-- 3 files changed, 3 insertions(+), 7 deletions(-)
Quoted 5 lines
Quoted 2 lines
Please use diffstat -p1 -w70 as indicated in
Documentation/SubmittingPatches.whoops, sorry. i hadn't noticed that before. should i resubmit that patch with the correct diffstat formatting?
No.
Signature · 1 line
~Randy