Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1391622
| From | Borislav Petkov <bp@suse.de> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables |
| Date | 2016-04-30 15:30 +0200 |
| Message-ID | <rtD85-4Q-1@gated-at.bofh.it> (permalink) |
| References | <rrIEW-1iI-29@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, Apr 25, 2016 at 02:53:14PM +0800, Minfei Huang wrote:
> The value of cycles and flags can be assigned directly without
> intermediate variables.
>
> Remove the useless variables.
>
> Signed-off-by: Minfei Huang <mnghuan@gmail.com>
> ---
> arch/x86/include/asm/pvclock.h | 15 ++++-----------
> 1 file changed, 4 insertions(+), 11 deletions(-)
>
> diff --git a/arch/x86/include/asm/pvclock.h b/arch/x86/include/asm/pvclock.h
> index fdcc040..fb95dac 100644
> --- a/arch/x86/include/asm/pvclock.h
> +++ b/arch/x86/include/asm/pvclock.h
> @@ -80,19 +80,12 @@ static __always_inline
> unsigned __pvclock_read_cycles(const struct pvclock_vcpu_time_info *src,
> cycle_t *cycles, u8 *flags)
> {
> - unsigned version;
> - cycle_t ret, offset;
> - u8 ret_flags;
> -
> - version = src->version;
> + cycle_t offset;
>
> offset = pvclock_get_nsec_offset(src);
You could go a step further and get rid of that
pvclock_get_nsec_offset() simple wrapper too and move its meat into
__pvclock_read_cycles()...
--
Regards/Gruss,
Boris.
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
--
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Borislav Petkov <bp@suse.de> - 2016-04-30 15:30 +0200
Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Andy Lutomirski <luto@amacapital.net> - 2016-04-30 19:50 +0200
Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Borislav Petkov <bp@suse.de> - 2016-04-30 21:20 +0200
Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Andy Lutomirski <luto@amacapital.net> - 2016-05-01 00:00 +0200
Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Paolo Bonzini <pbonzini@redhat.com> - 2016-05-11 16:30 +0200
Re: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables Minfei Huang <mnghuan@gmail.com> - 2016-05-11 17:30 +0200
csiph-web