lkml.org 
[lkml]   [2016]   [Apr]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] Cleanup __pvclock_read_cycles to remove useless variables
On Sat, Apr 30, 2016 at 6:24 AM, Borislav Petkov <bp@suse.de> wrote:
> 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()...
>

Take a look at vread_pvclock. I decided that __pvclock_read_cycles
was too ugly to use and was very slow and I just gave up and rewrote
it.

> --
> Regards/Gruss,
> Boris.
>
> SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg)
> --



--
Andy Lutomirski
AMA Capital Management, LLC

\
 
 \ /
  Last update: 2016-04-30 20:01    [W:0.054 / U:0.632 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site