In an effort to make the PS3 gelic driver easier to maintain, change the
gelic_card_enable_rxdmac routine to use the optimizer to remove
debug code.

Signed-off-by: Geoff Levand <ge...@infradead.org>
---
 drivers/net/ethernet/toshiba/ps3_gelic_net.c | 19 +++++++++----------
 1 file changed, 9 insertions(+), 10 deletions(-)

diff --git a/drivers/net/ethernet/toshiba/ps3_gelic_net.c 
b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
index 54e50ad9e629..85fc1915c8be 100644
--- a/drivers/net/ethernet/toshiba/ps3_gelic_net.c
+++ b/drivers/net/ethernet/toshiba/ps3_gelic_net.c
@@ -162,17 +162,16 @@ static void gelic_card_enable_rxdmac(struct gelic_card 
*card)
        struct device *dev = ctodev(card);
        int status;
 
-#ifdef DEBUG
-       if (gelic_descr_get_status(card->rx_chain.head) !=
-           GELIC_DESCR_DMA_CARDOWNED) {
-               printk(KERN_ERR "%s: status=%x\n", __func__,
-                      be32_to_cpu(card->rx_chain.head->dmac_cmd_status));
-               printk(KERN_ERR "%s: nextphy=%x\n", __func__,
-                      
be32_to_cpu(card->rx_chain.head->hw_regs.next_descr_addr));
-               printk(KERN_ERR "%s: head=%p\n", __func__,
-                      card->rx_chain.head);
+       if (__is_defined(DEBUG) && (gelic_descr_get_status(card->rx_chain.head)
+                       != GELIC_DESCR_DMA_CARDOWNED)) {
+               dev_err(dev, "%s:%d: status=%x\n", __func__, __LINE__,
+                       
be32_to_cpu(card->rx_chain.head->hw_regs.dmac_cmd_status));
+               dev_err(dev, "%s:%d: nextphy=%x\n", __func__, __LINE__,
+                       
be32_to_cpu(card->rx_chain.head->hw_regs.next_descr_addr));
+               dev_err(dev, "%s:%d: head=%px\n", __func__, __LINE__,
+                       card->rx_chain.head);
        }
-#endif
+
        status = lv1_net_start_rx_dma(bus_id(card), dev_id(card),
                card->rx_chain.head->link.cpu_addr, 0);
 
-- 
2.25.1


Reply via email to