提交 a5cb67f7 编写于 作者: G Geert Uytterhoeven 提交者: James Bottomley

[SCSI] sun3_NCR5380: Split NEXT() for lvalues/rvalues

Using the current NEXT() macro for both lvalues and rvalues gives:

In file included from drivers/scsi/sun3_scsi.c:623:
drivers/scsi/sun3_NCR5380.c: In function ‘NCR5380_queue_command_lck’:
drivers/scsi/sun3_NCR5380.c:993: warning: assignment discards qualifiers from pointer target type
drivers/scsi/sun3_NCR5380.c: In function ‘NCR5380_main’:
drivers/scsi/sun3_NCR5380.c:1147: warning: assignment discards qualifiers from pointer target type
drivers/scsi/sun3_NCR5380.c: In function ‘NCR5380_information_transfer’:
drivers/scsi/sun3_NCR5380.c:2277: warning: assignment discards qualifiers from pointer target type
drivers/scsi/sun3_NCR5380.c:2333: warning: assignment discards qualifiers from pointer target type

Change NEXT() to operate on rvalues only(), and introduce SET_NEXT() to
operate on lvalues, as is done in drivers/scsi/atari_NCR5380.c.
Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 9958d6f9
......@@ -266,7 +266,8 @@ static struct scsi_host_template *the_template = NULL;
(struct NCR5380_hostdata *)(in)->hostdata
#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
#define NEXT(cmd) (*(struct scsi_cmnd **)&((cmd)->host_scribble))
#define NEXT(cmd) ((struct scsi_cmnd *)(cmd)->host_scribble)
#define SET_NEXT(cmd, next) ((cmd)->host_scribble = (void *)(next))
#define NEXTADDR(cmd) ((struct scsi_cmnd **)&((cmd)->host_scribble))
#define HOSTNO instance->host_no
......@@ -962,7 +963,7 @@ static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd,
* in a queue
*/
NEXT(cmd) = NULL;
SET_NEXT(cmd, NULL);
cmd->scsi_done = done;
cmd->result = 0;
......@@ -990,14 +991,14 @@ static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd,
*/
if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
LIST(cmd, hostdata->issue_queue);
NEXT(cmd) = hostdata->issue_queue;
SET_NEXT(cmd, hostdata->issue_queue);
hostdata->issue_queue = cmd;
} else {
for (tmp = (struct scsi_cmnd *)hostdata->issue_queue;
NEXT(tmp); tmp = NEXT(tmp))
;
LIST(cmd, tmp);
NEXT(tmp) = cmd;
SET_NEXT(tmp, cmd);
}
local_irq_restore(flags);
......@@ -1105,12 +1106,12 @@ static void NCR5380_main (struct work_struct *bl)
local_irq_disable();
if (prev) {
REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
NEXT(prev) = NEXT(tmp);
SET_NEXT(prev, NEXT(tmp));
} else {
REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
hostdata->issue_queue = NEXT(tmp);
}
NEXT(tmp) = NULL;
SET_NEXT(tmp, NULL);
/* reenable interrupts after finding one */
local_irq_restore(flags);
......@@ -1144,7 +1145,7 @@ static void NCR5380_main (struct work_struct *bl)
} else {
local_irq_disable();
LIST(tmp, hostdata->issue_queue);
NEXT(tmp) = hostdata->issue_queue;
SET_NEXT(tmp, hostdata->issue_queue);
hostdata->issue_queue = tmp;
#ifdef SUPPORT_TAGS
cmd_free_tag( tmp );
......@@ -2274,7 +2275,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
local_irq_save(flags);
LIST(cmd,hostdata->issue_queue);
NEXT(cmd) = hostdata->issue_queue;
SET_NEXT(cmd, hostdata->issue_queue);
hostdata->issue_queue = (struct scsi_cmnd *) cmd;
local_irq_restore(flags);
QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
......@@ -2330,7 +2331,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
local_irq_save(flags);
cmd->device->disconnect = 1;
LIST(cmd,hostdata->disconnected_queue);
NEXT(cmd) = hostdata->disconnected_queue;
SET_NEXT(cmd, hostdata->disconnected_queue);
hostdata->connected = NULL;
hostdata->disconnected_queue = cmd;
local_irq_restore(flags);
......@@ -2589,12 +2590,12 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
) {
if (prev) {
REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
NEXT(prev) = NEXT(tmp);
SET_NEXT(prev, NEXT(tmp));
} else {
REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
hostdata->disconnected_queue = NEXT(tmp);
}
NEXT(tmp) = NULL;
SET_NEXT(tmp, NULL);
break;
}
}
......@@ -2762,7 +2763,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
(*prev) = NEXT(tmp);
NEXT(tmp) = NULL;
SET_NEXT(tmp, NULL);
tmp->result = DID_ABORT << 16;
local_irq_restore(flags);
ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n",
......@@ -2835,7 +2836,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
if (cmd == tmp) {
REMOVE(5, *prev, tmp, NEXT(tmp));
*prev = NEXT(tmp);
NEXT(tmp) = NULL;
SET_NEXT(tmp, NULL);
tmp->result = DID_ABORT << 16;
/* We must unlock the tag/LUN immediately here, since the
* target goes to BUS FREE and doesn't send us another
......@@ -2943,7 +2944,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
for (i = 0; (cmd = disconnected_queue); ++i) {
disconnected_queue = NEXT(cmd);
NEXT(cmd) = NULL;
SET_NEXT(cmd, NULL);
cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
cmd->scsi_done( cmd );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册