[Xfce4-commits] <xfce4-cpugraph-plugin:master> Remove dead code
Florian
noreply at xfce.org
Sat Apr 17 16:16:02 CEST 2010
Updating branch refs/heads/master
to b45e11e6009ac7f556e7c09f860b39fbb48ffa1e (commit)
from 89a7969ffe5690c57ff8fe1a3d6eac585b81b8b6 (commit)
commit b45e11e6009ac7f556e7c09f860b39fbb48ffa1e
Author: Florian Rivoal <frivoal at gmail.com>
Date: Sun Feb 7 17:35:11 2010 +0900
Remove dead code
The condition guarding this piece of code is never true, and the code
contained is bugy anyway. Simply remove it for now, and a write a
working replacement later.
This should solve part of bug 4984, as some of the warnings came from
the dead code.
panel-plugin/os.c | 44 --------------------------------------------
1 files changed, 0 insertions(+), 44 deletions(-)
diff --git a/panel-plugin/os.c b/panel-plugin/os.c
index 02bc26e..6d7b26d 100644
--- a/panel-plugin/os.c
+++ b/panel-plugin/os.c
@@ -87,7 +87,6 @@ CpuData *cpuData_read(){
}
cpudata[cpuNr].pUsed = used;
cpudata[cpuNr].pTotal = total;
- setFrequencyScaling(cpuNr);
cpuNr++;
}
while((cpuNr < nrCpus) && (strncmp(cpuStr, "cpu", 3) == 0));
@@ -97,49 +96,6 @@ CpuData *cpuData_read(){
return cpudata;
}
-/* read frequency value for the cpu N (cpuId) */
-void setFrequencyScaling(int cpuId){
- //fprintf(stderr,"set frequency scaling\n");
- char *fileName;
- if( -1 != cpudata[cpuId].scalMaxFreq){
- //fprintf(stderr,"read current frequence\n");
- FILE *fp;
- if( cpudata[cpuId].scalMaxFreq ){
- if(sscanf(fileName, "%s%i%s", SYS_DEVICE, cpuId, SCAL_CUR_FREQ)){
- fp = fopen(fileName, "r");
- if( NULL != fp ){
- fscanf(fp, "%d", &cpudata[cpuId].scalCurFreq);
- fclose(fp);
- }
- }
- } else {
- cpudata[cpuId].scalMaxFreq = -1;
- if(sscanf(fileName, "%s%i%s", SYS_DEVICE, cpuId, SCAL_MIN_FREQ)){
- FILE *fp;
- fp = fopen(fileName, "r");
- if( NULL != fp ){
- if (1 == fscanf(fp, "%d", &cpudata[cpuId].scalMinFreq) ){
- fclose(fp);
- free(fileName);
- if(sscanf(fileName, "%s%i%s", SYS_DEVICE, cpuId, SCAL_MAX_FREQ)){
- fp = fopen(fileName, "r");
- if( NULL != fp){
- fscanf(fp, "%d", &cpudata[cpuId].scalMaxFreq);
- if( cpudata[cpuId].scalMaxFreq < 1 ) cpudata[cpuId].scalMaxFreq = -1;
- fclose(fp);
- }
- }
- } else {
- fclose(fp);
- }
- }
- }
- }
- free(fileName);
- }
-}
-
-
#elif defined (__FreeBSD__)
void cpuData_init(){
int i, cpuNr = -1;
More information about the Xfce4-commits
mailing list