]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
ata: libata-scsi: refactor ata_scsiop_maint_in()
authorNiklas Cassel <cassel@kernel.org>
Fri, 20 Mar 2026 10:59:51 +0000 (11:59 +0100)
committerNiklas Cassel <cassel@kernel.org>
Mon, 23 Mar 2026 10:31:51 +0000 (11:31 +0100)
commita6ac0af4d51081ef63ee588c9b8fa10c0f8e9210
tree60c6d5ef3d39f9e05ebbe446a264cf49c0d81308
parentd78c5bbf098fd93884a5dc05aec045f32cce7525
ata: libata-scsi: refactor ata_scsiop_maint_in()

ata_scsiop_maint_in() is currently quite confusing to read, because it
currently only implements support for the service action REPORT SUPPORTED
OPERATION CODES.

Thus, when this function is checking for "invalid command format", it is
not very clear if it is an invalid command format for the MAINTENANCE IN
command itself, or an invalid command format for the (currently one and
only) service action/subcommand implemented for this command.

Move the service action to a separate function, so it is more clear that
the "invalid command format" check is actually specific for the REPORT
SUPPORTED OPERATION CODES service action.

This also makes it easier and less confusing to add support for additional
service actions in the future.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>
Signed-off-by: Niklas Cassel <cassel@kernel.org>
drivers/ata/libata-scsi.c