OSDN Git Service

ata: libata-sff: refactor ata_sff_altstatus()
authorSergey Shtylyov <s.shtylyov@omp.ru>
Sun, 13 Feb 2022 15:10:32 +0000 (18:10 +0300)
committerDamien Le Moal <damien.lemoal@opensource.wdc.com>
Sun, 20 Feb 2022 00:03:17 +0000 (09:03 +0900)
commit03c0e84f9c1e166d57d06b04497e11205f48e9a8
treefe20aeb4b80dc56246861988b23de8361287e5e7
parent4fc5f0aa9712418dcb12c446a904a359e5568659
ata: libata-sff: refactor ata_sff_altstatus()

The driver's calls to ata_sff_altstatus() are mostly surrounded by some
clumsy checks. Refactor ata_sff_altstatus() to include the repetitive
checks and return a 'bool' result indicating if the alternate status
register exists or not.

While at it, further update the 'kernel-doc' comment -- the alternate
status register has never been a part of the taskfile, despite what
Jeff and co. think! :-)

In ata_sff_lost_interrupt(), wrap the ata_sff_altstatus() call in a
WARN_ON_ONCE() check to issue a warning if the device control register
does not exist. And while at it, fix the strange argument indentation
in the ata_port_warn() call following the call to ata_sff_altstatus().

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
drivers/ata/libata-sff.c