diff --git a/src/cpu/intel_cpus.cpp b/src/cpu/intel_cpus.cpp
index 370b762..8af033b 100644
--- a/src/cpu/intel_cpus.cpp
+++ b/src/cpu/intel_cpus.cpp
@@ -155,8 +155,10 @@ void intel_util::byt_has_ahci()
if (!dir)
byt_ahci_support=0;
else
+ {
byt_ahci_support=1;
- closedir(dir);
+ closedir(dir);
+ }
}
int intel_util::get_byt_ahci_support()
diff --git a/src/devices/devfreq.cpp b/src/devices/devfreq.cpp
index c958865..0509d0f 100644
--- a/src/devices/devfreq.cpp
+++ b/src/devices/devfreq.cpp
@@ -229,7 +229,6 @@ static void devfreq_dev_callback(const char *d_name)
void create_all_devfreq_devices(void)
{
- struct dirent *entry;
int num = 0;
std::string p = "/sys/class/devfreq/";
@@ -240,7 +239,7 @@ void create_all_devfreq_devices(void)
return;
}
- while((entry = readdir(dir)) != NULL)
+ while(readdir(dir) != NULL)
num++;
if (num == 2) {