diff options
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/kernel/params.c b/kernel/params.c index e28c70628bb7..afc46a23eb6d 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -180,12 +180,12 @@ int parse_args(const char *name, | |||
180 | #define STANDARD_PARAM_DEF(name, type, format, tmptype, strtolfn) \ | 180 | #define STANDARD_PARAM_DEF(name, type, format, tmptype, strtolfn) \ |
181 | int param_set_##name(const char *val, struct kernel_param *kp) \ | 181 | int param_set_##name(const char *val, struct kernel_param *kp) \ |
182 | { \ | 182 | { \ |
183 | char *endp; \ | ||
184 | tmptype l; \ | 183 | tmptype l; \ |
184 | int ret; \ | ||
185 | \ | 185 | \ |
186 | if (!val) return -EINVAL; \ | 186 | if (!val) return -EINVAL; \ |
187 | l = strtolfn(val, &endp, 0); \ | 187 | ret = strtolfn(val, 0, &l); \ |
188 | if (endp == val || ((type)l != l)) \ | 188 | if (ret == -EINVAL || ((type)l != l)) \ |
189 | return -EINVAL; \ | 189 | return -EINVAL; \ |
190 | *((type *)kp->arg) = l; \ | 190 | *((type *)kp->arg) = l; \ |
191 | return 0; \ | 191 | return 0; \ |
@@ -195,13 +195,13 @@ int parse_args(const char *name, | |||
195 | return sprintf(buffer, format, *((type *)kp->arg)); \ | 195 | return sprintf(buffer, format, *((type *)kp->arg)); \ |
196 | } | 196 | } |
197 | 197 | ||
198 | STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, simple_strtoul); | 198 | STANDARD_PARAM_DEF(byte, unsigned char, "%c", unsigned long, strict_strtoul); |
199 | STANDARD_PARAM_DEF(short, short, "%hi", long, simple_strtol); | 199 | STANDARD_PARAM_DEF(short, short, "%hi", long, strict_strtol); |
200 | STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, simple_strtoul); | 200 | STANDARD_PARAM_DEF(ushort, unsigned short, "%hu", unsigned long, strict_strtoul); |
201 | STANDARD_PARAM_DEF(int, int, "%i", long, simple_strtol); | 201 | STANDARD_PARAM_DEF(int, int, "%i", long, strict_strtol); |
202 | STANDARD_PARAM_DEF(uint, unsigned int, "%u", unsigned long, simple_strtoul); | 202 | STANDARD_PARAM_DEF(uint, unsigned int, "%u", unsigned long, strict_strtoul); |
203 | STANDARD_PARAM_DEF(long, long, "%li", long, simple_strtol); | 203 | STANDARD_PARAM_DEF(long, long, "%li", long, strict_strtol); |
204 | STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, simple_strtoul); | 204 | STANDARD_PARAM_DEF(ulong, unsigned long, "%lu", unsigned long, strict_strtoul); |
205 | 205 | ||
206 | int param_set_charp(const char *val, struct kernel_param *kp) | 206 | int param_set_charp(const char *val, struct kernel_param *kp) |
207 | { | 207 | { |