1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-25 01:44:39 +02:00

Prevent the mtd subsystem from generating linking failures against 64-bits divisions

Signed-off-by: Florian Fainelli <florian@openwrt.org>
This commit is contained in:
Florian Fainelli 2009-07-10 16:19:50 +02:00 committed by Xiangfu Liu
parent b581a580c0
commit 8fd96343b6
2 changed files with 0 additions and 358 deletions

View File

@ -11588,17 +11588,6 @@
+ +
+ +
+#endif /* __JZ_MMC_H__ */ +#endif /* __JZ_MMC_H__ */
--- linux-2.6.24.7.old/drivers/mtd/mtd_blkdevs.c 2008-05-07 01:22:34.000000000 +0200
+++ linux-2.6.24.7/drivers/mtd/mtd_blkdevs.c 2009-04-12 18:13:57.000000000 +0200
@@ -278,7 +278,7 @@
/* 2.5 has capacity in units of 512 bytes while still
having BLOCK_SIZE_BITS set to 10. Just to keep us amused. */
- set_capacity(gd, (new->size * tr->blksize) >> 9);
+ set_capacity(gd, ((u_int64_t)new->size * tr->blksize) >> 9);
gd->private_data = new;
new->blkcore_priv = gd;
--- linux-2.6.24.7.old/drivers/mtd/mtdblock-jz.uu 1970-01-01 01:00:00.000000000 +0100 --- linux-2.6.24.7.old/drivers/mtd/mtdblock-jz.uu 1970-01-01 01:00:00.000000000 +0100
+++ linux-2.6.24.7/drivers/mtd/mtdblock-jz.uu 2009-04-12 18:13:57.000000000 +0200 +++ linux-2.6.24.7/drivers/mtd/mtdblock-jz.uu 2009-04-12 18:13:57.000000000 +0200
@@ -0,0 +1,535 @@ @@ -0,0 +1,535 @@
@ -12322,200 +12311,6 @@
return ret; return ret;
} /* memory_ioctl */ } /* memory_ioctl */
--- linux-2.6.24.7.old/drivers/mtd/mtdcore.c 2008-05-07 01:22:34.000000000 +0200
+++ linux-2.6.24.7/drivers/mtd/mtdcore.c 2009-04-12 18:13:57.000000000 +0200
@@ -303,10 +303,10 @@
*/
int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
- unsigned long count, loff_t to, size_t *retlen)
+ unsigned long count, loff_mtd_t to, size_mtd_t *retlen)
{
unsigned long i;
- size_t totlen = 0, thislen;
+ size_mtd_t totlen = 0, thislen;
int ret = 0;
if(!mtd->write) {
@@ -350,7 +350,7 @@
if (!this)
return 0;
- return sprintf(buf, "mtd%d: %8.8x %8.8x \"%s\"\n", i, this->size,
+ return sprintf(buf, "mtd%d: %09llx %8.8x \"%s\"\n", i, this->size,
this->erasesize, this->name);
}
--- linux-2.6.24.7.old/drivers/mtd/mtdpart.c 2009-04-12 18:05:07.000000000 +0200
+++ linux-2.6.24.7/drivers/mtd/mtdpart.c 2009-04-12 18:38:31.000000000 +0200
@@ -30,7 +30,7 @@
struct mtd_part {
struct mtd_info mtd;
struct mtd_info *master;
- u_int32_t offset;
+ u_int64_t offset;
int index;
struct list_head list;
int registered;
@@ -48,8 +48,8 @@
* to the _real_ device.
*/
-static int part_read(struct mtd_info *mtd, loff_t from, size_t len,
- size_t *retlen, u_char *buf)
+static int part_read(struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len,
+ size_mtd_t *retlen, u_char *buf)
{
struct mtd_part *part = PART(mtd);
int res;
@@ -69,8 +69,8 @@
return res;
}
-static int part_point(struct mtd_info *mtd, loff_t from, size_t len,
- size_t *retlen, void **virt, resource_size_t *phys)
+static int part_point(struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len,
+ size_mtd_t *retlen, void **virt, resource_size_t *phys)
{
struct mtd_part *part = PART(mtd);
if (from >= mtd->size)
@@ -81,14 +81,14 @@
len, retlen, virt, phys);
}
-static void part_unpoint(struct mtd_info *mtd, loff_t from, size_t len)
+static void part_unpoint(struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len)
{
struct mtd_part *part = PART(mtd);
part->master->unpoint(part->master, from + part->offset, len);
}
-static int part_read_oob(struct mtd_info *mtd, loff_t from,
+static int part_read_oob(struct mtd_info *mtd, loff_mtd_t from,
struct mtd_oob_ops *ops)
{
struct mtd_part *part = PART(mtd);
@@ -109,8 +109,8 @@
return res;
}
-static int part_read_user_prot_reg(struct mtd_info *mtd, loff_t from,
- size_t len, size_t *retlen, u_char *buf)
+static int part_read_user_prot_reg(struct mtd_info *mtd, loff_mtd_t from,
+ size_mtd_t len, size_mtd_t *retlen, u_char *buf)
{
struct mtd_part *part = PART(mtd);
return part->master->write_oob(part->master, to + part->offset, ops);
@@ -118,14 +118,14 @@
}
static int part_get_user_prot_info(struct mtd_info *mtd,
- struct otp_info *buf, size_t len)
+ struct otp_info *buf, size_mtd_t len)
{
struct mtd_part *part = PART(mtd);
return part->master->get_user_prot_info(part->master, buf, len);
}
-static int part_read_fact_prot_reg(struct mtd_info *mtd, loff_t from,
- size_t len, size_t *retlen, u_char *buf)
+static int part_read_fact_prot_reg(struct mtd_info *mtd, loff_mtd_t from,
+ size_mtd_t len, size_mtd_t *retlen, u_char *buf)
{
struct mtd_part *part = PART(mtd);
return part->master->read_fact_prot_reg(part->master, from,
@@ -133,14 +133,14 @@
}
static int part_get_fact_prot_info(struct mtd_info *mtd, struct otp_info *buf,
- size_t len)
+ size_mtd_t len)
{
struct mtd_part *part = PART(mtd);
return part->master->get_fact_prot_info(part->master, buf, len);
}
-static int part_write(struct mtd_info *mtd, loff_t to, size_t len,
- size_t *retlen, const u_char *buf)
+static int part_write(struct mtd_info *mtd, loff_mtd_t to, size_mtd_t len,
+ size_mtd_t *retlen, const u_char *buf)
{
struct mtd_part *part = PART(mtd);
if (!(mtd->flags & MTD_WRITEABLE))
@@ -153,7 +153,7 @@
len, retlen, buf);
}
-static int part_write_oob(struct mtd_info *mtd, loff_t to,
+static int part_write_oob(struct mtd_info *mtd, loff_mtd_t to,
struct mtd_oob_ops *ops)
{
struct mtd_part *part = PART(mtd);
@@ -168,22 +168,22 @@
return part->master->write_oob(part->master, to + part->offset, ops);
}
-static int part_write_user_prot_reg(struct mtd_info *mtd, loff_t from,
- size_t len, size_t *retlen, u_char *buf)
+static int part_write_user_prot_reg(struct mtd_info *mtd, loff_mtd_t from,
+ size_mtd_t len, size_mtd_t *retlen, u_char *buf)
{
struct mtd_part *part = PART(mtd);
return part->master->write_user_prot_reg(part->master, from,
len, retlen, buf);
}
-static int part_lock_user_prot_reg(struct mtd_info *mtd, loff_t from,
- size_t len)
+static int part_lock_user_prot_reg(struct mtd_info *mtd, loff_mtd_t from,
+ size_mtd_t len)
{
struct mtd_part *part = PART(mtd);
return part->master->lock_user_prot_reg(part->master, from, len);
}
static int part_writev(struct mtd_info *mtd, const struct kvec *vecs,
- unsigned long count, loff_t to, size_t *retlen)
+ unsigned long count, loff_mtd_t to, size_mtd_t *retlen)
{
struct mtd_part *part = PART(mtd);
@@ -224,7 +224,7 @@
}
EXPORT_SYMBOL_GPL(mtd_erase_callback);
-static int part_lock(struct mtd_info *mtd, loff_t ofs, size_t len)
+static int part_lock(struct mtd_info *mtd, loff_mtd_t ofs, size_mtd_t len)
{
struct mtd_part *part = PART(mtd);
if ((len + ofs) > mtd->size)
@@ -232,7 +232,7 @@
return part->master->lock(part->master, ofs + part->offset, len);
}
-static int part_unlock(struct mtd_info *mtd, loff_t ofs, size_t len)
+static int part_unlock(struct mtd_info *mtd, loff_mtd_t ofs, size_mtd_t len)
{
struct mtd_part *part = PART(mtd);
if ((len + ofs) > mtd->size)
@@ -258,7 +258,7 @@
part->master->resume(part->master);
}
-static int part_block_isbad(struct mtd_info *mtd, loff_t ofs)
+static int part_block_isbad(struct mtd_info *mtd, loff_mtd_t ofs)
{
struct mtd_part *part = PART(mtd);
if (ofs >= mtd->size)
@@ -267,7 +267,7 @@
return part->master->block_isbad(part->master, ofs);
}
-static int part_block_markbad(struct mtd_info *mtd, loff_t ofs)
+static int part_block_markbad(struct mtd_info *mtd, loff_mtd_t ofs)
{
struct mtd_part *part = PART(mtd);
int res;
--- linux-2.6.24.7.old/drivers/mtd/nand/Kconfig 2008-05-07 01:22:34.000000000 +0200 --- linux-2.6.24.7.old/drivers/mtd/nand/Kconfig 2008-05-07 01:22:34.000000000 +0200
+++ linux-2.6.24.7/drivers/mtd/nand/Kconfig 2009-04-12 18:13:57.000000000 +0200 +++ linux-2.6.24.7/drivers/mtd/nand/Kconfig 2009-04-12 18:13:57.000000000 +0200
@@ -306,4 +306,127 @@ @@ -306,4 +306,127 @@

View File

@ -27441,145 +27441,6 @@
unsigned char timing; /* timing specification used */ unsigned char timing; /* timing specification used */
--- linux-2.6.24.7.old/include/linux/mtd/mtd.h 2009-04-12 18:05:07.000000000 +0200
+++ linux-2.6.24.7/include/linux/mtd/mtd.h 2009-04-12 18:13:57.000000000 +0200
@@ -32,9 +32,9 @@
specific to any particular block. */
struct erase_info {
struct mtd_info *mtd;
- u_int32_t addr;
- u_int32_t len;
- u_int32_t fail_addr;
+ u_int64_t addr;
+ u_int64_t len;
+ u_int64_t fail_addr;
u_long time;
u_long retries;
u_int dev;
@@ -46,7 +46,7 @@
};
struct mtd_erase_region_info {
- u_int32_t offset; /* At which this region starts, from the beginning of the MTD */
+ u_int64_t offset; /* At which this region starts, from the beginning of the MTD */
u_int32_t erasesize; /* For this region */
u_int32_t numblocks; /* Number of blocks of erasesize in this region */
unsigned long *lockmap; /* If keeping bitmap of locks */
@@ -89,10 +89,10 @@
*/
struct mtd_oob_ops {
mtd_oob_mode_t mode;
- size_t len;
- size_t retlen;
- size_t ooblen;
- size_t oobretlen;
+ size_mtd_t len;
+ size_mtd_t retlen;
+ size_mtd_t ooblen;
+ size_mtd_t oobretlen;
uint32_t ooboffs;
uint8_t *datbuf;
uint8_t *oobbuf;
@@ -102,7 +102,7 @@
struct mtd_info {
u_char type;
u_int32_t flags;
- u_int32_t size; // Total size of the MTD
+ u_int64_t size; // Total size of the MTD
/* "Major" erase size for the device. Naïve users may take this
* to be the only erase size available, or may use the more detailed
@@ -145,15 +145,15 @@
/* This stuff for eXecute-In-Place */
/* phys is optional and may be set to NULL */
- int (*point) (struct mtd_info *mtd, loff_t from, size_t len,
- size_t *retlen, void **virt, resource_size_t *phys);
+ int (*point) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len,
+ size_mtd_t *retlen, void **virt, resource_size_t *phys);
/* We probably shouldn't allow XIP if the unpoint isn't a NULL */
- void (*unpoint) (struct mtd_info *mtd, loff_t from, size_t len);
+ void (*unpoint) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len);
- int (*read) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
- int (*write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
+ int (*read) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len, size_mtd_t *retlen, u_char *buf);
+ int (*write) (struct mtd_info *mtd, loff_mtd_t to, size_mtd_t len, size_mtd_t *retlen, const u_char *buf);
/* In blackbox flight recorder like scenarios we want to make successful
writes in interrupt context. panic_write() is only intended to be
@@ -164,9 +164,9 @@
int (*panic_write) (struct mtd_info *mtd, loff_t to, size_t len, size_t *retlen, const u_char *buf);
- int (*read_oob) (struct mtd_info *mtd, loff_t from,
+ int (*read_oob) (struct mtd_info *mtd, loff_mtd_t from,
struct mtd_oob_ops *ops);
- int (*write_oob) (struct mtd_info *mtd, loff_t to,
+ int (*write_oob) (struct mtd_info *mtd, loff_mtd_t to,
struct mtd_oob_ops *ops);
/*
@@ -163,33 +163,33 @@
* flash devices. The user data is one time programmable but the
* factory data is read only.
*/
- int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
- int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
- int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_t len);
- int (*read_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
- int (*write_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len, size_t *retlen, u_char *buf);
- int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_t from, size_t len);
+ int (*get_fact_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_mtd_t len);
+ int (*read_fact_prot_reg) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len, size_mtd_t *retlen, u_char *buf);
+ int (*get_user_prot_info) (struct mtd_info *mtd, struct otp_info *buf, size_mtd_t len);
+ int (*read_user_prot_reg) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len, size_mtd_t *retlen, u_char *buf);
+ int (*write_user_prot_reg) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len, size_mtd_t *retlen, u_char *buf);
+ int (*lock_user_prot_reg) (struct mtd_info *mtd, loff_mtd_t from, size_mtd_t len);
/* kvec-based read/write methods.
NB: The 'count' parameter is the number of _vectors_, each of
which contains an (ofs, len) tuple.
*/
- int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_t to, size_t *retlen);
+ int (*writev) (struct mtd_info *mtd, const struct kvec *vecs, unsigned long count, loff_mtd_t to, size_mtd_t *retlen);
/* Sync */
void (*sync) (struct mtd_info *mtd);
/* Chip-supported device locking */
- int (*lock) (struct mtd_info *mtd, loff_t ofs, size_t len);
- int (*unlock) (struct mtd_info *mtd, loff_t ofs, size_t len);
+ int (*lock) (struct mtd_info *mtd, loff_mtd_t ofs, size_mtd_t len);
+ int (*unlock) (struct mtd_info *mtd, loff_mtd_t ofs, size_mtd_t len);
/* Power Management functions */
int (*suspend) (struct mtd_info *mtd);
void (*resume) (struct mtd_info *mtd);
/* Bad block management functions */
- int (*block_isbad) (struct mtd_info *mtd, loff_t ofs);
- int (*block_markbad) (struct mtd_info *mtd, loff_t ofs);
+ int (*block_isbad) (struct mtd_info *mtd, loff_mtd_t ofs);
+ int (*block_markbad) (struct mtd_info *mtd, loff_mtd_t ofs);
struct notifier_block reboot_notifier; /* default mode before reboot */
@@ -237,10 +237,10 @@
extern int unregister_mtd_user (struct mtd_notifier *old);
int default_mtd_writev(struct mtd_info *mtd, const struct kvec *vecs,
- unsigned long count, loff_t to, size_t *retlen);
+ unsigned long count, loff_mtd_t to, size_mtd_t *retlen);
int default_mtd_readv(struct mtd_info *mtd, struct kvec *vecs,
- unsigned long count, loff_t from, size_t *retlen);
+ unsigned long count, loff_mtd_t from, size_mtd_t *retlen);
#ifdef CONFIG_MTD_PARTITIONS
void mtd_erase_callback(struct erase_info *instr);
--- linux-2.6.24.7.old/include/linux/mtd/nand.h 2009-04-12 18:05:07.000000000 +0200 --- linux-2.6.24.7.old/include/linux/mtd/nand.h 2009-04-12 18:05:07.000000000 +0200
+++ linux-2.6.24.7/include/linux/mtd/nand.h 2009-04-12 18:13:57.000000000 +0200 +++ linux-2.6.24.7/include/linux/mtd/nand.h 2009-04-12 18:13:57.000000000 +0200
@@ -39,14 +39,14 @@ @@ -39,14 +39,14 @@
@ -27665,20 +27526,6 @@
/* /*
* Constants for oob configuration * Constants for oob configuration
--- linux-2.6.24.7.old/include/linux/mtd/partitions.h 2009-04-12 18:05:07.000000000 +0200
+++ linux-2.6.24.7/include/linux/mtd/partitions.h 2009-04-12 18:13:57.000000000 +0200
@@ -39,8 +39,9 @@
struct mtd_partition;
struct mtd_partition {
char *name; /* identifier string */
- u_int32_t size; /* partition size */
- u_int32_t offset; /* offset within the master MTD space */
+ u_int64_t size; /* partition size */
+ u_int64_t offset; /* offset within the master MTD space */
+ char use_planes; /* flag to specify whether multiple planes of NAND is used in the partition */
u_int32_t mask_flags; /* master MTD flags to mask out for this partition */
struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/
struct mtd_info **mtdp; /* pointer to store the MTD object */
--- linux-2.6.24.7.old/include/linux/vt.h 2008-05-07 01:22:34.000000000 +0200 --- linux-2.6.24.7.old/include/linux/vt.h 2008-05-07 01:22:34.000000000 +0200
+++ linux-2.6.24.7/include/linux/vt.h 2009-04-12 18:13:57.000000000 +0200 +++ linux-2.6.24.7/include/linux/vt.h 2009-04-12 18:13:57.000000000 +0200
@@ -18,10 +18,16 @@ @@ -18,10 +18,16 @@