summaryrefslogtreecommitdiffstats
path: root/include/linux/cpufreq.h
diff options
context:
space:
mode:
authorviresh kumar <viresh.kumar@linaro.org>2012-10-23 01:23:43 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2012-11-15 00:33:06 +0100
commit4b972f0b04eaae645b22d99479b9aea43c3d64e7 (patch)
treeab9fd0b4ebe200738bb6836fa2e27c8db56352b2 /include/linux/cpufreq.h
parent8bf1ac723639c4260f76df0e45ee23aa35a23067 (diff)
downloadtalos-op-linux-4b972f0b04eaae645b22d99479b9aea43c3d64e7.tar.gz
talos-op-linux-4b972f0b04eaae645b22d99479b9aea43c3d64e7.zip
cpufreq / core: Fix printing of governor and driver name
Arrays for governer and driver name are of size CPUFREQ_NAME_LEN or 16. i.e. 15 bytes for name and 1 for trailing '\0'. When cpufreq driver print these names (for sysfs), it includes '\n' or ' ' in the fmt string and still passes length as CPUFREQ_NAME_LEN. If the driver or governor names are using all 15 fields allocated to them, then the trailing '\n' or ' ' will never be printed. And so commands like: root@linaro-developer# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver will print something like: cpufreq_foodrvroot@linaro-developer# Fix this by increasing print length by one character. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/cpufreq.h')
-rw-r--r--include/linux/cpufreq.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index b60f6ba01d0c..fc4b78510151 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -22,6 +22,8 @@
#include <asm/div64.h>
#define CPUFREQ_NAME_LEN 16
+/* Print length for names. Extra 1 space for accomodating '\n' in prints */
+#define CPUFREQ_NAME_PLEN (CPUFREQ_NAME_LEN + 1)
/*********************************************************************
OpenPOWER on IntegriCloud