mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
To: Andrew Morton <akpm@osdl.org>
Cc: David Woodhouse <dwmw2@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: [PATCH 1/4] Simplify test for RAM devices
Date: Thu, 13 Apr 2006 18:53:14 +0200	[thread overview]
Message-ID: <20060413165314.GE30574@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20060413165153.GD30574@wohnheim.fh-wedel.de>

mtdblock is the only user of aggregate capabilities in mtd.  This is clearly
bogus and should be changed.  In particular, it tries to determine whether
the device in question is a piece of RAM.  For every single driver that fits
the current criteria, an easier test would be to check for the type being
MTD_RAM.

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
---

 drivers/mtd/mtdblock.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)


--- mtd_type/drivers/mtd/mtdblock.c~mtdblock_ram_test	2006-04-13 18:03:41.000000000 +0200
+++ mtd_type/drivers/mtd/mtdblock.c	2006-04-13 18:19:19.000000000 +0200
@@ -288,8 +288,7 @@ static int mtdblock_open(struct mtd_blkt
 
 	mutex_init(&mtdblk->cache_mutex);
 	mtdblk->cache_state = STATE_EMPTY;
-	if ((mtdblk->mtd->flags & MTD_CAP_RAM) != MTD_CAP_RAM &&
-	    mtdblk->mtd->erasesize) {
+	if (mtdblk->mtd->type != MTD_RAM && mtdblk->mtd->erasesize) {
 		mtdblk->cache_size = mtdblk->mtd->erasesize;
 		mtdblk->cache_data = NULL;
 	}

  reply	other threads:[~2006-04-13 16:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-04-13 16:51 [PATCH 0/4] Cleanup of mtd->type and mtd->flags Jörn Engel
2006-04-13 16:53 ` Jörn Engel [this message]
2006-04-13 16:53 ` [PATCH 2/4] Make mtdblock_ro unconditionally readonly Jörn Engel
2006-04-13 16:54 ` [PATCH 3/4] Remove unchecked flags Jörn Engel
2006-04-13 18:08   ` Josh Boyer
2006-04-13 19:18     ` David Woodhouse
2006-04-13 21:50       ` Josh Boyer
2006-04-13 16:55 ` [PATCH 4/4] Remove unused types Jörn Engel

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=20060413165314.GE30574@wohnheim.fh-wedel.de \
    --to=joern@wohnheim.fh-wedel.de \
    --cc=akpm@osdl.org \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=tglx@linutronix.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

all inboxes | Powered by JetHome®