Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1560874
| From | Thomas Gleixner <tglx@linutronix.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() |
| Date | 2017-01-17 19:00 +0100 |
| Message-ID | <t0Gd4-1D8-33@gated-at.bofh.it> (permalink) |
| References | <t0FTI-1vq-27@gated-at.bofh.it> <t0G3o-1zz-25@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Tue, 17 Jan 2017, Borislav Petkov wrote:
> From: Borislav Petkov <bp@suse.de>
>
> No need to have it marked "inline" - let gcc decide. Also, shorten the
> argument name and simplify while-test.
>
> No functionality change.
>
> Signed-off-by: Borislav Petkov <bp@suse.de>
> ---
> arch/x86/kernel/cpu/microcode/amd.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
> index 3f89e6712afe..889fd61bc033 100644
> --- a/arch/x86/kernel/cpu/microcode/amd.c
> +++ b/arch/x86/kernel/cpu/microcode/amd.c
> @@ -97,17 +97,16 @@ static size_t compute_container_size(u8 *data, u32 total_size)
> return size;
> }
>
> -static inline u16 find_equiv_id(struct equiv_cpu_entry *equiv_cpu_table,
> - unsigned int sig)
> +static u16 find_equiv_id(struct equiv_cpu_entry *equiv_table, u32 sig)
> {
> int i = 0;
>
> - if (!equiv_cpu_table)
> + if (!equiv_table)
> return 0;
>
> - while (equiv_cpu_table[i].installed_cpu != 0) {
> - if (sig == equiv_cpu_table[i].installed_cpu)
> - return equiv_cpu_table[i].equiv_cpu;
> + while (equiv_table[i].installed_cpu) {
> + if (sig == equiv_table[i].installed_cpu)
> + return equiv_table[i].equiv_cpu;
>
> i++;
While you are at it, please rewrite that thing as a for loop, which is the
obvious correct thing:
for (i = 0; equiv_table[i].installed_cpu; i++)
and even simpler:
for (; equiv_table->installed_cpu; equiv_table++)
Hmm?
Thanks,
tglx
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Borislav Petkov <bp@alien8.de> - 2017-01-17 18:50 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Thomas Gleixner <tglx@linutronix.de> - 2017-01-17 19:00 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Borislav Petkov <bp@alien8.de> - 2017-01-17 19:50 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Thomas Gleixner <tglx@linutronix.de> - 2017-01-17 20:10 +0100
Re: [PATCH 03/13] x86/microcode/AMD: Clean up find_equiv_id() Borislav Petkov <bp@alien8.de> - 2017-01-18 00:20 +0100
csiph-web