lkml.org 
[lkml]   [2012]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] x86: kernel/cpu/perf_event.c simple_strtoul cleanup
    From
    Date
    Change set_attr_rdpmc() to call kstrtoul() instead of calling obsoleted
    simple_strtoul().

    Signed-off-by: Shuah Khan <shuahkhan@gmail.com>
    ---
    arch/x86/kernel/cpu/perf_event.c | 7 ++++++-
    1 file changed, 6 insertions(+), 1 deletion(-)

    diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
    index e049d6d..2e51c82f 100644
    --- a/arch/x86/kernel/cpu/perf_event.c
    +++ b/arch/x86/kernel/cpu/perf_event.c
    @@ -1648,7 +1648,12 @@ static ssize_t set_attr_rdpmc(struct device *cdev,
    struct device_attribute *attr,
    const char *buf, size_t count)
    {
    - unsigned long val = simple_strtoul(buf, NULL, 0);
    + unsigned long val;
    + ssize_t ret;
    +
    + ret = kstrtoul(buf, 0, &val);
    + if (ret)
    + return ret;

    if (!!val != !!x86_pmu.attr_rdpmc) {
    x86_pmu.attr_rdpmc = !!val;
    --
    1.7.9.5




    \
     
     \ /
      Last update: 2012-06-11 05:41    [W:0.022 / U:31.328 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site