diff options
author | Ondrej Zary <linux@rainbow-software.org> | 2015-02-06 17:11:34 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Odin.com> | 2015-04-09 21:07:26 -0400 |
commit | a13b3722a352dffa838994eb713573e2e189d928 (patch) | |
tree | 1a8c95bd3fa3f9121d7b9c8cbdf4a422795fdad8 | |
parent | 0c2b64819105986c12d7412a1cb5b91e3d80c15c (diff) |
aha1542: Remove unneeded gotos
Remove gotos that are no longer needed.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
-rw-r--r-- | drivers/scsi/aha1542.c | 58 |
1 files changed, 19 insertions, 39 deletions
diff --git a/drivers/scsi/aha1542.c b/drivers/scsi/aha1542.c index 7bf4604ede47..af2c69e1a697 100644 --- a/drivers/scsi/aha1542.c +++ b/drivers/scsi/aha1542.c | |||
@@ -198,17 +198,16 @@ static int aha1542_in(unsigned int base, u8 *cmdp, int len, int timeout) | |||
198 | 198 | ||
199 | spin_lock_irqsave(&aha1542_lock, flags); | 199 | spin_lock_irqsave(&aha1542_lock, flags); |
200 | while (len--) { | 200 | while (len--) { |
201 | if (!wait_mask(STATUS(base), DF, DF, 0, timeout)) | 201 | if (!wait_mask(STATUS(base), DF, DF, 0, timeout)) { |
202 | goto fail; | 202 | spin_unlock_irqrestore(&aha1542_lock, flags); |
203 | if (timeout == 0) | ||
204 | printk(KERN_ERR "aha1542_in failed(%d): ", len + 1); | ||
205 | return 1; | ||
206 | } | ||
203 | *cmdp++ = inb(DATA(base)); | 207 | *cmdp++ = inb(DATA(base)); |
204 | } | 208 | } |
205 | spin_unlock_irqrestore(&aha1542_lock, flags); | 209 | spin_unlock_irqrestore(&aha1542_lock, flags); |
206 | return 0; | 210 | return 0; |
207 | fail: | ||
208 | spin_unlock_irqrestore(&aha1542_lock, flags); | ||
209 | if (timeout == 0) | ||
210 | printk(KERN_ERR "aha1542_in failed(%d): ", len + 1); | ||
211 | return 1; | ||
212 | } | 211 | } |
213 | 212 | ||
214 | static int makecode(unsigned hosterr, unsigned scsierr) | 213 | static int makecode(unsigned hosterr, unsigned scsierr) |
@@ -292,12 +291,12 @@ static int aha1542_test_port(int bse, struct Scsi_Host *shpnt) | |||
292 | debug = 1; | 291 | debug = 1; |
293 | /* Expect INIT and IDLE, any of the others are bad */ | 292 | /* Expect INIT and IDLE, any of the others are bad */ |
294 | if (!wait_mask(STATUS(bse), STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF, 0)) | 293 | if (!wait_mask(STATUS(bse), STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF, 0)) |
295 | goto fail; | 294 | return 0; |
296 | 295 | ||
297 | debug = 2; | 296 | debug = 2; |
298 | /* Shouldn't have generated any interrupts during reset */ | 297 | /* Shouldn't have generated any interrupts during reset */ |
299 | if (inb(INTRFLAGS(bse)) & INTRMASK) | 298 | if (inb(INTRFLAGS(bse)) & INTRMASK) |
300 | goto fail; | 299 | return 0; |
301 | 300 | ||
302 | 301 | ||
303 | /* Perform a host adapter inquiry instead so we do not need to set | 302 | /* Perform a host adapter inquiry instead so we do not need to set |
@@ -311,19 +310,19 @@ static int aha1542_test_port(int bse, struct Scsi_Host *shpnt) | |||
311 | 310 | ||
312 | while (len--) { | 311 | while (len--) { |
313 | if (!wait_mask(STATUS(bse), DF, DF, 0, 0)) | 312 | if (!wait_mask(STATUS(bse), DF, DF, 0, 0)) |
314 | goto fail; | 313 | return 0; |
315 | *cmdp++ = inb(DATA(bse)); | 314 | *cmdp++ = inb(DATA(bse)); |
316 | } | 315 | } |
317 | 316 | ||
318 | debug = 8; | 317 | debug = 8; |
319 | /* Reading port should reset DF */ | 318 | /* Reading port should reset DF */ |
320 | if (inb(STATUS(bse)) & DF) | 319 | if (inb(STATUS(bse)) & DF) |
321 | goto fail; | 320 | return 0; |
322 | 321 | ||
323 | debug = 9; | 322 | debug = 9; |
324 | /* When HACC, command is completed, and we're though testing */ | 323 | /* When HACC, command is completed, and we're though testing */ |
325 | if (!wait_mask(INTRFLAGS(bse), HACC, HACC, 0, 0)) | 324 | if (!wait_mask(INTRFLAGS(bse), HACC, HACC, 0, 0)) |
326 | goto fail; | 325 | return 0; |
327 | /* now initialize adapter */ | 326 | /* now initialize adapter */ |
328 | 327 | ||
329 | debug = 10; | 328 | debug = 10; |
@@ -333,8 +332,6 @@ static int aha1542_test_port(int bse, struct Scsi_Host *shpnt) | |||
333 | debug = 11; | 332 | debug = 11; |
334 | 333 | ||
335 | return debug; /* 1 = ok */ | 334 | return debug; /* 1 = ok */ |
336 | fail: | ||
337 | return 0; /* 0 = not ok */ | ||
338 | } | 335 | } |
339 | 336 | ||
340 | static int aha1542_restart(struct Scsi_Host *shost) | 337 | static int aha1542_restart(struct Scsi_Host *shost) |
@@ -692,11 +689,7 @@ static void setup_mailboxes(int bse, struct Scsi_Host *shpnt) | |||
692 | any2scsi((cmd + 2), isa_virt_to_bus(mb)); | 689 | any2scsi((cmd + 2), isa_virt_to_bus(mb)); |
693 | aha1542_out(bse, cmd, 5); | 690 | aha1542_out(bse, cmd, 5); |
694 | if (!wait_mask(INTRFLAGS(bse), INTRMASK, HACC, 0, 0)) | 691 | if (!wait_mask(INTRFLAGS(bse), INTRMASK, HACC, 0, 0)) |
695 | goto fail; | ||
696 | while (0) { | ||
697 | fail: | ||
698 | printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n"); | 692 | printk(KERN_ERR "aha1542_detect: failed setting up mailboxes\n"); |
699 | } | ||
700 | aha1542_intr_reset(bse); | 693 | aha1542_intr_reset(bse); |
701 | } | 694 | } |
702 | 695 | ||
@@ -711,11 +704,7 @@ static int aha1542_getconfig(int base_io, unsigned char *irq_level, unsigned cha | |||
711 | aha1542_outb(base_io, CMD_RETCONF); | 704 | aha1542_outb(base_io, CMD_RETCONF); |
712 | aha1542_in(base_io, inquiry_result, 3, 0); | 705 | aha1542_in(base_io, inquiry_result, 3, 0); |
713 | if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0)) | 706 | if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0)) |
714 | goto fail; | ||
715 | while (0) { | ||
716 | fail: | ||
717 | printk(KERN_ERR "aha1542_detect: query board settings\n"); | 707 | printk(KERN_ERR "aha1542_detect: query board settings\n"); |
718 | } | ||
719 | aha1542_intr_reset(base_io); | 708 | aha1542_intr_reset(base_io); |
720 | switch (inquiry_result[0]) { | 709 | switch (inquiry_result[0]) { |
721 | case 0x80: | 710 | case 0x80: |
@@ -816,11 +805,7 @@ static int aha1542_query(int base_io, int *transl) | |||
816 | aha1542_outb(base_io, CMD_INQUIRY); | 805 | aha1542_outb(base_io, CMD_INQUIRY); |
817 | aha1542_in(base_io, inquiry_result, 4, 0); | 806 | aha1542_in(base_io, inquiry_result, 4, 0); |
818 | if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0)) | 807 | if (!wait_mask(INTRFLAGS(base_io), INTRMASK, HACC, 0, 0)) |
819 | goto fail; | ||
820 | while (0) { | ||
821 | fail: | ||
822 | printk(KERN_ERR "aha1542_detect: query card type\n"); | 808 | printk(KERN_ERR "aha1542_detect: query card type\n"); |
823 | } | ||
824 | aha1542_intr_reset(base_io); | 809 | aha1542_intr_reset(base_io); |
825 | 810 | ||
826 | *transl = BIOS_TRANSLATION_6432; /* Default case */ | 811 | *transl = BIOS_TRANSLATION_6432; /* Default case */ |
@@ -1147,8 +1132,10 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) | |||
1147 | spin_lock_irq(SCpnt->device->host->host_lock); | 1132 | spin_lock_irq(SCpnt->device->host->host_lock); |
1148 | 1133 | ||
1149 | if (!wait_mask(STATUS(SCpnt->device->host->io_port), | 1134 | if (!wait_mask(STATUS(SCpnt->device->host->io_port), |
1150 | STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF, 0)) | 1135 | STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF, 0)) { |
1151 | goto fail; | 1136 | spin_unlock_irq(SCpnt->device->host->host_lock); |
1137 | return FAILED; | ||
1138 | } | ||
1152 | 1139 | ||
1153 | /* | 1140 | /* |
1154 | * Now try to pick up the pieces. For all pending commands, | 1141 | * Now try to pick up the pieces. For all pending commands, |
@@ -1182,10 +1169,6 @@ static int aha1542_bus_reset(Scsi_Cmnd * SCpnt) | |||
1182 | 1169 | ||
1183 | spin_unlock_irq(SCpnt->device->host->host_lock); | 1170 | spin_unlock_irq(SCpnt->device->host->host_lock); |
1184 | return SUCCESS; | 1171 | return SUCCESS; |
1185 | |||
1186 | fail: | ||
1187 | spin_unlock_irq(SCpnt->device->host->host_lock); | ||
1188 | return FAILED; | ||
1189 | } | 1172 | } |
1190 | 1173 | ||
1191 | static int aha1542_host_reset(Scsi_Cmnd * SCpnt) | 1174 | static int aha1542_host_reset(Scsi_Cmnd * SCpnt) |
@@ -1212,9 +1195,10 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt) | |||
1212 | spin_lock_irq(SCpnt->device->host->host_lock); | 1195 | spin_lock_irq(SCpnt->device->host->host_lock); |
1213 | 1196 | ||
1214 | if (!wait_mask(STATUS(SCpnt->device->host->io_port), | 1197 | if (!wait_mask(STATUS(SCpnt->device->host->io_port), |
1215 | STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF, 0)) | 1198 | STATMASK, INIT | IDLE, STST | DIAGF | INVDCMD | DF | CDF, 0)) { |
1216 | goto fail; | 1199 | spin_unlock_irq(SCpnt->device->host->host_lock); |
1217 | 1200 | return FAILED; | |
1201 | } | ||
1218 | /* | 1202 | /* |
1219 | * We need to do this too before the 1542 can interact with | 1203 | * We need to do this too before the 1542 can interact with |
1220 | * us again. | 1204 | * us again. |
@@ -1252,10 +1236,6 @@ static int aha1542_host_reset(Scsi_Cmnd * SCpnt) | |||
1252 | 1236 | ||
1253 | spin_unlock_irq(SCpnt->device->host->host_lock); | 1237 | spin_unlock_irq(SCpnt->device->host->host_lock); |
1254 | return SUCCESS; | 1238 | return SUCCESS; |
1255 | |||
1256 | fail: | ||
1257 | spin_unlock_irq(SCpnt->device->host->host_lock); | ||
1258 | return FAILED; | ||
1259 | } | 1239 | } |
1260 | 1240 | ||
1261 | static int aha1542_biosparam(struct scsi_device *sdev, | 1241 | static int aha1542_biosparam(struct scsi_device *sdev, |