All of lore.kernel.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
To: Yang Ruirui <ruirui.r.yang@tieto.com>
Cc: linux-mtd@lists.infradead.org, ext-phil.2.carmody@nokia.com,
	dwmw2@infradead.org, ruirui.r.yang@tietoenator.com,
	ext-jani.1.nikula@nokia.com
Subject: Re: [PATCH 02/02] force module loaded with partitions set
Date: Mon, 14 Mar 2011 10:43:15 +0200	[thread overview]
Message-ID: <1300092195.2727.4.camel@localhost> (raw)
In-Reply-To: <20110314015148.GA6827@darkstar>

On Mon, 2011-03-14 at 09:51 +0800, Yang Ruirui wrote:
> From: Yang Ruirui<ruirui.r.yang@tieto.com>
> 
> partitions can not be set after module loaded, the moduel param mode is 0444.
> 
> this patch force module loaded with param partitions set, if user does not
> set partitions then give out a warning and return -EINVAL
> 
> Signed-off-by: Yang Ruirui<ruirui.r.yang@tieto.com>
> Tested-by: Shao Yanqing<yanqing.shao@tieto.com>
> Tested-by: Xiao Yang<yang.xiao@tieto.com>
> ---
>  drivers/mtd/mtdswap.c |    6 ++++++
>  1 file changed, 6 insertions(+)
> 
> --- mtd-2.6-fc2ff59.orig/drivers/mtd/mtdswap.c	2011-03-14 09:36:09.283329099 +0800
> +++ mtd-2.6-fc2ff59/drivers/mtd/mtdswap.c	2011-03-14 09:46:30.229993534 +0800
> @@ -1569,6 +1569,12 @@ static struct mtd_blktrans_ops mtdswap_o
>  
>  static int __init mtdswap_modinit(void)
>  {
> +	if (!partitions[0]) {
> +		printk(KERN_WARNING
> +			"Please load mtdswap with correct partitions param\n");
> +		return -EINVAL;
> +	}

I think a similar check is done in mtdswap_add_mtd() ?


-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2011-03-14  8:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-14  1:51 [PATCH 02/02] force module loaded with partitions set Yang Ruirui
2011-03-14  8:43 ` Artem Bityutskiy [this message]
2011-03-14  8:57   ` Yang Rui Rui
2011-03-14  8:53     ` Artem Bityutskiy
2011-03-14  9:12       ` Yang Rui Rui
2011-03-14  9:33         ` Artem Bityutskiy
2011-03-17  8:50           ` Yang Rui Rui
2011-03-17  8:51             ` Artem Bityutskiy
2011-03-17  9:24               ` Yang Rui Rui

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=1300092195.2727.4.camel@localhost \
    --to=artem.bityutskiy@nokia.com \
    --cc=dwmw2@infradead.org \
    --cc=ext-jani.1.nikula@nokia.com \
    --cc=ext-phil.2.carmody@nokia.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=ruirui.r.yang@tieto.com \
    --cc=ruirui.r.yang@tietoenator.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.