aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 040f751809ea..dee1c96288d4 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -38,6 +38,7 @@ static int sg_version_num = 30534; /* 2 digits for each component */
38#include <linux/errno.h> 38#include <linux/errno.h>
39#include <linux/mtio.h> 39#include <linux/mtio.h>
40#include <linux/ioctl.h> 40#include <linux/ioctl.h>
41#include <linux/slab.h>
41#include <linux/fcntl.h> 42#include <linux/fcntl.h>
42#include <linux/init.h> 43#include <linux/init.h>
43#include <linux/poll.h> 44#include <linux/poll.h>
@@ -287,8 +288,7 @@ sg_open(struct inode *inode, struct file *filp)
287 if (list_empty(&sdp->sfds)) { /* no existing opens on this device */ 288 if (list_empty(&sdp->sfds)) { /* no existing opens on this device */
288 sdp->sgdebug = 0; 289 sdp->sgdebug = 0;
289 q = sdp->device->request_queue; 290 q = sdp->device->request_queue;
290 sdp->sg_tablesize = min(queue_max_hw_segments(q), 291 sdp->sg_tablesize = queue_max_segments(q);
291 queue_max_phys_segments(q));
292 } 292 }
293 if ((sfp = sg_add_sfp(sdp, dev))) 293 if ((sfp = sg_add_sfp(sdp, dev)))
294 filp->private_data = sfp; 294 filp->private_data = sfp;
@@ -1376,8 +1376,7 @@ static Sg_device *sg_alloc(struct gendisk *disk, struct scsi_device *scsidp)
1376 sdp->device = scsidp; 1376 sdp->device = scsidp;
1377 INIT_LIST_HEAD(&sdp->sfds); 1377 INIT_LIST_HEAD(&sdp->sfds);
1378 init_waitqueue_head(&sdp->o_excl_wait); 1378 init_waitqueue_head(&sdp->o_excl_wait);
1379 sdp->sg_tablesize = min(queue_max_hw_segments(q), 1379 sdp->sg_tablesize = queue_max_segments(q);
1380 queue_max_phys_segments(q));
1381 sdp->index = k; 1380 sdp->index = k;
1382 kref_init(&sdp->d_ref); 1381 kref_init(&sdp->d_ref);
1383 1382