[PATCH v1 02/11] initramfs: replace simple_strtoul() with kstrtoul()

From: Mimi Zohar
Date: Tue Jan 20 2015 - 14:14:33 EST


Replace existing obsolete simple_strtoul() call with kstrtoul(),
before making other changes.

Signed-off-by: Mimi Zohar <zohar@xxxxxxxxxxxxxxxxxx>
---
init/initramfs.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/init/initramfs.c b/init/initramfs.c
index bb51b5b..5dd93ca 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -163,12 +163,15 @@ static void __init parse_header(char *s)
{
unsigned long parsed[12];
char buf[9];
+ int ret;
int i;

buf[8] = '\0';
for (i = 0, s += 6; i < 12; i++, s += 8) {
memcpy(buf, s, 8);
- parsed[i] = simple_strtoul(buf, NULL, 16);
+ ret = kstrtoul(buf, 16, &parsed[i]);
+ if (ret)
+ pr_err("invalid cpio header field (%d)", ret);
}
ino = parsed[0];
mode = parsed[1];
--
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/