Merge "msm: kgsl: don't use sscanf()"

This commit is contained in:
Linux Build Service Account
2014-03-01 23:17:51 -08:00
committed by Gerrit - the friendly Code Review server
2 changed files with 10 additions and 10 deletions
+2 -2
View File
@@ -139,12 +139,12 @@ kgsl_get_pagetable(unsigned long name)
static struct kgsl_pagetable *
_get_pt_from_kobj(struct kobject *kobj)
{
unsigned long ptname;
unsigned int ptname;
if (!kobj)
return NULL;
if (sscanf(kobj->name, "%ld", &ptname) != 1)
if (kstrtou32(kobj->name, 0, &ptname))
return NULL;
return kgsl_get_pagetable(ptname);
+8 -8
View File
@@ -1,4 +1,4 @@
/* Copyright (c) 2002,2007-2013, The Linux Foundation. All rights reserved.
/* Copyright (c) 2002,2007-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@@ -73,12 +73,12 @@ static struct kgsl_process_private *
_get_priv_from_kobj(struct kobject *kobj)
{
struct kgsl_process_private *private;
unsigned long name;
unsigned int name;
if (!kobj)
return NULL;
if (sscanf(kobj->name, "%ld", &name) != 1)
if (kstrtou32(kobj->name, 0, &name))
return NULL;
list_for_each_entry(private, &kgsl_driver.process_list, list) {
@@ -255,13 +255,13 @@ static int kgsl_drv_full_cache_threshold_store(struct device *dev,
const char *buf, size_t count)
{
int ret;
unsigned int thresh;
ret = sscanf(buf, "%d", &thresh);
if (ret != 1)
return count;
unsigned int thresh = 0;
ret = kgsl_sysfs_store(buf, &thresh);
if (ret)
return ret;
kgsl_driver.full_cache_threshold = thresh;
return count;
}