public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Wolfram Sang <w.sang@pengutronix.de>
Cc: Roland Kletzing <devzero@web.de>, linux-mtd@lists.infradead.org
Subject: Re: [PATCH 1/2] mtd: tests: don't use mtd0 as a default
Date: Tue, 25 Oct 2011 14:34:04 +0300	[thread overview]
Message-ID: <1319542522.1757.5.camel@golum> (raw)
In-Reply-To: <1319533791-32605-1-git-send-email-w.sang@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

On Tue, 2011-10-25 at 11:09 +0200, Wolfram Sang wrote:
> mtd tests may erase the mtd device, so force the user to specify which
> mtd device to test by using the module parameter. Disable the default
> (using mtd0) since this may destroy a vital part of the flash if the
> module is inserted accidently or carelessly.
> 
> Reported-by: Roland Kletzing <devzero@web.de>
> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
> ---
>  drivers/mtd/tests/mtd_oobtest.c     |    2 +-
>  drivers/mtd/tests/mtd_pagetest.c    |    2 +-
>  drivers/mtd/tests/mtd_readtest.c    |    2 +-
>  drivers/mtd/tests/mtd_speedtest.c   |    2 +-
>  drivers/mtd/tests/mtd_stresstest.c  |    2 +-
>  drivers/mtd/tests/mtd_subpagetest.c |    2 +-
>  drivers/mtd/tests/mtd_torturetest.c |    2 +-
>  7 files changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mtd/tests/mtd_oobtest.c b/drivers/mtd/tests/mtd_oobtest.c
> index dec92ae..ff77b8e 100644
> --- a/drivers/mtd/tests/mtd_oobtest.c
> +++ b/drivers/mtd/tests/mtd_oobtest.c
> @@ -30,7 +30,7 @@
>  
>  #define PRINT_PREF KERN_INFO "mtd_oobtest: "
>  
> -static int dev;
> +static int dev = -1;
>  module_param(dev, int, S_IRUGO);
>  MODULE_PARM_DESC(dev, "MTD device number to use");

How about adding something like:

if (dev == -1) {
	printk(KERN_WARN "Please, specify the test MTD device\n");
	printk(KERN_WARN "WARNING: this test destroys the test MTD device's data\n");
	return -1;
}

Of course for the readtest the warning should not be printed.

-- 
Best Regards,
Artem Bityutskiy

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2011-10-25 11:35 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-25  9:09 [PATCH 1/2] mtd: tests: don't use mtd0 as a default Wolfram Sang
2011-10-25  9:09 ` [PATCH 2/2] mtd: mark tests EXPERIMENTAL Wolfram Sang
2011-10-29 20:30   ` Artem Bityutskiy
2011-10-29 20:40     ` Wolfram Sang
2011-10-30 12:29       ` Artem Bityutskiy
2011-10-30 16:28         ` [PATCH V2 2/2] mtd: tests: annotate as DANGEROUS in Kconfig Wolfram Sang
2011-10-30 20:34           ` Artem Bityutskiy
2011-10-30 20:37             ` Wolfram Sang
2011-10-31 17:00               ` Brian Norris
2011-11-08 20:35                 ` Artem Bityutskiy
2011-10-25 11:34 ` Artem Bityutskiy [this message]
2011-10-29 20:25 ` [PATCH 1/2] mtd: tests: don't use mtd0 as a default Artem Bityutskiy
2011-10-29 20:28   ` Wolfram Sang
2011-10-29 20:35     ` Artem Bityutskiy
2011-10-29 20:56       ` [PATCH V2 " Wolfram Sang
2011-10-29 21:12         ` Artem Bityutskiy
2011-10-29 22:11           ` [PATCH V3 " Wolfram Sang
2011-10-30 12:32             ` Artem Bityutskiy
2011-10-30 12:24         ` [PATCH V2 " Artem Bityutskiy
2011-11-02 22:11   ` [PATCH " Roland Kletzing
2011-10-29 20:28 ` Artem Bityutskiy

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=1319542522.1757.5.camel@golum \
    --to=dedekind1@gmail.com \
    --cc=devzero@web.de \
    --cc=linux-mtd@lists.infradead.org \
    --cc=w.sang@pengutronix.de \
    /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