Fix some warnings in xsys

- Remove unused code
- Fix leak
This commit is contained in:
TingPing
2014-12-11 09:57:11 -05:00
parent 74ff67acd3
commit 72f82d096c
6 changed files with 7 additions and 123 deletions

View File

@ -32,7 +32,6 @@
#include "pci.h"
#include "match.h"
#include "hwmon.h"
#include "xsys.h"
#include "parse.h"
@ -47,7 +46,8 @@ int xs_parse_cpu(char *model, char *vendor, double *freq, char *cache, unsigned
FILE *fp = fopen("/proc/cpuinfo", "r");
if(fp == NULL)
return 1;
if(count != NULL) *count = 0;
*count = 0;
strcpy(cache,"unknown\0");
#if defined(__i386__) || defined(__x86_64__)
@ -435,28 +435,3 @@ int xs_parse_distro(char *name)
strcpy(name, buffer);
return 0;
}
int xs_parse_hwmon_chip(char *chip)
{
if (!hwmon_chip_present())
return 1;
#if 0
else
get_hwmon_chip_name(chip);
#endif
return 0;
}
int xs_parse_hwmon_temp(char *temp, unsigned int *sensor)
{
unsigned int value;
float celsius;
if (!hwmon_chip_present())
return 1;
else
get_hwmon_temp(&value, sensor);
celsius = (float)value;
snprintf(temp, bsize, "%.1fC", celsius/1000.0);
return 0;
}