This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / block / scsi_ioctl.c
index d4c5783..5fbbd30 100644 (file)
@@ -107,13 +107,12 @@ static int sg_emulated_host(request_queue_t *q, int __user *p)
 
 #define CMD_READ_SAFE  0x01
 #define CMD_WRITE_SAFE 0x02
-#define CMD_WARNED     0x04
 #define safe_for_read(cmd)     [cmd] = CMD_READ_SAFE
 #define safe_for_write(cmd)    [cmd] = CMD_WRITE_SAFE
 
 static int verify_command(struct file *file, unsigned char *cmd)
 {
-       static unsigned char cmd_type[256] = {
+       static const unsigned char cmd_type[256] = {
 
                /* Basic read-only commands */
                safe_for_read(TEST_UNIT_READY),
@@ -127,10 +126,10 @@ static int verify_command(struct file *file, unsigned char *cmd)
                safe_for_read(INQUIRY),
                safe_for_read(MODE_SENSE),
                safe_for_read(MODE_SENSE_10),
-               safe_for_read(LOG_SENSE),
                safe_for_read(START_STOP),
                safe_for_read(GPCMD_VERIFY_10),
                safe_for_read(VERIFY_16),
+               safe_for_read(READ_BUFFER),
 
                /* Audio CD commands */
                safe_for_read(GPCMD_PLAY_CD),
@@ -170,7 +169,6 @@ static int verify_command(struct file *file, unsigned char *cmd)
                safe_for_write(ERASE),
                safe_for_write(GPCMD_MODE_SELECT_10),
                safe_for_write(MODE_SELECT),
-               safe_for_write(LOG_SELECT),
                safe_for_write(GPCMD_BLANK),
                safe_for_write(GPCMD_CLOSE_TRACK),
                safe_for_write(GPCMD_FLUSH_CACHE),
@@ -199,11 +197,6 @@ static int verify_command(struct file *file, unsigned char *cmd)
                        return 0;
        }
 
-       if (!type) {
-               cmd_type[cmd[0]] = CMD_WARNED;
-               printk(KERN_WARNING "scsi: unknown opcode 0x%02x\n", cmd[0]);
-       }
-
        /* And root can do any command.. */
        if (capable(CAP_SYS_RAWIO))
                return 0;
@@ -339,8 +332,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
                         struct gendisk *bd_disk, Scsi_Ioctl_Command __user *sic)
 {
        struct request *rq;
-       unsigned int bytes, opcode, cmdlen, in_len, out_len;
-       int err;
+       int err, in_len, out_len, bytes, opcode, cmdlen;
        char *buffer = NULL, sense[SCSI_SENSE_BUFFERSIZE];
 
        /*
@@ -357,7 +349,7 @@ static int sg_scsi_ioctl(struct file *file, request_queue_t *q,
 
        bytes = max(in_len, out_len);
        if (bytes) {
-               buffer = kmalloc(bytes, q->bounce_gfp | GFP_USER| __GFP_NOWARN);
+               buffer = kmalloc(bytes, q->bounce_gfp | GFP_USER | __GFP_NOWARN);
                if (!buffer)
                        return -ENOMEM;