From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Joachim Wiberg <troglobit@gmail.com>
Cc: linux-mtd@lists.infradead.org, Joern Engel <joern@lazybastard.org>
Subject: Re: [PATCH 1/1] mtd: block2mtd: add support for an optional custom MTD label
Date: Fri, 8 Oct 2021 10:34:40 +0200 [thread overview]
Message-ID: <20211008103440.4bdb4c0e@xps13> (raw)
In-Reply-To: <87wnmnrkft.fsf@gmail.com>
Hi Joachim,
troglobit@gmail.com wrote on Fri, 08 Oct 2021 10:26:46 +0200:
> Hi Miquèl!
>
> On Fri, Oct 08, 2021 at 09:27, Miquel Raynal <miquel.raynal@bootlin.com> wrote:
> > troglobit@gmail.com wrote on Tue, 5 Oct 2021 10:03:59 +0200:
> >> [snip]
> >> @@ -304,7 +307,7 @@ static struct block2mtd_dev *add_device(char *devname, int erase_size,
> >>
> >> list_add(&dev->list, &blkmtd_device_list);
> >> pr_info("mtd%d: [%s] erase_size = %dKiB [%d]\n",
> >> - dev->mtd.index,
> >> + dev->mtd.index, label ? label :
> > Can you put this on the next line?
>
> Sure thing!
>
> >> @@ -381,8 +384,8 @@ static int block2mtd_setup2(const char *val)
> >> /* 80 for device, 12 for erase size, 80 for name, 8 for timeout */
> >> char buf[80 + 12 + 80 + 8];
> >> char *str = buf;
> >> - char *token[2];
> >> - char *name;
> >> + char *token[3];
> > This number deserves a define and should be used later on as well.
>
> OK, I'll see what I can do, it's for the positional module arguments,
> so a FOO_MAX_ARGS or sth, I guess ...
>
> >> @@ -395,7 +398,7 @@ static int block2mtd_setup2(const char *val)
> >> strcpy(str, val);
> >> kill_final_newline(str);
> >>
> >> - for (i = 0; i < 2; i++)
> >> + for (i = 0; i < 3; i++)
>
> used here as well ...
>
> >> token[i] = strsep(&str, ",");
>
> But what about each separate arg, is there any convention? I'll see
> what I can find in other modules.
>
> >> if (str) {
> >> @@ -414,7 +417,7 @@ static int block2mtd_setup2(const char *val)
> >> return 0;
> >> }
> >>
> >> - if (token[1]) {
> >> + if (token[1] && strlen(token[1])) {
> >
> > This change is not related to your commit I believe, please split if
> > my assumption is right.
>
> Well, it's a logical consequence of adding another module argument, but
> you're right, this could be hit before as well if someone added multiple
> commas without argument. (That breaks erase_size default value.)
In this case you can keep this change in the commit but you need to
explain it in the commit message.
> Maybe this and the defines fit in the same separate "cleanup" patch?
>
> >> - add_device(name, erase_size, timeout);
> >> + if (token[2]) {
> >> + label = token[2];
> >> + pr_info("Using custom MTD label '%s' for dev %s\n", label, name);
> > Not sure this qualifies as an info log message, perhaps a debug one
> > would be more appropriate?
>
> OK! (Just tried to follow the same log level used for erase_size.)
Ok then keep the driver consistent, it's not a bit deal and we can
lower the level later if it's too noisy.
> Thank you for the review, I'll post a v2 later today, or during the
> weekend :)
>
> Cheers
> /Joachim
>
Thanks,
Miquèl
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
prev parent reply other threads:[~2021-10-08 8:35 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-05 8:03 [PATCH 1/1] mtd: block2mtd: add support for an optional custom MTD label Joachim Wiberg
2021-10-08 7:27 ` Miquel Raynal
2021-10-08 8:26 ` Joachim Wiberg
2021-10-08 8:34 ` Miquel Raynal [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211008103440.4bdb4c0e@xps13 \
--to=miquel.raynal@bootlin.com \
--cc=joern@lazybastard.org \
--cc=linux-mtd@lists.infradead.org \
--cc=troglobit@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox