Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ata: libata-sata: simplify ata_sas_queuecmd()

Change ata_sas_queuecmd() to return early the result of
__ata_scsi_queuecmd() and remove the rc local variable.
This simplifies the code without any functional change.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Reviewed-by: Hannes Reinecke <hare@suse.de>

+6 -8
+6 -8
drivers/ata/libata-sata.c
··· 1378 1378 1379 1379 int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap) 1380 1380 { 1381 - int rc = 0; 1382 - 1383 1381 if (likely(ata_dev_enabled(ap->link.device))) 1384 - rc = __ata_scsi_queuecmd(cmd, ap->link.device); 1385 - else { 1386 - cmd->result = (DID_BAD_TARGET << 16); 1387 - scsi_done(cmd); 1388 - } 1389 - return rc; 1382 + return __ata_scsi_queuecmd(cmd, ap->link.device); 1383 + 1384 + cmd->result = (DID_BAD_TARGET << 16); 1385 + scsi_done(cmd); 1386 + 1387 + return 0; 1390 1388 } 1391 1389 EXPORT_SYMBOL_GPL(ata_sas_queuecmd); 1392 1390