spi: zynq_qspi: Minor cleanups
Subsystems (2)
PATCH v2 1/1 spi: zynq_qspi: Minor cleanups
- Use __func__ on debug
- Removed unnecessary comment
- Fix function name in debug as zynq_qspi_xfer instead of spi_xfer
---
Changes for v2:
- Fix commit message - Use meaningful commit header, add proper details for all fixes.
- Fix debug print in zynq_qspi_xfer
drivers/spi/zynq_qspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/spi/zynq_qspi.c +3 -5
@@ -430,7 +430,6 @@ static int zynq_qspi_start_transfer(struct zynq_qspi_priv *priv)zynq_qspi_fill_tx_fifo (priv, priv->fifo_depth);writel (ZYNQ_QSPI_IXR_ALL_MASK , ®s->ier); -/* Start the transfer by enabling manual start bit */ /* wait for completion */ do {
@@ -516,7 +515,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen, priv->rx_buf = din; priv->len = bitlen /8 ; -debug ("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , +debug ("zynq_qspi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , bus->seq, slave_plat->cs, bitlen, priv->len, flags);/*
@@ -569,8 +568,7 @@ static int zynq_qspi_set_speed(struct udevice *bus, uint speed)writel (confr, ®s->cr); priv->freq = speed; -debug ("zynq_spi_set_speed: regs=%p, speed=%d\n" , - priv->regs, priv->freq); +debug ("%s: regs=%p, speed=%d\n" , __func__, priv->regs, priv->freq);return 0 ; }
@@ -593,7 +591,7 @@ static int zynq_qspi_set_mode(struct udevice *bus, uint mode)writel (confr, ®s->cr); priv->mode = mode; -debug ("zynq_spi_set_mode: regs=%p, mode=%d\n" , priv->regs, priv->mode); +debug ("%s: regs=%p, mode=%d\n" , __func__, priv->regs, priv->mode);return 0 ; }
Signature · 1 line
1.9.1
PATCH v2 1/1 spi: zynq_qspi: Minor cleanups
Quoted 28 lines · Jagan Teki
- Use
__func__on debug
- Removed unnecessary comment
- Fix function name in debug aszynq_qspi_xferinstead ofspi_xferCc Tom Rini <[email protected]>Signed-off-by Jagan Teki <[email protected]>---
Changes for v2:
- Fix commit message - Use meaningful commit header, add proper details for all fixes.
- Fix debug print inzynq_qspi_xferdrivers/spi/zynq_qspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/spi/zynq_qspi.c +0
-1@@ -430,7 +430,6 @@ static int zynq_qspi_start_transfer(struct zynq_qspi_priv *priv)zynq_qspi_fill_tx_fifo (priv, priv->fifo_depth);writel (ZYNQ_QSPI_IXR_ALL_MASK , ®s->ier); -/* Start the transfer by enabling manual start bit */ /* wait for completion */ do {
drivers/spi/zynq_qspi.c static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen, · line 521
Quoted 8 lines
drivers/spi/zynq_qspi.c +1
-1@@ -516,7 +515,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen, priv->rx_buf = din; priv->len = bitlen /8 ; -debug ("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , +debug ("zynq_qspi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , bus->seq, slave_plat->cs, bitlen, priv->len, flags);/*
I'm not poking the code regularly myself so, ok, sure. But why not __func__? I don't get it.
Signature · 8 lines
Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151025/5801b397/attachment.sig>
PATCH v2 1/1 spi: zynq_qspi: Minor cleanups
Quoted 32 lines · Tom Rini
Quoted 31 lines · Jagan Teki
- Use
__func__on debug
- Removed unnecessary comment
- Fix function name in debug aszynq_qspi_xferinstead ofspi_xferCc Tom Rini <[email protected]>Signed-off-by Jagan Teki <[email protected]>---
Changes for v2:
- Fix commit message - Use meaningful commit header, add proper details for all fixes.
- Fix debug print inzynq_qspi_xferdrivers/spi/zynq_qspi.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)drivers/spi/zynq_qspi.c +0
-1@@ -430,7 +430,6 @@ static int zynq_qspi_start_transfer(struct zynq_qspi_priv *priv)zynq_qspi_fill_tx_fifo (priv, priv->fifo_depth);writel (ZYNQ_QSPI_IXR_ALL_MASK , ®s->ier); -/* Start the transfer by enabling manual start bit */ /* wait for completion */ do {@@ -516,7 +515,7 @@ static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen, priv->rx_buf = din; priv->len = bitlen /8 ;
Quoted 8 lines
drivers/spi/zynq_qspi.c static int zynq_qspi_xfer(struct udevice *dev, unsigned int bitlen, · line 521
Quoted 5 lines
drivers/spi/zynq_qspi.c +1
-1-debug ("spi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , +debug ("zynq_qspi_xfer: bus:%i cs:%i bitlen:%i len:%i flags:%lx\n" , bus->seq, slave_plat->cs, bitlen, priv->len, flags);/* I'm not poking the code regularly myself so, ok, sure. But why not
__func__? I don't get it.
I prefer __func__ for large function name and function being called less times and in case zynq_qspi_xfer I would go directly use function name as it being called for each transaction and function name is also small. It's not the case with remaining once.
Signature · 1 line
Jagan | openedev.