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

ata: libata-scsi: Cleanup ata_scsi_offline_dev()

Change the function ata_scsi_offline_dev() to return a bool and change
this function kdoc comment to have the correct mention of its call site.
No functional changes.

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

+8 -9
+7 -8
drivers/ata/libata-scsi.c
··· 4633 4633 * ata_scsi_offline_dev - offline attached SCSI device 4634 4634 * @dev: ATA device to offline attached SCSI device for 4635 4635 * 4636 - * This function is called from ata_eh_hotplug() and responsible 4637 - * for taking the SCSI device attached to @dev offline. This 4638 - * function is called with host lock which protects dev->sdev 4639 - * against clearing. 4636 + * This function is called from ata_eh_detach_dev() and is responsible for 4637 + * taking the SCSI device attached to @dev offline. This function is 4638 + * called with host lock which protects dev->sdev against clearing. 4640 4639 * 4641 4640 * LOCKING: 4642 4641 * spin_lock_irqsave(host lock) 4643 4642 * 4644 4643 * RETURNS: 4645 - * 1 if attached SCSI device exists, 0 otherwise. 4644 + * true if attached SCSI device exists, false otherwise. 4646 4645 */ 4647 - int ata_scsi_offline_dev(struct ata_device *dev) 4646 + bool ata_scsi_offline_dev(struct ata_device *dev) 4648 4647 { 4649 4648 if (dev->sdev) { 4650 4649 scsi_device_set_state(dev->sdev, SDEV_OFFLINE); 4651 - return 1; 4650 + return true; 4652 4651 } 4653 - return 0; 4652 + return false; 4654 4653 } 4655 4654 4656 4655 /**
+1 -1
drivers/ata/libata.h
··· 144 144 extern int ata_scsi_add_hosts(struct ata_host *host, 145 145 const struct scsi_host_template *sht); 146 146 extern void ata_scsi_scan_host(struct ata_port *ap, int sync); 147 - extern int ata_scsi_offline_dev(struct ata_device *dev); 147 + extern bool ata_scsi_offline_dev(struct ata_device *dev); 148 148 extern bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq); 149 149 extern void ata_scsi_set_sense(struct ata_device *dev, 150 150 struct scsi_cmnd *cmd, u8 sk, u8 asc, u8 ascq);