scsi: core: Fixup calling convention for scsi_mode_sense()
authorHannes Reinecke <hare@suse.de>
Tue, 27 Apr 2021 08:30:09 +0000 (10:30 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 20 Jul 2021 14:05:40 +0000 (16:05 +0200)
commit6bad74b2b49fa274201e301cb7382d5330dbd267
treedcbf18688f24769493add1e5794415be9227bbff
parentb4fd2ab0a91b7ccfa8024a1c3ff7d71904857950
scsi: core: Fixup calling convention for scsi_mode_sense()

[ Upstream commit 8793613de913e03e7c884f4cc56e350bc716431e ]

The description for scsi_mode_sense() claims to return the number of valid
bytes on success, which is not what the code does.  Additionally there is
no gain in returning the SCSI status, as everything the callers do is to
check against scsi_result_is_good(), which is what scsi_mode_sense() does
already.  So change the calling convention to return a standard error code
on failure, and 0 on success, and adapt the description and all callers.

Link: https://lore.kernel.org/r/20210427083046.31620-4-hare@suse.de
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/scsi/scsi_lib.c
drivers/scsi/scsi_transport_sas.c
drivers/scsi/sd.c
drivers/scsi/sr.c