]> git.karo-electronics.de Git - karo-tx-linux.git/commit
cpufreq / core: Fix printing of governor and driver name
authorviresh kumar <viresh.kumar@linaro.org>
Mon, 22 Oct 2012 23:23:43 +0000 (01:23 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 22 Oct 2012 23:23:43 +0000 (01:23 +0200)
commitef6b13d4dab05791de8440bb66e7d37a11605ffe
tree90a17d4e72917df331e89d0ea7878ecdea3322ce
parente414a2cdd7642650d22450f7dd93ccbbb10b9921
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>
drivers/cpufreq/cpufreq.c
include/linux/cpufreq.h