]> www.infradead.org Git - users/jedix/linux-maple.git/commit
ata: libata-scsi: Refactor ata_scsiop_maint_in()
authorDamien Le Moal <dlemoal@kernel.org>
Tue, 22 Oct 2024 02:45:34 +0000 (11:45 +0900)
committerNiklas Cassel <cassel@kernel.org>
Fri, 25 Oct 2024 08:09:49 +0000 (10:09 +0200)
commit4ab7bb97634351914a18f3c4533992c99eb6edb6
tree138aeca9b589d10e8c13181fea1e426d19810550
parent44bdde151a6f5b34993c570a8f6508e2e00b56e1
ata: libata-scsi: Refactor ata_scsiop_maint_in()

Move the check for MI_REPORT_SUPPORTED_OPERATION_CODES from
ata_scsi_simulate() into ata_scsiop_maint_in() to simplify
ata_scsi_simulate() code.

Furthermore, since an rbuff fill actor function returning a non-zero
value causes no data to be returned for the command, directly return
an error (return 1) for invalid command formt after setting the invalid
field in cdb error.

Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
Link: https://lore.kernel.org/r/20241022024537.251905-4-dlemoal@kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
drivers/ata/libata-scsi.c