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 3/4] Remove unchecked flags
Date: Thu, 13 Apr 2006 18:54:34 +0200	[thread overview]
Message-ID: <20060413165434.GG30574@wohnheim.fh-wedel.de> (raw)
In-Reply-To: <20060413165153.GD30574@wohnheim.fh-wedel.de>

Several flags are set by some devices, but never checked.  Remove them.

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

 drivers/mtd/chips/map_ram.c |    2 +-
 drivers/mtd/devices/phram.c |    2 +-
 drivers/mtd/devices/slram.c |    3 +--
 include/mtd/mtd-abi.h       |   12 +++---------
 4 files changed, 6 insertions(+), 13 deletions(-)


--- mtd_type/include/mtd/mtd-abi.h~unchecked_flags	2006-04-13 18:30:42.000000000 +0200
+++ mtd_type/include/mtd/mtd-abi.h	2006-04-13 18:32:42.000000000 +0200
@@ -35,20 +35,14 @@ struct mtd_oob_buf {
 
 #define MTD_CLEAR_BITS		1       // Bits can be cleared (flash)
 #define MTD_SET_BITS		2       // Bits can be set
-#define MTD_ERASEABLE		4       // Has an erase function
-#define MTD_WRITEB_WRITEABLE	8       // Direct IO is possible
-#define MTD_VOLATILE		16      // Set for RAMs
-#define MTD_XIP			32	// eXecute-In-Place possible
-#define MTD_OOB			64	// Out-of-band data (NAND flash)
 #define MTD_ECC			128	// Device capable of automatic ECC
-#define MTD_NO_VIRTBLOCKS	256	// Virtual blocks not allowed
 #define MTD_PROGRAM_REGIONS	512	// Configurable Programming Regions
 
 // Some common devices / combinations of capabilities
 #define MTD_CAP_ROM		0
-#define MTD_CAP_RAM		(MTD_CLEAR_BITS|MTD_SET_BITS|MTD_WRITEB_WRITEABLE)
-#define MTD_CAP_NORFLASH        (MTD_CLEAR_BITS|MTD_ERASEABLE)
-#define MTD_CAP_NANDFLASH       (MTD_CLEAR_BITS|MTD_ERASEABLE|MTD_OOB)
+#define MTD_CAP_RAM		(MTD_CLEAR_BITS|MTD_SET_BITS)
+#define MTD_CAP_NORFLASH	(MTD_CLEAR_BITS)
+#define MTD_CAP_NANDFLASH	(MTD_CLEAR_BITS)
 #define MTD_WRITEABLE		(MTD_CLEAR_BITS|MTD_SET_BITS)
 
 
--- mtd_type/drivers/mtd/devices/phram.c~unchecked_flags	2006-04-13 18:30:42.000000000 +0200
+++ mtd_type/drivers/mtd/devices/phram.c	2006-04-13 18:31:00.000000000 +0200
@@ -142,7 +142,7 @@ static int register_device(char *name, u
 
 	new->mtd.name = name;
 	new->mtd.size = len;
-	new->mtd.flags = MTD_CAP_RAM | MTD_ERASEABLE | MTD_VOLATILE;
+	new->mtd.flags = MTD_CAP_RAM;
         new->mtd.erase = phram_erase;
 	new->mtd.point = phram_point;
 	new->mtd.unpoint = phram_unpoint;
--- mtd_type/drivers/mtd/chips/map_ram.c~unchecked_flags	2006-04-13 18:30:42.000000000 +0200
+++ mtd_type/drivers/mtd/chips/map_ram.c	2006-04-13 18:31:00.000000000 +0200
@@ -70,7 +70,7 @@ static struct mtd_info *map_ram_probe(st
 	mtd->read = mapram_read;
 	mtd->write = mapram_write;
 	mtd->sync = mapram_nop;
-	mtd->flags = MTD_CAP_RAM | MTD_VOLATILE;
+	mtd->flags = MTD_CAP_RAM;
 
 	mtd->erasesize = PAGE_SIZE;
  	while(mtd->size & (mtd->erasesize - 1))
--- mtd_type/drivers/mtd/devices/slram.c~unchecked_flags	2006-04-13 18:30:42.000000000 +0200
+++ mtd_type/drivers/mtd/devices/slram.c	2006-04-13 18:31:00.000000000 +0200
@@ -200,8 +200,7 @@ static int register_device(char *name, u
 
 	(*curmtd)->mtdinfo->name = name;
 	(*curmtd)->mtdinfo->size = length;
-	(*curmtd)->mtdinfo->flags = MTD_CLEAR_BITS | MTD_SET_BITS |
-					MTD_WRITEB_WRITEABLE | MTD_VOLATILE | MTD_CAP_RAM;
+	(*curmtd)->mtdinfo->flags = MTD_CAP_RAM;
         (*curmtd)->mtdinfo->erase = slram_erase;
 	(*curmtd)->mtdinfo->point = slram_point;
 	(*curmtd)->mtdinfo->unpoint = slram_unpoint;

  parent reply	other threads:[~2006-04-13 16:54 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 ` [PATCH 1/4] Simplify test for RAM devices Jörn Engel
2006-04-13 16:53 ` [PATCH 2/4] Make mtdblock_ro unconditionally readonly Jörn Engel
2006-04-13 16:54 ` Jörn Engel [this message]
2006-04-13 18:08   ` [PATCH 3/4] Remove unchecked flags 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=20060413165434.GG30574@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®