Make all the devchk() functions return 'bool`
Subsystems (3)
cover Make all the devchk() functions return 'bool`
Here are 3 patches against the 'for-next' branch of Damien Le Moal's 'libata.git' repo. Make all the devchk() functions return 'bool` inbstead of 'unsigned int'.
Sergey Shtylyov (3):
ata: libata-sff: make ata_devchk() return 'bool'
ata: pata_samsung_cf: make pata_s3c_devchk() return 'bool'
ata: sata_rcar: make sata_rcar_ata_devchk() return 'bool'
drivers/ata/libata-sff.c | 9 ++++++--- drivers/ata/pata_samsung_cf.c | 7 +++---- drivers/ata/sata_rcar.c | 7 +++---- 3 files changed, 12 insertions(+), 11 deletions(-)
Signature · 1 line
2.26.3
PATCH 1/3 ata: libata-sff: make ata_devchk() return 'bool'
ata_devchk() returns 1 if a device is present, 0 if not -- the 'bool' type clearly fits better here than 'unsigned int'...
--- drivers/ata/libata-sff.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/ata/libata-sff.c +6 -3
@@ -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;
@@ -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 */ }/**
Signature · 1 line
2.26.3
PATCH 2/3 ata: pata_samsung_cf: make pata_s3c_devchk() return 'bool'
In reply to Sergey Shtylyovpata_s3c_devchk() returns 1 if a device is present, 0 if not -- the 'bool' type clearly fits better here than 'unsigned int'...
--- drivers/ata/pata_samsung_cf.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/ata/pata_samsung_cf.c +3 -4
@@ -308,8 +308,7 @@ static void pata_s3c_dev_select(struct ata_port *ap, unsigned int device)/* * pata_s3c_devchk - PATA device presence detection */ -static unsigned int pata_s3c_devchk (struct ata_port *ap, -unsigned int device) +static bool pata_s3c_devchk (struct ata_port *ap,unsigned int device) {struct ata_ioports *ioaddr = &ap->ioaddr;u8 nsect, lbal;
@@ -329,9 +328,9 @@ static unsigned int pata_s3c_devchk(struct ata_port *ap, lbal =ata_inb (ap->host, 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 */ }/*
Signature · 1 line
2.26.3
PATCH 3/3 ata: sata_rcar: make sata_rcar_ata_devchk() return 'bool'
In reply to Sergey Shtylyovsata_rcar_ata_devchk() returns 1 if a device is present, 0 if not -- the 'bool' type clearly fits better here than 'unsigned int'...
--- drivers/ata/sata_rcar.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/ata/sata_rcar.c +3 -4
@@ -283,8 +283,7 @@ static void sata_rcar_dev_select(struct ata_port *ap, unsigned int device)ata_sff_pause (ap);/* needed; also flushes, for mmio */ } -static unsigned int sata_rcar_ata_devchk (struct ata_port *ap, -unsigned int device) +static bool sata_rcar_ata_devchk (struct ata_port *ap,unsigned int device) {struct ata_ioports *ioaddr = &ap->ioaddr;u8 nsect, lbal;
@@ -304,9 +303,9 @@ static unsigned int sata_rcar_ata_devchk(struct ata_port *ap, lbal =ioread32 (ioaddr->lbal_addr);if (nsect ==0x55 && lbal ==0xaa ) -return 1 ;/* found a device */ +return true;/* found a device */ -return 0 ;/* nothing found */ +return false;/* nothing found */ } static int sata_rcar_wait_after_reset(struct ata_link *link,
Signature · 1 line
2.26.3
Damien Le Moal
AppliedQuoted 9 lines · Sergey Shtylyov
Here are 3 patches against the 'for-next' branch of Damien Le Moal's 'libata.git' repo. Make all the
devchk()functions return 'bool` inbstead of 'unsigned int'.Sergey Shtylyov (3):
ata: libata-sff: makeata_devchk()return 'bool'
ata:pata_samsung_cf: makepata_s3c_devchk()return 'bool'
ata:sata_rcar: makesata_rcar_ata_devchk()return 'bool'
Quoted 5 lines
drivers/ata/libata-sff.c | 9 ++++++--- drivers/ata/pata_samsung_cf.c | 7 +++---- drivers/ata/sata_rcar.c | 7 +++---- 3 files changed, 12 insertions(+), 11 deletions(-)
Applied to for-5.18. Thanks !
Signature · 2 lines
Damien Le Moal Western Digital Research