Skip to content

Commit

Permalink
ata: libata-sff: make ata_devchk() return 'bool'
Browse files Browse the repository at this point in the history
ata_devchk() returns 1 if a device is present, 0 if not -- the 'bool' type
clearly fits better here than 'unsigned int'...

Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
  • Loading branch information
Sergey Shtylyov authored and Damien Le Moal committed Feb 19, 2022
1 parent 8d46352 commit 1336aa8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions drivers/ata/libata-sff.c
Original file line number Diff line number Diff line change
Expand Up @@ -1751,10 +1751,13 @@ EXPORT_SYMBOL_GPL(ata_sff_prereset);
* correctly storing and echoing back the
* ATA shadow register contents.
*
* RETURN:
* true if device is present, false if not.
*
* LOCKING:
* caller.
*/
static unsigned int ata_devchk(struct ata_port *ap, unsigned int device)
static bool ata_devchk(struct ata_port *ap, unsigned int device)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
u8 nsect, lbal;
Expand All @@ -1774,9 +1777,9 @@ static unsigned int ata_devchk(struct ata_port *ap, unsigned int device)
lbal = ioread8(ioaddr->lbal_addr);

if ((nsect == 0x55) && (lbal == 0xaa))
return 1; /* we found a device */
return true; /* we found a device */

return 0; /* nothing found */
return false; /* nothing found */
}

/**
Expand Down

0 comments on commit 1336aa8

Please sign in to comment.