aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sun3_NCR5380.c
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2011-06-06 16:52:56 -0400
committerJames Bottomley <JBottomley@Parallels.com>2011-06-29 13:11:34 -0400
commita5cb67f7bc79364afbe83886ac92deeeef2ae0f2 (patch)
treed849a33431bf9d8240a97a1767fd5ec564ef6fe5 /drivers/scsi/sun3_NCR5380.c
parent9958d6f9a680bfd4b2c66ed3f34757f4ec181d2e (diff)
[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: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/sun3_NCR5380.c')
-rw-r--r--drivers/scsi/sun3_NCR5380.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/drivers/scsi/sun3_NCR5380.c b/drivers/scsi/sun3_NCR5380.c
index 07eaef1c722..29c8246f5e7 100644
--- a/drivers/scsi/sun3_NCR5380.c
+++ b/drivers/scsi/sun3_NCR5380.c
@@ -266,8 +266,9 @@ static struct scsi_host_template *the_template = NULL;
266 (struct NCR5380_hostdata *)(in)->hostdata 266 (struct NCR5380_hostdata *)(in)->hostdata
267#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata) 267#define HOSTDATA(in) ((struct NCR5380_hostdata *)(in)->hostdata)
268 268
269#define NEXT(cmd) (*(struct scsi_cmnd **)&((cmd)->host_scribble)) 269#define NEXT(cmd) ((struct scsi_cmnd *)(cmd)->host_scribble)
270#define NEXTADDR(cmd) ((struct scsi_cmnd **)&((cmd)->host_scribble)) 270#define SET_NEXT(cmd, next) ((cmd)->host_scribble = (void *)(next))
271#define NEXTADDR(cmd) ((struct scsi_cmnd **)&((cmd)->host_scribble))
271 272
272#define HOSTNO instance->host_no 273#define HOSTNO instance->host_no
273#define H_NO(cmd) (cmd)->device->host->host_no 274#define H_NO(cmd) (cmd)->device->host->host_no
@@ -962,7 +963,7 @@ static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd,
962 * in a queue 963 * in a queue
963 */ 964 */
964 965
965 NEXT(cmd) = NULL; 966 SET_NEXT(cmd, NULL);
966 cmd->scsi_done = done; 967 cmd->scsi_done = done;
967 968
968 cmd->result = 0; 969 cmd->result = 0;
@@ -990,14 +991,14 @@ static int NCR5380_queue_command_lck(struct scsi_cmnd *cmd,
990 */ 991 */
991 if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) { 992 if (!(hostdata->issue_queue) || (cmd->cmnd[0] == REQUEST_SENSE)) {
992 LIST(cmd, hostdata->issue_queue); 993 LIST(cmd, hostdata->issue_queue);
993 NEXT(cmd) = hostdata->issue_queue; 994 SET_NEXT(cmd, hostdata->issue_queue);
994 hostdata->issue_queue = cmd; 995 hostdata->issue_queue = cmd;
995 } else { 996 } else {
996 for (tmp = (struct scsi_cmnd *)hostdata->issue_queue; 997 for (tmp = (struct scsi_cmnd *)hostdata->issue_queue;
997 NEXT(tmp); tmp = NEXT(tmp)) 998 NEXT(tmp); tmp = NEXT(tmp))
998 ; 999 ;
999 LIST(cmd, tmp); 1000 LIST(cmd, tmp);
1000 NEXT(tmp) = cmd; 1001 SET_NEXT(tmp, cmd);
1001 } 1002 }
1002 1003
1003 local_irq_restore(flags); 1004 local_irq_restore(flags);
@@ -1105,12 +1106,12 @@ static void NCR5380_main (struct work_struct *bl)
1105 local_irq_disable(); 1106 local_irq_disable();
1106 if (prev) { 1107 if (prev) {
1107 REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); 1108 REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
1108 NEXT(prev) = NEXT(tmp); 1109 SET_NEXT(prev, NEXT(tmp));
1109 } else { 1110 } else {
1110 REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp)); 1111 REMOVE(-1, hostdata->issue_queue, tmp, NEXT(tmp));
1111 hostdata->issue_queue = NEXT(tmp); 1112 hostdata->issue_queue = NEXT(tmp);
1112 } 1113 }
1113 NEXT(tmp) = NULL; 1114 SET_NEXT(tmp, NULL);
1114 1115
1115 /* reenable interrupts after finding one */ 1116 /* reenable interrupts after finding one */
1116 local_irq_restore(flags); 1117 local_irq_restore(flags);
@@ -1144,7 +1145,7 @@ static void NCR5380_main (struct work_struct *bl)
1144 } else { 1145 } else {
1145 local_irq_disable(); 1146 local_irq_disable();
1146 LIST(tmp, hostdata->issue_queue); 1147 LIST(tmp, hostdata->issue_queue);
1147 NEXT(tmp) = hostdata->issue_queue; 1148 SET_NEXT(tmp, hostdata->issue_queue);
1148 hostdata->issue_queue = tmp; 1149 hostdata->issue_queue = tmp;
1149#ifdef SUPPORT_TAGS 1150#ifdef SUPPORT_TAGS
1150 cmd_free_tag( tmp ); 1151 cmd_free_tag( tmp );
@@ -2274,7 +2275,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
2274 2275
2275 local_irq_save(flags); 2276 local_irq_save(flags);
2276 LIST(cmd,hostdata->issue_queue); 2277 LIST(cmd,hostdata->issue_queue);
2277 NEXT(cmd) = hostdata->issue_queue; 2278 SET_NEXT(cmd, hostdata->issue_queue);
2278 hostdata->issue_queue = (struct scsi_cmnd *) cmd; 2279 hostdata->issue_queue = (struct scsi_cmnd *) cmd;
2279 local_irq_restore(flags); 2280 local_irq_restore(flags);
2280 QU_PRINTK("scsi%d: REQUEST SENSE added to head of " 2281 QU_PRINTK("scsi%d: REQUEST SENSE added to head of "
@@ -2330,7 +2331,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance)
2330 local_irq_save(flags); 2331 local_irq_save(flags);
2331 cmd->device->disconnect = 1; 2332 cmd->device->disconnect = 1;
2332 LIST(cmd,hostdata->disconnected_queue); 2333 LIST(cmd,hostdata->disconnected_queue);
2333 NEXT(cmd) = hostdata->disconnected_queue; 2334 SET_NEXT(cmd, hostdata->disconnected_queue);
2334 hostdata->connected = NULL; 2335 hostdata->connected = NULL;
2335 hostdata->disconnected_queue = cmd; 2336 hostdata->disconnected_queue = cmd;
2336 local_irq_restore(flags); 2337 local_irq_restore(flags);
@@ -2589,12 +2590,12 @@ static void NCR5380_reselect (struct Scsi_Host *instance)
2589 ) { 2590 ) {
2590 if (prev) { 2591 if (prev) {
2591 REMOVE(prev, NEXT(prev), tmp, NEXT(tmp)); 2592 REMOVE(prev, NEXT(prev), tmp, NEXT(tmp));
2592 NEXT(prev) = NEXT(tmp); 2593 SET_NEXT(prev, NEXT(tmp));
2593 } else { 2594 } else {
2594 REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp)); 2595 REMOVE(-1, hostdata->disconnected_queue, tmp, NEXT(tmp));
2595 hostdata->disconnected_queue = NEXT(tmp); 2596 hostdata->disconnected_queue = NEXT(tmp);
2596 } 2597 }
2597 NEXT(tmp) = NULL; 2598 SET_NEXT(tmp, NULL);
2598 break; 2599 break;
2599 } 2600 }
2600 } 2601 }
@@ -2762,7 +2763,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
2762 if (cmd == tmp) { 2763 if (cmd == tmp) {
2763 REMOVE(5, *prev, tmp, NEXT(tmp)); 2764 REMOVE(5, *prev, tmp, NEXT(tmp));
2764 (*prev) = NEXT(tmp); 2765 (*prev) = NEXT(tmp);
2765 NEXT(tmp) = NULL; 2766 SET_NEXT(tmp, NULL);
2766 tmp->result = DID_ABORT << 16; 2767 tmp->result = DID_ABORT << 16;
2767 local_irq_restore(flags); 2768 local_irq_restore(flags);
2768 ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n", 2769 ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n",
@@ -2835,7 +2836,7 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)
2835 if (cmd == tmp) { 2836 if (cmd == tmp) {
2836 REMOVE(5, *prev, tmp, NEXT(tmp)); 2837 REMOVE(5, *prev, tmp, NEXT(tmp));
2837 *prev = NEXT(tmp); 2838 *prev = NEXT(tmp);
2838 NEXT(tmp) = NULL; 2839 SET_NEXT(tmp, NULL);
2839 tmp->result = DID_ABORT << 16; 2840 tmp->result = DID_ABORT << 16;
2840 /* We must unlock the tag/LUN immediately here, since the 2841 /* We must unlock the tag/LUN immediately here, since the
2841 * target goes to BUS FREE and doesn't send us another 2842 * target goes to BUS FREE and doesn't send us another
@@ -2943,7 +2944,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)
2943 2944
2944 for (i = 0; (cmd = disconnected_queue); ++i) { 2945 for (i = 0; (cmd = disconnected_queue); ++i) {
2945 disconnected_queue = NEXT(cmd); 2946 disconnected_queue = NEXT(cmd);
2946 NEXT(cmd) = NULL; 2947 SET_NEXT(cmd, NULL);
2947 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); 2948 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
2948 cmd->scsi_done( cmd ); 2949 cmd->scsi_done( cmd );
2949 } 2950 }