X86:microcode: fix vfree()
PATCH 1/1 X86:microcode: fix vfree()
vfree() does it's own 'NULL' check,so no need for check before calling it.
---arch/x86/kernel/microcode_amd.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
arch/x86/kernel/microcode_amd.c +5 -8
@@ -257,10 +257,9 @@ static int install_equiv_cpu_table(const u8 *buf)static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; + }static int generic_load_microcode (int cpu,const u8 *data,size_t size)
@@ -293,8 +292,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size) mc_header = (struct microcode_header_amd *)mc;if (get_matching_microcode (cpu, mc, new_rev)) { -if (new_mc) -vfree (new_mc); +vfree (new_mc); new_rev = mc_header->patch_id; new_mc = mc; }else
@@ -306,8 +304,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size)if (new_mc) {if (!leftover) { -if (uci->mc) -vfree (uci->mc); +vfree (uci->mc); uci->mc = new_mc; pr_debug("microcode: CPU%d found a matching microcode " "update with version 0x%x (current=0x%x)\n",
Quoted 3 lines · Figo.zhang
vfree()does it's own 'NULL' check,so no need for check before calling it.
looks good, but:
s/it's/its/
s/check,so/check, so/
and:
arch/x86/kernel/microcode_amd.c static int install_equiv_cpu_table(const u8 *buf) · line 263
Quoted 10 lines
static void
free_equiv_cpu_table(void)
{arch/x86/kernel/microcode_amd.c +3
-4-if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; + }
stray newline and tab.
Ingo
PATCH RESEND 1/1 X86:microcode: fix vfree()
vfree() does its own 'NULL' check, so no need for check before calling it.
---arch/x86/kernel/microcode_amd.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
arch/x86/kernel/microcode_amd.c +5 -8
@@ -257,10 +257,9 @@ static int install_equiv_cpu_table(const u8 *buf)static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; + }static int generic_load_microcode (int cpu,const u8 *data,size_t size)
@@ -293,8 +292,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size) mc_header = (struct microcode_header_amd *)mc;if (get_matching_microcode (cpu, mc, new_rev)) { -if (new_mc) -vfree (new_mc); +vfree (new_mc); new_rev = mc_header->patch_id; new_mc = mc; }else
@@ -306,8 +304,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size)if (new_mc) {if (!leftover) { -if (uci->mc) -vfree (uci->mc); +vfree (uci->mc); uci->mc = new_mc; pr_debug("microcode: CPU%d found a matching microcode " "update with version 0x%x (current=0x%x)\n",
(Note: it's not a 'resend', it's v2 of the patch)
Quoted 13 lines · Figo.zhang
vfree()does its own 'NULL' check, so no need for check before calling it.Signed-off-by Figo.zhang <[email protected]>---
arch/x86/kernel/microcode_amd.c| 13 +++++--------1 files changed, 5 insertions(+), 8 deletions(-)arch/x86/kernel/microcode_amd.c +0
-0
arch/x86/kernel/microcode_amd.c static int install_equiv_cpu_table(const u8 *buf) · line 262
Quoted 10 lines
arch/x86/kernel/microcode_amd.c +3
-4@@ -257,10 +257,9 @@ static int install_equiv_cpu_table(const u8 *buf)static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; +
you fixed the tab but you didnt remove the stray newline :)
Ingo
Quoted 18 lines · Ingo Molnar
(Note: it's not a 'resend', it's v2 of the patch)
Quoted 14 lines · Figo.zhang
vfree()does its own 'NULL' check, so no need for check before calling it.Signed-off-by Figo.zhang <[email protected]>---
arch/x86/kernel/microcode_amd.c| 13 +++++--------1 files changed, 5 insertions(+), 8 deletions(-)arch/x86/kernel/microcode_amd.c +0
-0@@ -257,10 +257,9 @@ static int install_equiv_cpu_table(const u8 *buf)
Quoted 9 lines
arch/x86/kernel/microcode_amd.c static int install_equiv_cpu_table(const u8 *buf) · line 262
Quoted 9 lines
arch/x86/kernel/microcode_amd.c +3
-4static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; +
i motify by vim, you said this line?
Best Regards,
Figo.zhang
Quoted 4 lines
you fixed the tab but you didnt remove the stray newline :)
Ingo
Quoted 19 lines · Figo.zhang
Quoted 18 lines · Ingo Molnar
(Note: it's not a 'resend', it's v2 of the patch)
Quoted 14 lines · Figo.zhang
vfree()does its own 'NULL' check, so no need for check before calling it.Signed-off-by Figo.zhang <[email protected]>---
arch/x86/kernel/microcode_amd.c| 13 +++++--------1 files changed, 5 insertions(+), 8 deletions(-)arch/x86/kernel/microcode_amd.c +0
-0@@ -257,10 +257,9 @@ static int install_equiv_cpu_table(const u8 *buf)
Quoted 11 lines
Quoted 9 lines
arch/x86/kernel/microcode_amd.c static int install_equiv_cpu_table(const u8 *buf) · line 262
Quoted 9 lines
arch/x86/kernel/microcode_amd.c +3
-4static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; +i motify by vim, you said this line?
yes, that extra empty newline should not be there. (i.e. the line should be removed)
Ingo
PATCH v2 1/1 X86:microcode: fix vfree()
In reply to Ingo Molnarvfree() does its own 'NULL' check, so no need for check before calling it.
In v2, remove the stray newline.
---arch/x86/kernel/microcode_amd.c | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
arch/x86/kernel/microcode_amd.c +4 -8
@@ -257,10 +257,8 @@ static int install_equiv_cpu_table(const u8 *buf)static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; }static int generic_load_microcode (int cpu,const u8 *data,size_t size)
@@ -293,8 +291,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size) mc_header = (struct microcode_header_amd *)mc;if (get_matching_microcode (cpu, mc, new_rev)) { -if (new_mc) -vfree (new_mc); +vfree (new_mc); new_rev = mc_header->patch_id; new_mc = mc; }else
@@ -306,8 +303,7 @@ static int generic_load_microcode(int cpu, const u8 *data, size_t size)if (new_mc) {if (!leftover) { -if (uci->mc) -vfree (uci->mc); +vfree (uci->mc); uci->mc = new_mc; pr_debug("microcode: CPU%d found a matching microcode " "update with version 0x%x (current=0x%x)\n",
[tip:x86/microcode] x86, microcode: Simplify vfree() use
Commit-ID: aeef50bc0483fa70ce0bddb686ec84a274b7f3d4 Gitweb: http://git.kernel.org/tip/aeef50bc0483fa70ce0bddb686ec84a274b7f3d4 Author: Figo.zhang <[email protected]> AuthorDate: Sun, 7 Jun 2009 22:30:36 +0800 Committer: Ingo Molnar <[email protected]> CommitDate: Sun, 7 Jun 2009 16:35:11 +0200
x86, microcode: Simplify vfree() use
vfree() does its own 'NULL' check, so no need for check before calling it.
In v2, remove the stray newline.
[ Impact: cleanup ]
LKML-Reference: <1244385036.3402.11.camel@myhost>
--- arch/x86/kernel/microcode_amd.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-)
arch/x86/kernel/microcode_amd.c +4 -8
@@ -241,10 +241,8 @@ static int install_equiv_cpu_table(const u8 *buf)static void free_equiv_cpu_table (void ) { -if (equiv_cpu_table) { -vfree (equiv_cpu_table); - equiv_cpu_table =NULL ; - } +vfree (equiv_cpu_table); + equiv_cpu_table =NULL ; } static enum ucode_state
@@ -279,8 +277,7 @@ generic_load_microcode(int cpu, const u8 *data, size_t size) mc_header = (struct microcode_header_amd *)mc;if (get_matching_microcode (cpu, mc, new_rev)) { -if (new_mc) -vfree (new_mc); +vfree (new_mc); new_rev = mc_header->patch_id; new_mc = mc; }else
@@ -292,8 +289,7 @@ generic_load_microcode(int cpu, const u8 *data, size_t size)if (new_mc) {if (!leftover) { -if (uci->mc) -vfree (uci->mc); +vfree (uci->mc); uci->mc = new_mc; pr_debug("microcode: CPU%d found a matching microcode " "update with version 0x%x (current=0x%x)\n",
Quoted 1 line · Figo.zhang
Ingo
hi, Ingo,
is it ok for v2?
Best Regards,
Figo.zhang