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:02:06 +0000 (16:02 +0200)
commit4523841390c9e9a5ebfc59deb81009f5015b4971
treee18a5078b7e023ce117f65b20920f9ffd574d3c2
parent8a2e98f298183036554f31a57a20c3f8bcd2e4a5
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