Skip to contentSkip to conversation

ata: sunxi: fix debug messages

PATCH New Dario Binacchi 3 participants 3 messages Jan 24, 2021 – Jan 29, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ata: sunxi: fix debug messages

It is useless and misleading to print the ret variable that is not set by the dev_read_addr routine. Also, move the '\n' character after the round bracket that contains the error code.

---

 drivers/ata/ahci_sunxi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/ahci_sunxi.c +4 -4
index 58e345d998..94a3379c53 100644
@@ -80,18 +80,18 @@ static int sunxi_sata_probe(struct udevice *dev)
 
 	base = dev_read_addr(dev);
 	if (base == FDT_ADDR_T_NONE) {
-		debug("%s: Failed to find address (err=%d\n)", __func__, ret);
+		debug("%s: Failed to find address\n", __func__);
 		return -EINVAL;
 	}
 	reg = (u8 *)base;
 	ret = sunxi_ahci_phy_init(reg);
 	if (ret) {
-		debug("%s: Failed to init phy (err=%d\n)", __func__, ret);
+		debug("%s: Failed to init phy (err=%d)\n", __func__, ret);
 		return ret;
 	}
 	ret = ahci_probe_scsi(dev, base);
 	if (ret) {
-		debug("%s: Failed to probe (err=%d\n)", __func__, ret);
+		debug("%s: Failed to probe (err=%d)\n", __func__, ret);
 		return ret;
 	}
 
@@ -105,7 +105,7 @@ static int sunxi_sata_bind(struct udevice *dev)
 
 	ret = ahci_bind_scsi(dev, &scsi_dev);
 	if (ret) {
-		debug("%s: Failed to bind (err=%d\n)", __func__, ret);
+		debug("%s: Failed to bind (err=%d)\n", __func__, ret);
 		return ret;
 	}
 
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 ata: sunxi: fix debug messages

Hi Dario,

Quoted 10 lines · Dario Binacchi

It is useless and misleading to print the ret variable that is not set by the dev_read_addr routine. Also, move the '\n' character after the round bracket that contains the error code.

---

 drivers/ata/ahci_sunxi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

You could consider using log_debug() (with LOG_CATEGORY defined at the top) and then you can drop the __func__ stuff.

Regards,
Simon

#2 lore raw

PATCH 1/1 ata: sunxi: fix debug messages

In reply to Dario Binacchi
Quoted 5 lines · On Sun, 24 Jan 2021 19:13:10 +0100 Dario Binacchi <[email protected]> wrote:

It is useless and misleading to print the ret variable that is not set by the dev_read_addr routine. Also, move the '\n' character after the round bracket that contains the error code.

Good catch!

Cheers,
Andre

Quoted 40 lines

---

 drivers/ata/ahci_sunxi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/ata/ahci_sunxi.c +4 -4
index 58e345d998..94a3379c53 100644
@@ -80,18 +80,18 @@ static int sunxi_sata_probe(struct udevice *dev)
 
 	base = dev_read_addr(dev);
 	if (base == FDT_ADDR_T_NONE) {
-		debug("%s: Failed to find address (err=%d\n)", __func__, ret);
+		debug("%s: Failed to find address\n", __func__);
 		return -EINVAL;
 	}
 	reg = (u8 *)base;
 	ret = sunxi_ahci_phy_init(reg);
 	if (ret) {
-		debug("%s: Failed to init phy (err=%d\n)", __func__, ret);
+		debug("%s: Failed to init phy (err=%d)\n", __func__, ret);
 		return ret;
 	}
 	ret = ahci_probe_scsi(dev, base);
 	if (ret) {
-		debug("%s: Failed to probe (err=%d\n)", __func__, ret);
+		debug("%s: Failed to probe (err=%d)\n", __func__, ret);
 		return ret;
 	}
 
@@ -105,7 +105,7 @@ static int sunxi_sata_bind(struct udevice *dev)
 
 	ret = ahci_bind_scsi(dev, &scsi_dev);
 	if (ret) {
-		debug("%s: Failed to bind (err=%d\n)", __func__, ret);
+		debug("%s: Failed to bind (err=%d)\n", __func__, ret);
 		return ret;
 	}