summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/usb/storage/usb.c27
1 files changed, 0 insertions, 27 deletions
diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
index b86e72a..29e3792 100644
--- a/drivers/usb/storage/usb.c
+++ b/drivers/usb/storage/usb.c
@@ -216,23 +216,6 @@ static int usb_stor_blk_io(int io_op, struct block_device *disk_dev,
struct device_d *dev = &us->pusb_dev->dev;
unsigned sectors_done;
- if (sector_count == 0)
- return 0;
-
- /* check for unsupported block size */
- if (pblk_dev->blk.blockbits != SECTOR_SHIFT) {
- dev_dbg(dev, "%s: unsupported block shift %d\n",
- __func__, pblk_dev->blk.blockbits);
- return -EINVAL;
- }
-
- /* check for invalid sector_start */
- if (sector_start >= pblk_dev->blk.num_blocks || sector_start > (ulong)-1) {
- dev_dbg(dev, "%s: start sector %d too large\n",
- __func__, sector_start);
- return -EINVAL;
- }
-
/* ensure unit ready */
dev_dbg(dev, "Testing for unit ready\n");
if (usb_stor_test_unit_ready(pblk_dev)) {
@@ -240,16 +223,6 @@ static int usb_stor_blk_io(int io_op, struct block_device *disk_dev,
return -EIO;
}
- /* possibly limit the amount of I/O data */
- if (sector_count > INT_MAX) {
- sector_count = INT_MAX;
- dev_dbg(dev, "Restricting I/O to %u blocks\n", sector_count);
- }
- if (sector_start + sector_count > pblk_dev->blk.num_blocks) {
- sector_count = pblk_dev->blk.num_blocks - sector_start;
- dev_dbg(dev, "Restricting I/O to %u blocks\n", sector_count);
- }
-
/* read / write the requested data */
dev_dbg(dev, "%s %u block(s), starting from %d\n",
(io_op == io_rd) ? "Read" : "Write",