Patchwork [3/8] UBI: introduce MTD_PARAM_MAX_COUNT

login
register
mail settings
Submitter Richard Genoud
Date Aug. 17, 2012, 2:35 p.m.
Message ID <1345214124-5478-4-git-send-email-richard.genoud@gmail.com>
Download mbox | patch
Permalink /patch/178226/
State New
Headers show

Comments

Richard Genoud - Aug. 17, 2012, 2:35 p.m.
Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
---
 drivers/mtd/ubi/build.c |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)
Artem Bityutskiy - Aug. 19, 2012, 7:32 p.m.
On Fri, 2012-08-17 at 16:35 +0200, Richard Genoud wrote:
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
> ---
>  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 82d11e1..1f45f51 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -46,6 +46,9 @@
>  /* Maximum length of the 'mtd=' parameter */
>  #define MTD_PARAM_LEN_MAX 64
>  
> +/* Maximum number of comma-separated items in ht 'mtd=' parameter */
> +#define MTD_PARAM_MAX_COUNT 2

Fixed the spelling of "the" and pushed to l2-mtd.git, thanks!
Artem Bityutskiy - Aug. 19, 2012, 7:32 p.m.
On Fri, 2012-08-17 at 16:35 +0200, Richard Genoud wrote:
> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
> ---
>  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 82d11e1..1f45f51 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -46,6 +46,9 @@
>  /* Maximum length of the 'mtd=' parameter */
>  #define MTD_PARAM_LEN_MAX 64
>  
> +/* Maximum number of comma-separated items in ht 'mtd=' parameter */
> +#define MTD_PARAM_MAX_COUNT 2

Fixed the spelling of "the" and pushed to linux-ubi.git, thanks!
Richard Genoud - Aug. 21, 2012, 8:08 a.m.
2012/8/19 Artem Bityutskiy <dedekind1@gmail.com>:
> On Fri, 2012-08-17 at 16:35 +0200, Richard Genoud wrote:
>> Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
>> ---
>>  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 82d11e1..1f45f51 100644
>> --- a/drivers/mtd/ubi/build.c
>> +++ b/drivers/mtd/ubi/build.c
>> @@ -46,6 +46,9 @@
>>  /* Maximum length of the 'mtd=' parameter */
>>  #define MTD_PARAM_LEN_MAX 64
>>
>> +/* Maximum number of comma-separated items in ht 'mtd=' parameter */
>> +#define MTD_PARAM_MAX_COUNT 2
>
> Fixed the spelling of "the" and pushed to linux-ubi.git, thanks!
>
> --
> Best Regards,
> Artem Bityutskiy
Hi Artem,

It seems that this patch has been dropped on linux-ubi/master. Is it a
git-reset accident or my patches didn't apply cleanly on it ?
Anyway, if you want me to re-send it rebased on top of
linux-ubi/master, just ask (I guess there will be a little conflit on
the #define)

Best Regards,
Richard.
Artem Bityutskiy - Aug. 21, 2012, 11:29 a.m.
On Tue, 2012-08-21 at 10:08 +0200, Richard Genoud wrote:
> Hi Artem,
> 
> It seems that this patch has been dropped on linux-ubi/master. Is it a
> git-reset accident or my patches didn't apply cleanly on it ?
> Anyway, if you want me to re-send it rebased on top of
> linux-ubi/master, just ask (I guess there will be a little conflit on
> the #define)

My mistake, dropped it accidentally - worked late. Sorry, just put it
back.

Patch

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 82d11e1..1f45f51 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -46,6 +46,9 @@ 
 /* Maximum length of the 'mtd=' parameter */
 #define MTD_PARAM_LEN_MAX 64
 
+/* Maximum number of comma-separated items in ht 'mtd=' parameter */
+#define MTD_PARAM_MAX_COUNT 2
+
 #ifdef CONFIG_MTD_UBI_MODULE
 #define ubi_is_module() 1
 #else
@@ -1327,7 +1330,7 @@  static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
 	struct mtd_dev_param *p;
 	char buf[MTD_PARAM_LEN_MAX];
 	char *pbuf = &buf[0];
-	char *tokens[2] = {NULL, NULL};
+	char *tokens[MTD_PARAM_MAX_COUNT];
 
 	if (!val)
 		return -EINVAL;
@@ -1357,7 +1360,7 @@  static int __init ubi_mtd_param_parse(const char *val, struct kernel_param *kp)
 	if (buf[len - 1] == '\n')
 		buf[len - 1] = '\0';
 
-	for (i = 0; i < 2; i++)
+	for (i = 0; i < MTD_PARAM_MAX_COUNT; i++)
 		tokens[i] = strsep(&pbuf, ",");
 
 	if (pbuf) {