diff options
author | Richard Genoud <richard.genoud@gmail.com> | 2012-08-17 10:35:19 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-09-04 02:39:01 -0400 |
commit | 5993f9b7380d77fd23f5402dcfb701aedb327ffe (patch) | |
tree | 875f00f889eb3fffac980916efe7cc895ee9be4e | |
parent | 95e6fb027e041641baed441fcbd27c2f082c760e (diff) |
UBI: introduce MTD_PARAM_MAX_COUNT
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
-rw-r--r-- | drivers/mtd/ubi/build.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index c17f8e03abc8..5877531f2268 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c | |||
@@ -46,6 +46,9 @@ | |||
46 | /* Maximum length of the 'mtd=' parameter */ | 46 | /* Maximum length of the 'mtd=' parameter */ |
47 | #define MTD_PARAM_LEN_MAX 64 | 47 | #define MTD_PARAM_LEN_MAX 64 |
48 | 48 | ||
49 | /* Maximum number of comma-separated items in the 'mtd=' parameter */ | ||
50 | #define MTD_PARAM_MAX_COUNT 2 | ||
51 | |||
49 | #ifdef CONFIG_MTD_UBI_MODULE | 52 | #ifdef CONFIG_MTD_UBI_MODULE |
50 | #define ubi_is_module() 1 | 53 | #define ubi_is_module() 1 |
51 | #else | 54 | #else |
@@ -1324,7 +1327,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) | |||
1324 | struct mtd_dev_param *p; | 1327 | struct mtd_dev_param *p; |
1325 | char buf[MTD_PARAM_LEN_MAX]; | 1328 | char buf[MTD_PARAM_LEN_MAX]; |
1326 | char *pbuf = &buf[0]; | 1329 | char *pbuf = &buf[0]; |
1327 | char *tokens[2] = {NULL, NULL}; | 1330 | char *tokens[MTD_PARAM_MAX_COUNT]; |
1328 | 1331 | ||
1329 | if (!val) | 1332 | if (!val) |
1330 | return -EINVAL; | 1333 | return -EINVAL; |
@@ -1354,7 +1357,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp) | |||
1354 | if (buf[len - 1] == '\n') | 1357 | if (buf[len - 1] == '\n') |
1355 | buf[len - 1] = '\0'; | 1358 | buf[len - 1] = '\0'; |
1356 | 1359 | ||
1357 | for (i = 0; i < 2; i++) | 1360 | for (i = 0; i < MTD_PARAM_MAX_COUNT; i++) |
1358 | tokens[i] = strsep(&pbuf, ","); | 1361 | tokens[i] = strsep(&pbuf, ","); |
1359 | 1362 | ||
1360 | if (pbuf) { | 1363 | if (pbuf) { |