mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
samples: configfs: replace simple_strtoul() with kstrtoint()
simple_strtoul() is deprecated. Use kstrtoint(). Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
committed by
Christoph Hellwig
parent
1b0d36e81b
commit
b86ff67d5a
@@ -13,6 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <linux/configfs.h>
|
#include <linux/configfs.h>
|
||||||
@@ -61,17 +62,11 @@ static ssize_t childless_storeme_store(struct config_item *item,
|
|||||||
const char *page, size_t count)
|
const char *page, size_t count)
|
||||||
{
|
{
|
||||||
struct childless *childless = to_childless(item);
|
struct childless *childless = to_childless(item);
|
||||||
unsigned long tmp;
|
int ret;
|
||||||
char *p = (char *) page;
|
|
||||||
|
|
||||||
tmp = simple_strtoul(p, &p, 10);
|
ret = kstrtoint(page, 10, &childless->storeme);
|
||||||
if (!p || (*p && (*p != '\n')))
|
if (ret)
|
||||||
return -EINVAL;
|
return ret;
|
||||||
|
|
||||||
if (tmp > INT_MAX)
|
|
||||||
return -ERANGE;
|
|
||||||
|
|
||||||
childless->storeme = tmp;
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
@@ -144,17 +139,11 @@ static ssize_t simple_child_storeme_store(struct config_item *item,
|
|||||||
const char *page, size_t count)
|
const char *page, size_t count)
|
||||||
{
|
{
|
||||||
struct simple_child *simple_child = to_simple_child(item);
|
struct simple_child *simple_child = to_simple_child(item);
|
||||||
unsigned long tmp;
|
int ret;
|
||||||
char *p = (char *) page;
|
|
||||||
|
|
||||||
tmp = simple_strtoul(p, &p, 10);
|
ret = kstrtoint(page, 10, &simple_child->storeme);
|
||||||
if (!p || (*p && (*p != '\n')))
|
if (ret)
|
||||||
return -EINVAL;
|
return ret;
|
||||||
|
|
||||||
if (tmp > INT_MAX)
|
|
||||||
return -ERANGE;
|
|
||||||
|
|
||||||
simple_child->storeme = tmp;
|
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user