Skip to content

Commit

Permalink
[MTD] devices: Clean up trailing white spaces
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Thomas Gleixner authored and Thomas Gleixner committed Nov 7, 2005
1 parent 69f34c9 commit e5580fb
Show file tree
Hide file tree
Showing 12 changed files with 156 additions and 156 deletions.
8 changes: 4 additions & 4 deletions drivers/mtd/devices/Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# drivers/mtd/maps/Kconfig
# $Id: Kconfig,v 1.15 2004/12/22 17:51:15 joern Exp $
# $Id: Kconfig,v 1.18 2005/11/07 11:14:24 gleixner Exp $

menu "Self-contained MTD device drivers"
depends on MTD!=n
Expand Down Expand Up @@ -110,7 +110,7 @@ config MTDRAM_ABS_POS
If you have system RAM accessible by the CPU but not used by Linux
in normal operation, you can give the physical address at which the
available RAM starts, and the MTDRAM driver will use it instead of
allocating space from Linux's available memory. Otherwise, leave
allocating space from Linux's available memory. Otherwise, leave
this set to zero. Most people will want to leave this as zero.

config MTD_BLKMTD
Expand Down Expand Up @@ -165,7 +165,7 @@ config MTD_DOC2001
select MTD_DOCPROBE
select MTD_NAND_IDS
---help---
This provides an alternative MTD device driver for the M-Systems
This provides an alternative MTD device driver for the M-Systems
DiskOnChip Millennium devices. Use this if you have problems with
the combined DiskOnChip 2000 and Millennium driver above. To get
the DiskOnChip probe code to load and use this driver instead of
Expand All @@ -192,7 +192,7 @@ config MTD_DOC2001PLUS

If you use this device, you probably also want to enable the INFTL
'Inverse NAND Flash Translation Layer' option below, which is used
to emulate a block device by using a kind of file system on the
to emulate a block device by using a kind of file system on the
flash chips.

NOTE: This driver will soon be replaced by the new DiskOnChip driver
Expand Down
10 changes: 5 additions & 5 deletions drivers/mtd/devices/blkmtd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: blkmtd.c,v 1.24 2004/11/16 18:29:01 dwmw2 Exp $
* $Id: blkmtd.c,v 1.27 2005/11/07 11:14:24 gleixner Exp $
*
* blkmtd.c - use a block device as a fake MTD
*
Expand Down Expand Up @@ -39,7 +39,7 @@

/* Default erase size in K, always make it a multiple of PAGE_SIZE */
#define CONFIG_MTD_BLKDEV_ERASESIZE (128 << 10) /* 128KiB */
#define VERSION "$Revision: 1.24 $"
#define VERSION "$Revision: 1.27 $"

/* Info for the block device */
struct blkmtd_dev {
Expand Down Expand Up @@ -117,7 +117,7 @@ static int bi_write_complete(struct bio *bio, unsigned int bytes_done, int error
unlock_page(page);
page_cache_release(page);
} while (bvec >= bio->bi_io_vec);

complete((struct completion*)bio->bi_private);
return 0;
}
Expand All @@ -135,7 +135,7 @@ static int blkmtd_readpage(struct blkmtd_dev *dev, struct page *page)
unlock_page(page);
return 0;
}

ClearPageUptodate(page);
ClearPageError(page);

Expand Down Expand Up @@ -710,7 +710,7 @@ static struct blkmtd_dev *add_device(char *devname, int readonly, int erase_size
dev->mtd_info.erasesize >> 10,
readonly ? "(read-only)" : "");
}

return dev;

devinit_err:
Expand Down
8 changes: 4 additions & 4 deletions drivers/mtd/devices/block2mtd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: block2mtd.c,v 1.28 2005/03/19 22:40:44 gleixner Exp $
* $Id: block2mtd.c,v 1.29 2005/11/07 11:14:24 gleixner Exp $
*
* block2mtd.c - create an mtd from a block device
*
Expand All @@ -19,7 +19,7 @@
#include <linux/mtd/mtd.h>
#include <linux/buffer_head.h>

#define VERSION "$Revision: 1.28 $"
#define VERSION "$Revision: 1.29 $"


#define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)
Expand Down Expand Up @@ -111,7 +111,7 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len)
return PTR_ERR(page);

max = (u_long*)page_address(page) + PAGE_SIZE;
for (p=(u_long*)page_address(page); p<max; p++)
for (p=(u_long*)page_address(page); p<max; p++)
if (*p != -1UL) {
lock_page(page);
memset(page_address(page), 0xff, PAGE_SIZE);
Expand Down Expand Up @@ -206,7 +206,7 @@ static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf,
if (retlen)
*retlen = 0;
while (len) {
if ((offset+len) > PAGE_SIZE)
if ((offset+len) > PAGE_SIZE)
cpylen = PAGE_SIZE - offset; // multiple pages
else
cpylen = len; // this page
Expand Down
42 changes: 21 additions & 21 deletions drivers/mtd/devices/doc2000.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
*
* $Id: doc2000.c,v 1.66 2005/01/05 18:05:12 dwmw2 Exp $
* $Id: doc2000.c,v 1.67 2005/11/07 11:14:24 gleixner Exp $
*/

#include <linux/kernel.h>
Expand Down Expand Up @@ -58,7 +58,7 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
size_t *retlen, u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
size_t *retlen, const u_char *buf, u_char *eccbuf, struct nand_oobinfo *oobsel);
static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
unsigned long count, loff_t to, size_t *retlen,
u_char *eccbuf, struct nand_oobinfo *oobsel);
static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
Expand All @@ -76,14 +76,14 @@ static void DoC_Delay(struct DiskOnChip *doc, unsigned short cycles)
{
volatile char dummy;
int i;

for (i = 0; i < cycles; i++) {
if (DoC_is_Millennium(doc))
dummy = ReadDOC(doc->virtadr, NOP);
else
dummy = ReadDOC(doc->virtadr, DOCStatus);
}

}

/* DOC_WaitReady: Wait for RDY line to be asserted by the flash chip */
Expand Down Expand Up @@ -220,8 +220,8 @@ static int DoC_Address(struct DiskOnChip *doc, int numbytes, unsigned long ofs,
WriteDOC(ofs & 0xff, docptr, WritePipeTerm);

DoC_Delay(doc, 2); /* Needed for some slow flash chips. mf. */
/* FIXME: The SlowIO's for millennium could be replaced by

/* FIXME: The SlowIO's for millennium could be replaced by
a single WritePipeTerm here. mf. */

/* Lower the ALE line */
Expand Down Expand Up @@ -377,9 +377,9 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
if (mfr == 0xff || mfr == 0)
return 0;

/* Check it's the same as the first chip we identified.
/* Check it's the same as the first chip we identified.
* M-Systems say that any given DiskOnChip device should only
* contain _one_ type of flash part, although that's not a
* contain _one_ type of flash part, although that's not a
* hardware restriction. */
if (doc->mfr) {
if (doc->mfr == mfr && doc->id == id)
Expand All @@ -397,15 +397,15 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
for (j = 0; nand_manuf_ids[j].id != 0x0; j++) {
if (nand_manuf_ids[j].id == mfr)
break;
}
}
printk(KERN_INFO
"Flash chip found: Manufacturer ID: %2.2X, "
"Chip ID: %2.2X (%s:%s)\n", mfr, id,
nand_manuf_ids[j].name, nand_flash_ids[i].name);
if (!doc->mfr) {
doc->mfr = mfr;
doc->id = id;
doc->chipshift =
doc->chipshift =
ffs((nand_flash_ids[i].chipsize << 20)) - 1;
doc->page256 = (nand_flash_ids[i].pagesize == 256) ? 1 : 0;
doc->pageadrlen = doc->chipshift > 25 ? 3 : 2;
Expand Down Expand Up @@ -467,7 +467,7 @@ static void DoC_ScanChips(struct DiskOnChip *this, int maxchips)

ret = 0;

/* Fill out the chip array with {floor, chipno} for each
/* Fill out the chip array with {floor, chipno} for each
* detected chip in the device. */
for (floor = 0; floor < MAX_FLOORS; floor++) {
for (chip = 0; chip < numchips[floor]; chip++) {
Expand Down Expand Up @@ -757,12 +757,12 @@ static int doc_read_ecc(struct mtd_info *mtd, loff_t from, size_t len,
(long)from, eccbuf[0], eccbuf[1], eccbuf[2],
eccbuf[3], eccbuf[4], eccbuf[5]);
#endif

/* disable the ECC engine */
WriteDOC(DOC_ECC_DIS, docptr , ECCConf);
}

/* according to 11.4.1, we need to wait for the busy line
/* according to 11.4.1, we need to wait for the busy line
* drop if we read to the end of the page. */
if(0 == ((from + len) & 0x1ff))
{
Expand Down Expand Up @@ -941,7 +941,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,

/* Let the caller know we completed it */
*retlen += len;

if (eccbuf) {
unsigned char x[8];
size_t dummy;
Expand All @@ -950,10 +950,10 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
/* Write the ECC data to flash */
for (di=0; di<6; di++)
x[di] = eccbuf[di];

x[6]=0x55;
x[7]=0x55;

ret = doc_write_oob_nolock(mtd, to, 8, &dummy, x);
if (ret) {
up(&this->lock);
Expand All @@ -970,7 +970,7 @@ static int doc_write_ecc(struct mtd_info *mtd, loff_t to, size_t len,
return 0;
}

static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
unsigned long count, loff_t to, size_t *retlen,
u_char *eccbuf, struct nand_oobinfo *oobsel)
{
Expand Down Expand Up @@ -1022,7 +1022,7 @@ static int doc_writev_ecc(struct mtd_info *mtd, const struct kvec *vecs,
break;

to += thislen;
}
}

up(&writev_buf_sem);
*retlen = totretlen;
Expand Down Expand Up @@ -1080,7 +1080,7 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
/* Reading the full OOB data drops us off of the end of the page,
* causing the flash device to go into busy mode, so we need
* to wait until ready 11.4.1 and Toshiba TC58256FT docs */

ret = DoC_WaitReady(this);

up(&this->lock);
Expand Down Expand Up @@ -1190,7 +1190,7 @@ static int doc_write_oob_nolock(struct mtd_info *mtd, loff_t ofs, size_t len,
return 0;

}

static int doc_write_oob(struct mtd_info *mtd, loff_t ofs, size_t len,
size_t * retlen, const u_char * buf)
{
Expand Down Expand Up @@ -1222,7 +1222,7 @@ static int doc_erase(struct mtd_info *mtd, struct erase_info *instr)
}

instr->state = MTD_ERASING;

/* FIXME: Do this in the background. Use timers or schedule_task() */
while(len) {
mychip = &this->chips[ofs >> this->chipshift];
Expand Down
24 changes: 12 additions & 12 deletions drivers/mtd/devices/doc2001.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* (c) 1999 Machine Vision Holdings, Inc.
* (c) 1999, 2000 David Woodhouse <dwmw2@infradead.org>
*
* $Id: doc2001.c,v 1.48 2005/01/05 18:05:12 dwmw2 Exp $
* $Id: doc2001.c,v 1.49 2005/11/07 11:14:24 gleixner Exp $
*/

#include <linux/kernel.h>
Expand Down Expand Up @@ -196,10 +196,10 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
DoC_Command(doc->virtadr, NAND_CMD_RESET, CDSN_CTRL_WP);
DoC_WaitReady(doc->virtadr);

/* Read the NAND chip ID: 1. Send ReadID command */
/* Read the NAND chip ID: 1. Send ReadID command */
DoC_Command(doc->virtadr, NAND_CMD_READID, CDSN_CTRL_WP);

/* Read the NAND chip ID: 2. Send address byte zero */
/* Read the NAND chip ID: 2. Send address byte zero */
DoC_Address(doc->virtadr, 1, 0x00, CDSN_CTRL_WP, 0x00);

/* Read the manufacturer and device id codes of the flash device through
Expand All @@ -223,7 +223,7 @@ static int DoC_IdentChip(struct DiskOnChip *doc, int floor, int chip)
for (j = 0; nand_manuf_ids[j].id != 0x0; j++) {
if (nand_manuf_ids[j].id == mfr)
break;
}
}
printk(KERN_INFO "Flash chip found: Manufacturer ID: %2.2X, "
"Chip ID: %2.2X (%s:%s)\n",
mfr, id, nand_manuf_ids[j].name, nand_flash_ids[i].name);
Expand Down Expand Up @@ -275,7 +275,7 @@ static void DoC_ScanChips(struct DiskOnChip *this)
return;
}

/* Fill out the chip array with {floor, chipno} for each
/* Fill out the chip array with {floor, chipno} for each
* detected chip in the device. */
for (floor = 0, ret = 0; floor < MAX_FLOORS_MIL; floor++) {
for (chip = 0 ; chip < numchips[floor] ; chip++) {
Expand Down Expand Up @@ -309,7 +309,7 @@ static int DoCMil_is_alias(struct DiskOnChip *doc1, struct DiskOnChip *doc2)
tmp2 = ReadDOC(doc2->virtadr, AliasResolution);
if (tmp1 != tmp2)
return 0;

WriteDOC((tmp1+1) % 0xff, doc1->virtadr, AliasResolution);
tmp2 = ReadDOC(doc2->virtadr, AliasResolution);
if (tmp2 == (tmp1+1) % 0xff)
Expand Down Expand Up @@ -425,7 +425,7 @@ static int doc_read_ecc (struct mtd_info *mtd, loff_t from, size_t len,
return -EINVAL;

/* Don't allow a single read to cross a 512-byte block boundary */
if (from + len > ((from | 0x1ff) + 1))
if (from + len > ((from | 0x1ff) + 1))
len = ((from | 0x1ff) + 1) - from;

/* Find the chip which is to be used and select it */
Expand Down Expand Up @@ -552,7 +552,7 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,

#if 0
/* Don't allow a single write to cross a 512-byte block boundary */
if (to + len > ( (to | 0x1ff) + 1))
if (to + len > ( (to | 0x1ff) + 1))
len = ((to | 0x1ff) + 1) - to;
#else
/* Don't allow writes which aren't exactly one block */
Expand Down Expand Up @@ -632,7 +632,7 @@ static int doc_write_ecc (struct mtd_info *mtd, loff_t to, size_t len,

/* write the block status BLOCK_USED (0x5555) at the end of ECC data
FIXME: this is only a hack for programming the IPL area for LinuxBIOS
and should be replace with proper codes in user space utilities */
and should be replace with proper codes in user space utilities */
WriteDOC(0x55, docptr, Mil_CDSN_IO);
WriteDOC(0x55, docptr, Mil_CDSN_IO + 1);

Expand Down Expand Up @@ -802,7 +802,7 @@ int doc_erase (struct mtd_info *mtd, struct erase_info *instr)
void __iomem *docptr = this->virtadr;
struct Nand *mychip = &this->chips[ofs >> this->chipshift];

if (len != mtd->erasesize)
if (len != mtd->erasesize)
printk(KERN_WARNING "Erase not right size (%x != %x)n",
len, mtd->erasesize);

Expand Down Expand Up @@ -870,9 +870,9 @@ static void __exit cleanup_doc2001(void)
while ((mtd=docmillist)) {
this = mtd->priv;
docmillist = this->nextdoc;

del_mtd_device(mtd);

iounmap(this->virtadr);
kfree(this->chips);
kfree(mtd);
Expand Down
Loading

0 comments on commit e5580fb

Please sign in to comment.