diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-10-14 11:57:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2012-06-30 16:53:16 +0200 |
commit | e71c34366808bbe3ce0b166d8710749513af6d81 (patch) | |
tree | f31327dd33e5b8024bac037d50ad82fffb8f61d1 /fs/devfs-core.c | |
parent | 1a5503118a95a0080ed93b07a996282cc54ce595 (diff) | |
download | barebox-e71c34366808bbe3ce0b166d8710749513af6d81.tar.gz barebox-e71c34366808bbe3ce0b166d8710749513af6d81.tar.xz |
mtd: fix arguments to bad block ioctls
In the Kernel the mtd ioctls expect a pointer to the offset, whereas
barebox interprets the pointer itself as an offset. Since we want
to add 64bit support for file sizes a pointer may not be sufficient,
so align with the kernel and convert it to a pointer to the offset.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/devfs-core.c')
-rw-r--r-- | fs/devfs-core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/devfs-core.c b/fs/devfs-core.c index ff6a97627a..6a56d34f27 100644 --- a/fs/devfs-core.c +++ b/fs/devfs-core.c @@ -123,15 +123,15 @@ int cdev_flush(struct cdev *cdev) static int partition_ioctl(struct cdev *cdev, int request, void *buf) { int ret = 0; - size_t offset; + loff_t offset, *_buf = buf; struct mtd_info_user *user = buf; switch (request) { case MEMSETBADBLOCK: case MEMGETBADBLOCK: - offset = (off_t)buf; + offset = *_buf; offset += cdev->offset; - ret = cdev->ops->ioctl(cdev, request, (void *)offset); + ret = cdev->ops->ioctl(cdev, request, &offset); break; case MEMGETINFO: if (cdev->mtd) { |