Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 4519
b: refs/heads/master
c: cc71229
h: refs/heads/master
i:
  4517: 07e9c11
  4515: 8bebe57
  4511: 26bf128
v: v3
  • Loading branch information
Thomas Gleixner authored and Thomas Gleixner committed May 23, 2005
1 parent 77a8ffa commit d5e3dc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50da7f60960a2e39aa8784983c580a3ddfd9bd8d
refs/heads/master: cc71229ff345a32d1b3de370a257dac62986b187
17 changes: 8 additions & 9 deletions trunk/drivers/mtd/devices/block2mtd.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* $Id: block2mtd.c,v 1.25 2005/03/07 20:29:05 joern Exp $
* $Id: block2mtd.c,v 1.28 2005/03/19 22:40:44 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.24 $"
#define VERSION "$Revision: 1.28 $"


#define ERROR(fmt, args...) printk(KERN_ERR "block2mtd: " fmt "\n" , ## args)
Expand Down Expand Up @@ -88,7 +88,6 @@ void cache_readahead(struct address_space *mapping, int index)
static struct page* page_readahead(struct address_space *mapping, int index)
{
filler_t *filler = (filler_t*)mapping->a_ops->readpage;
//do_page_cache_readahead(mapping, index, XXX, 64);
cache_readahead(mapping, index);
return read_cache_page(mapping, index, filler, NULL);
}
Expand Down Expand Up @@ -369,16 +368,16 @@ static int ustrtoul(const char *cp, char **endp, unsigned int base)
}


static int parse_num32(u32 *num32, const char *token)
static int parse_num(size_t *num, const char *token)
{
char *endp;
unsigned long n;
size_t n;

n = ustrtoul(token, &endp, 0);
n = (size_t) ustrtoul(token, &endp, 0);
if (*endp)
return -EINVAL;

*num32 = n;
*num = n;
return 0;
}

Expand Down Expand Up @@ -421,7 +420,7 @@ static int block2mtd_setup(const char *val, struct kernel_param *kp)
char buf[80+12], *str=buf; /* 80 for device, 12 for erase size */
char *token[2];
char *name;
u32 erase_size = PAGE_SIZE;
size_t erase_size = PAGE_SIZE;
int i, ret;

if (strnlen(val, sizeof(buf)) >= sizeof(buf))
Expand All @@ -448,7 +447,7 @@ static int block2mtd_setup(const char *val, struct kernel_param *kp)
return 0;

if (token[1]) {
ret = parse_num32(&erase_size, token[1]);
ret = parse_num(&erase_size, token[1]);
if (ret)
parse_err("illegal erase size");
}
Expand Down

0 comments on commit d5e3dc4

Please sign in to comment.