From 71c7488ae10003c7d2f28fb68bd1188b1a426793 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Tue, 10 Apr 2018 11:57:37 +0200 Subject: power: fix sysfs_read/sysfs_write usage * The incoming path to sysfs_read/sysfs_write should be const, as in open(2) call. * Redefine scaling_gov_path as const pointer array. * Since sysfs_read works on a simple absolute path anyway, make sure the scaling_gov_path paths *are* absolute. Otherwise the code only works if Power HAL has / as CWD, which is a bit fragile. Change-Id: I70c08f8137842569514bcb3f6e0617d46044e6ab Signed-off-by: Corinna Vinschen --- power-8916.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'power-8916.c') diff --git a/power-8916.c b/power-8916.c index 3774418..4bf8c0c 100644 --- a/power-8916.c +++ b/power-8916.c @@ -51,10 +51,10 @@ #define MIN_FREQ_CPU0_DISP_OFF 400000 #define MIN_FREQ_CPU0_DISP_ON 960000 -char scaling_min_freq[4][80] = {"sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", - "sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq", - "sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq", - "sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq"}; +const char* scaling_min_freq[4] = {"/sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq", + "/sys/devices/system/cpu/cpu1/cpufreq/scaling_min_freq", + "/sys/devices/system/cpu/cpu2/cpufreq/scaling_min_freq", + "/sys/devices/system/cpu/cpu3/cpufreq/scaling_min_freq"}; static int slack_node_rw_failed = 0; -- cgit v1.2.3