diff mbox series

[kvm-unit-tests,v3,06/11] x86: pmu: Remove blank line and redundant space

Message ID 20240103031409.2504051-7-dapeng1.mi@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series pmu test bugs fix and improvements | expand

Commit Message

Mi, Dapeng Jan. 3, 2024, 3:14 a.m. UTC
code style changes.

Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
---
 x86/pmu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mingwei Zhang March 27, 2024, 5:38 a.m. UTC | #1
On Wed, Jan 03, 2024, Dapeng Mi wrote:
> code style changes.
> 
> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Reviewed-by: Mingwei Zhang <mizhang@google.com>
> ---
>  x86/pmu.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/x86/pmu.c b/x86/pmu.c
> index a2c64a1ce95b..46bed66c5c9f 100644
> --- a/x86/pmu.c
> +++ b/x86/pmu.c
> @@ -207,8 +207,7 @@ static noinline void __measure(pmu_counter_t *evt, uint64_t count)
>  static bool verify_event(uint64_t count, struct pmu_event *e)
>  {
>  	// printf("%d <= %ld <= %d\n", e->min, count, e->max);
> -	return count >= e->min  && count <= e->max;
> -
> +	return count >= e->min && count <= e->max;
>  }
>  
>  static bool verify_counter(pmu_counter_t *cnt)
> -- 
> 2.34.1
>
Yang, Weijiang March 28, 2024, 1:23 a.m. UTC | #2
On 1/3/2024 11:14 AM, Dapeng Mi wrote:
> code style changes.
>
> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
> ---
>   x86/pmu.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/x86/pmu.c b/x86/pmu.c
> index a2c64a1ce95b..46bed66c5c9f 100644
> --- a/x86/pmu.c
> +++ b/x86/pmu.c
> @@ -207,8 +207,7 @@ static noinline void __measure(pmu_counter_t *evt, uint64_t count)
>   static bool verify_event(uint64_t count, struct pmu_event *e)
>   {
>   	// printf("%d <= %ld <= %d\n", e->min, count, e->max);
> -	return count >= e->min  && count <= e->max;
> -
> +	return count >= e->min && count <= e->max;

I don't think it's necessary to fix the nit in a separate patch, just squash it in some patch with
"Opportunistically ...."

>   }
>   
>   static bool verify_counter(pmu_counter_t *cnt)
Mi, Dapeng March 28, 2024, 10:12 a.m. UTC | #3
On 3/28/2024 9:23 AM, Yang, Weijiang wrote:
> On 1/3/2024 11:14 AM, Dapeng Mi wrote:
>> code style changes.
>>
>> Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
>> ---
>>   x86/pmu.c | 3 +--
>>   1 file changed, 1 insertion(+), 2 deletions(-)
>>
>> diff --git a/x86/pmu.c b/x86/pmu.c
>> index a2c64a1ce95b..46bed66c5c9f 100644
>> --- a/x86/pmu.c
>> +++ b/x86/pmu.c
>> @@ -207,8 +207,7 @@ static noinline void __measure(pmu_counter_t 
>> *evt, uint64_t count)
>>   static bool verify_event(uint64_t count, struct pmu_event *e)
>>   {
>>       // printf("%d <= %ld <= %d\n", e->min, count, e->max);
>> -    return count >= e->min  && count <= e->max;
>> -
>> +    return count >= e->min && count <= e->max;
>
> I don't think it's necessary to fix the nit in a separate patch, just 
> squash it in some patch with
> "Opportunistically ...."

Not sure this, I was always required to use a separate patch to refactor 
the code style faults by reviewers. It looks a unwritten rule for Linux.


>
>>   }
>>     static bool verify_counter(pmu_counter_t *cnt)
>
diff mbox series

Patch

diff --git a/x86/pmu.c b/x86/pmu.c
index a2c64a1ce95b..46bed66c5c9f 100644
--- a/x86/pmu.c
+++ b/x86/pmu.c
@@ -207,8 +207,7 @@  static noinline void __measure(pmu_counter_t *evt, uint64_t count)
 static bool verify_event(uint64_t count, struct pmu_event *e)
 {
 	// printf("%d <= %ld <= %d\n", e->min, count, e->max);
-	return count >= e->min  && count <= e->max;
-
+	return count >= e->min && count <= e->max;
 }
 
 static bool verify_counter(pmu_counter_t *cnt)