video: tegra: host: fix integer overflows
[linux-2.6.git] / drivers / block / sunvdc.c
index f59887c..48e8fee 100644 (file)
@@ -103,7 +103,7 @@ static int vdc_getgeo(struct block_device *bdev, struct hd_geometry *geo)
        return 0;
 }
 
-static struct block_device_operations vdc_fops = {
+static const struct block_device_operations vdc_fops = {
        .owner          = THIS_MODULE,
        .getgeo         = vdc_getgeo,
 };
@@ -416,7 +416,7 @@ static int __send_request(struct request *req)
                desc->slice = 0;
        }
        desc->status = ~0;
-       desc->offset = (req->sector << 9) / port->vdisk_block_size;
+       desc->offset = (blk_rq_pos(req) << 9) / port->vdisk_block_size;
        desc->size = len;
        desc->ncookies = err;
 
@@ -441,12 +441,11 @@ out:
 static void do_vdc_request(struct request_queue *q)
 {
        while (1) {
-               struct request *req = elv_next_request(q);
+               struct request *req = blk_fetch_request(q);
 
                if (!req)
                        break;
 
-               blkdev_dequeue_request(req);
                if (__send_request(req) < 0)
                        __blk_end_request_all(req, -EIO);
        }
@@ -692,9 +691,8 @@ static int probe_disk(struct vdc_port *port)
 
        port->disk = g;
 
-       blk_queue_max_hw_segments(q, port->ring_cookies);
-       blk_queue_max_phys_segments(q, port->ring_cookies);
-       blk_queue_max_sectors(q, port->max_xfer_size);
+       blk_queue_max_segments(q, port->ring_cookies);
+       blk_queue_max_hw_sectors(q, port->max_xfer_size);
        g->major = vdc_major;
        g->first_minor = port->vio.vdev->dev_no << PARTITION_SHIFT;
        strcpy(g->disk_name, port->disk_name);