mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 21:57:43 +00:00
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>
This commit is contained in:
parent
95e6fb027e
commit
5993f9b738
1 changed files with 5 additions and 2 deletions
|
@ -46,6 +46,9 @@
|
||||||
/* Maximum length of the 'mtd=' parameter */
|
/* Maximum length of the 'mtd=' parameter */
|
||||||
#define MTD_PARAM_LEN_MAX 64
|
#define MTD_PARAM_LEN_MAX 64
|
||||||
|
|
||||||
|
/* Maximum number of comma-separated items in the 'mtd=' parameter */
|
||||||
|
#define MTD_PARAM_MAX_COUNT 2
|
||||||
|
|
||||||
#ifdef CONFIG_MTD_UBI_MODULE
|
#ifdef CONFIG_MTD_UBI_MODULE
|
||||||
#define ubi_is_module() 1
|
#define ubi_is_module() 1
|
||||||
#else
|
#else
|
||||||
|
@ -1324,7 +1327,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
|
||||||
struct mtd_dev_param *p;
|
struct mtd_dev_param *p;
|
||||||
char buf[MTD_PARAM_LEN_MAX];
|
char buf[MTD_PARAM_LEN_MAX];
|
||||||
char *pbuf = &buf[0];
|
char *pbuf = &buf[0];
|
||||||
char *tokens[2] = {NULL, NULL};
|
char *tokens[MTD_PARAM_MAX_COUNT];
|
||||||
|
|
||||||
if (!val)
|
if (!val)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
@ -1354,7 +1357,7 @@ static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
|
||||||
if (buf[len - 1] == '\n')
|
if (buf[len - 1] == '\n')
|
||||||
buf[len - 1] = '\0';
|
buf[len - 1] = '\0';
|
||||||
|
|
||||||
for (i = 0; i < 2; i++)
|
for (i = 0; i < MTD_PARAM_MAX_COUNT; i++)
|
||||||
tokens[i] = strsep(&pbuf, ",");
|
tokens[i] = strsep(&pbuf, ",");
|
||||||
|
|
||||||
if (pbuf) {
|
if (pbuf) {
|
||||||
|
|
Loading…
Reference in a new issue