All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] cpupower: Remove unneeded semicolon
@ 2020-04-28  9:43 Zou Wei
  2020-05-01 17:07 ` shuah
  0 siblings, 1 reply; 5+ messages in thread
From: Zou Wei @ 2020-04-28  9:43 UTC (permalink / raw)
  To: trenn, shuah; +Cc: linux-pm, linux-kernel, Zou Wei

Fixes coccicheck warnings:

tools/power/cpupower/utils/cpupower-info.c:65:2-3: Unneeded semicolon
tools/power/cpupower/utils/cpupower-set.c:75:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c:120:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:175:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:56:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:75:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c:82:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/nhm_idle.c:94:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/snb_idle.c:80:2-3: Unneeded semicolon

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zou Wei <zou_wei@huawei.com>
---
 tools/power/cpupower/utils/cpupower-info.c                | 2 +-
 tools/power/cpupower/utils/cpupower-set.c                 | 2 +-
 tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c | 2 +-
 tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c   | 6 +++---
 tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c    | 2 +-
 tools/power/cpupower/utils/idle_monitor/nhm_idle.c        | 2 +-
 tools/power/cpupower/utils/idle_monitor/snb_idle.c        | 2 +-
 7 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/tools/power/cpupower/utils/cpupower-info.c b/tools/power/cpupower/utils/cpupower-info.c
index d3755ea..0ba61a2 100644
--- a/tools/power/cpupower/utils/cpupower-info.c
+++ b/tools/power/cpupower/utils/cpupower-info.c
@@ -62,7 +62,7 @@ int cmd_info(int argc, char **argv)
 		default:
 			print_wrong_arg_exit();
 		}
-	};
+	}
 
 	if (!params.params)
 		params.params = 0x7;
diff --git a/tools/power/cpupower/utils/cpupower-set.c b/tools/power/cpupower/utils/cpupower-set.c
index 3cca6f7..052044d 100644
--- a/tools/power/cpupower/utils/cpupower-set.c
+++ b/tools/power/cpupower/utils/cpupower-set.c
@@ -72,7 +72,7 @@ int cmd_set(int argc, char **argv)
 		default:
 			print_wrong_arg_exit();
 		}
-	};
+	}
 
 	if (!params.params)
 		print_wrong_arg_exit();
diff --git a/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c b/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
index 20f4634..5edd35b 100644
--- a/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
+++ b/tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c
@@ -117,7 +117,7 @@ static int amd_fam14h_get_pci_info(struct cstate *state,
 		break;
 	default:
 		return -1;
-	};
+	}
 	return 0;
 }
 
diff --git a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
index a65f7d0..8b42c2f 100644
--- a/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
+++ b/tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c
@@ -53,7 +53,7 @@ static int cpuidle_start(void)
 			dprint("CPU %d - State: %d - Val: %llu\n",
 			       cpu, state, previous_count[cpu][state]);
 		}
-	};
+	}
 	return 0;
 }
 
@@ -72,7 +72,7 @@ static int cpuidle_stop(void)
 			dprint("CPU %d - State: %d - Val: %llu\n",
 			       cpu, state, previous_count[cpu][state]);
 		}
-	};
+	}
 	return 0;
 }
 
@@ -172,7 +172,7 @@ static struct cpuidle_monitor *cpuidle_register(void)
 		cpuidle_cstates[num].id = num;
 		cpuidle_cstates[num].get_count_percent =
 			cpuidle_get_count_percent;
-	};
+	}
 
 	/* Free this at program termination */
 	previous_count = malloc(sizeof(long long *) * cpu_count);
diff --git a/tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c b/tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c
index 97ad323..55e55b6 100644
--- a/tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c
+++ b/tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c
@@ -79,7 +79,7 @@ static int hsw_ext_get_count(enum intel_hsw_ext_id id, unsigned long long *val,
 		break;
 	default:
 		return -1;
-	};
+	}
 	if (read_msr(cpu, msr, val))
 		return -1;
 	return 0;
diff --git a/tools/power/cpupower/utils/idle_monitor/nhm_idle.c b/tools/power/cpupower/utils/idle_monitor/nhm_idle.c
index 1142711..16eaf00 100644
--- a/tools/power/cpupower/utils/idle_monitor/nhm_idle.c
+++ b/tools/power/cpupower/utils/idle_monitor/nhm_idle.c
@@ -91,7 +91,7 @@ static int nhm_get_count(enum intel_nhm_id id, unsigned long long *val,
 		break;
 	default:
 		return -1;
-	};
+	}
 	if (read_msr(cpu, msr, val))
 		return -1;
 
diff --git a/tools/power/cpupower/utils/idle_monitor/snb_idle.c b/tools/power/cpupower/utils/idle_monitor/snb_idle.c
index df8b223..811d63a 100644
--- a/tools/power/cpupower/utils/idle_monitor/snb_idle.c
+++ b/tools/power/cpupower/utils/idle_monitor/snb_idle.c
@@ -77,7 +77,7 @@ static int snb_get_count(enum intel_snb_id id, unsigned long long *val,
 		break;
 	default:
 		return -1;
-	};
+	}
 	if (read_msr(cpu, msr, val))
 		return -1;
 	return 0;
-- 
2.6.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] cpupower: Remove unneeded semicolon
  2020-04-28  9:43 [PATCH -next] cpupower: Remove unneeded semicolon Zou Wei
@ 2020-05-01 17:07 ` shuah
  2020-05-06  0:52   ` Samuel Zou
  0 siblings, 1 reply; 5+ messages in thread
From: shuah @ 2020-05-01 17:07 UTC (permalink / raw)
  To: Zou Wei, trenn; +Cc: linux-pm, linux-kernel, shuah

Hi Zou Wei,

On 4/28/20 3:43 AM, Zou Wei wrote:
> Fixes coccicheck warnings:

I am not finding these in my coccicheck run. Can you send me the options
you are using?

> 
> tools/power/cpupower/utils/cpupower-info.c:65:2-3: Unneeded semicolon
> tools/power/cpupower/utils/cpupower-set.c:75:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c:120:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:175:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:56:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:75:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c:82:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/nhm_idle.c:94:2-3: Unneeded semicolon
> tools/power/cpupower/utils/idle_monitor/snb_idle.c:80:2-3: Unneeded semicolon
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zou Wei <zou_wei@huawei.com>
> ---
>   tools/power/cpupower/utils/cpupower-info.c                | 2 +-
>   tools/power/cpupower/utils/cpupower-set.c                 | 2 +-
>   tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c | 2 +-
>   tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c   | 6 +++---
>   tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c    | 2 +-
>   tools/power/cpupower/utils/idle_monitor/nhm_idle.c        | 2 +-
>   tools/power/cpupower/utils/idle_monitor/snb_idle.c        | 2 +-
>   7 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/tools/power/cpupower/utils/cpupower-info.c b/tools/power/cpupower/utils/cpupower-info.c
> index d3755ea..0ba61a2 100644
> --- a/tools/power/cpupower/utils/cpupower-info.c
> +++ b/tools/power/cpupower/utils/cpupower-info.c
> @@ -62,7 +62,7 @@ int cmd_info(int argc, char **argv)
>   		default:
>   			print_wrong_arg_exit();
>   		}
> -	};
> +	}
>   

The patch itself is fine.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] cpupower: Remove unneeded semicolon
  2020-05-01 17:07 ` shuah
@ 2020-05-06  0:52   ` Samuel Zou
  2020-05-06 16:09     ` shuah
  0 siblings, 1 reply; 5+ messages in thread
From: Samuel Zou @ 2020-05-06  0:52 UTC (permalink / raw)
  To: shuah, trenn; +Cc: linux-pm, linux-kernel

Hi Shuah,

I run with the below command, and get the output report.

[local-host linux-next]# make coccicheck MODE=report 
M=tools/power/cpupower/utils

Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.

tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:175:2-3: 
Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:56:2-3: Unneeded 
semicolon
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:75:2-3: Unneeded 
semicolon
tools/power/cpupower/utils/idle_monitor/snb_idle.c:80:2-3: Unneeded 
semicolon
tools/power/cpupower/utils/cpupower-set.c:75:2-3: Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c:82:2-3: Unneeded 
semicolon
tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c:120:2-3: 
Unneeded semicolon
tools/power/cpupower/utils/idle_monitor/nhm_idle.c:94:2-3: Unneeded 
semicolon
tools/power/cpupower/utils/cpupower-info.c:65:2-3: Unneeded semicolon

On 2020/5/2 1:07, shuah wrote:
> Hi Zou Wei,
> 
> On 4/28/20 3:43 AM, Zou Wei wrote:
>> Fixes coccicheck warnings:
> 
> I am not finding these in my coccicheck run. Can you send me the options
> you are using?
> 
>>
>> tools/power/cpupower/utils/cpupower-info.c:65:2-3: Unneeded semicolon
>> tools/power/cpupower/utils/cpupower-set.c:75:2-3: Unneeded semicolon
>> tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c:120:2-3: 
>> Unneeded semicolon
>> tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:175:2-3: 
>> Unneeded semicolon
>> tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:56:2-3: 
>> Unneeded semicolon
>> tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c:75:2-3: 
>> Unneeded semicolon
>> tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c:82:2-3: 
>> Unneeded semicolon
>> tools/power/cpupower/utils/idle_monitor/nhm_idle.c:94:2-3: Unneeded 
>> semicolon
>> tools/power/cpupower/utils/idle_monitor/snb_idle.c:80:2-3: Unneeded 
>> semicolon
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Zou Wei <zou_wei@huawei.com>
>> ---
>>   tools/power/cpupower/utils/cpupower-info.c                | 2 +-
>>   tools/power/cpupower/utils/cpupower-set.c                 | 2 +-
>>   tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c | 2 +-
>>   tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c   | 6 +++---
>>   tools/power/cpupower/utils/idle_monitor/hsw_ext_idle.c    | 2 +-
>>   tools/power/cpupower/utils/idle_monitor/nhm_idle.c        | 2 +-
>>   tools/power/cpupower/utils/idle_monitor/snb_idle.c        | 2 +-
>>   7 files changed, 9 insertions(+), 9 deletions(-)
>>
>> diff --git a/tools/power/cpupower/utils/cpupower-info.c 
>> b/tools/power/cpupower/utils/cpupower-info.c
>> index d3755ea..0ba61a2 100644
>> --- a/tools/power/cpupower/utils/cpupower-info.c
>> +++ b/tools/power/cpupower/utils/cpupower-info.c
>> @@ -62,7 +62,7 @@ int cmd_info(int argc, char **argv)
>>           default:
>>               print_wrong_arg_exit();
>>           }
>> -    };
>> +    }
> 
> The patch itself is fine.
> 
> thanks,
> -- Shuah
> 
> .


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] cpupower: Remove unneeded semicolon
  2020-05-06  0:52   ` Samuel Zou
@ 2020-05-06 16:09     ` shuah
  2020-05-13  1:42       ` shuah
  0 siblings, 1 reply; 5+ messages in thread
From: shuah @ 2020-05-06 16:09 UTC (permalink / raw)
  To: Samuel Zou, trenn; +Cc: linux-pm, linux-kernel, shuah

On 5/5/20 6:52 PM, Samuel Zou wrote:
> Hi Shuah,
> 
> I run with the below command, and get the output report.
> 
> [local-host linux-next]# make coccicheck MODE=report 
> M=tools/power/cpupower/utils
> 

Yes this is the command I am using as well. I don't see the errors
you are seeing. What is the difference?

make coccicheck MODE=report M=tools/power/cpupower/utils

Please check for false positives in the output before submitting a patch.
When using "patch" mode, carefully review the patch before submitting it.

coccicheck failed
make: *** [Makefile:1781: coccicheck] Error 2

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH -next] cpupower: Remove unneeded semicolon
  2020-05-06 16:09     ` shuah
@ 2020-05-13  1:42       ` shuah
  0 siblings, 0 replies; 5+ messages in thread
From: shuah @ 2020-05-13  1:42 UTC (permalink / raw)
  To: Samuel Zou, trenn; +Cc: linux-pm, linux-kernel, shuah

On 5/6/20 10:09 AM, shuah wrote:
> On 5/5/20 6:52 PM, Samuel Zou wrote:
>> Hi Shuah,
>>
>> I run with the below command, and get the output report.
>>
>> [local-host linux-next]# make coccicheck MODE=report 
>> M=tools/power/cpupower/utils
>>
> 
> Yes this is the command I am using as well. I don't see the errors
> you are seeing. What is the difference?
> 

I figured out what's going on. The coccinelle package from the distro
was the problem. I ended up installing coccinelle_1.0.8.deb-2_amd64.deb
from https://packages.debian.org/sid/amd64/coccinelle/download

After fixing that problem, it all works now.

I see the same errors you are seeing.

thanks,
-- Shuah

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-05-13  1:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-28  9:43 [PATCH -next] cpupower: Remove unneeded semicolon Zou Wei
2020-05-01 17:07 ` shuah
2020-05-06  0:52   ` Samuel Zou
2020-05-06 16:09     ` shuah
2020-05-13  1:42       ` shuah

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.