x86:kernel:e820c:kmemdup instead of duplicating its function
PATCH 1/1 x86:kernel:e820c:kmemdup instead of duplicating its function
From: "huang.zijiang" <[email protected]>
kmemdup has implemented the function that kmalloc() and memcpy().
--- arch/x86/kernel/e820.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
arch/x86/kernel/e820.c +3 -6
@@ -671,21 +671,18 @@ __init void e820__reallocate_tables(void)int size; size = offsetof(struct e820_table , entries) +sizeof (struct e820_entry )*e820_table->nr_entries; - n =kmalloc (size,GFP_KERNEL ); + n =kmemdup (e820_table, size,GFP_KERNEL );BUG_ON (!n); -memcpy (n, e820_table, size); e820_table = n; size = offsetof(struct e820_table , entries) +sizeof (struct e820_entry )*e820_table_kexec->nr_entries; - n =kmalloc (size,GFP_KERNEL ); + n =kmemdup (e820_table_kexec, size,GFP_KERNEL );BUG_ON (!n); -memcpy (n, e820_table_kexec, size); e820_table_kexec = n; size = offsetof(struct e820_table , entries) +sizeof (struct e820_entry )*e820_table_firmware->nr_entries; - n =kmalloc (size,GFP_KERNEL ); + n =kmemdup (e820_table_firmware, size,GFP_KERNEL );BUG_ON (!n); -memcpy (n, e820_table_firmware, size); e820_table_firmware = n; }
Signature · 1 line
1.8.3.1
Borislav Petkov
maintainerQuoted 2 lines
Subject: Re: [PATCH] x86:kernel:e820c:kmemdup instead of duplicating its function
The tip tree preferred format for patch subject prefixes is 'subsys/component:', e.g. 'x86/apic:', 'x86/mm/fault:', 'sched/fair:', 'genirq/core:'. Please do not use file names or complete file paths as prefix. 'git log path/to/file' should give you a reasonable hint in most cases.
The condensed patch description in the subject line should start with a uppercase letter and should be written in imperative tone.
Quoted 1 line · Yi Wang
From: "huang.zijiang" <[email protected]>
^^^^^^^^^^^^^^
I'm guessing your name is "Huang Zijiang" and you'd like to have it this way in git history, instead with small letters and with a dot inbetween?
Quoted 1 line
kmemdup has implemented the function that
kmalloc()andmemcpy().
This is not a correct english sentence. Please try again.
Signature · 4 lines
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.