sh_eth: define/use EESR_RX_CHECK macro
authorSergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Wed, 19 Jun 2013 19:29:23 +0000 (23:29 +0400)
committerDavid S. Miller <davem@davemloft.net>
Thu, 20 Jun 2013 00:01:39 +0000 (17:01 -0700)
sh_eth_interrupt() uses the same Rx interrupt mask twice to check the interrupt
status register -- #define EESR_RX_CHECK  and use it instead.

Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/sh_eth.c
drivers/net/ethernet/renesas/sh_eth.h

index 8cb600ccaf1daece1297fe5664aa8ccf64b7e6fd..cd5987ecee4b1267878dcdc593439c0ba047e747 100644 (file)
@@ -1504,23 +1504,14 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
         */
        intr_status &= sh_eth_read(ndev, EESIPR) | DMAC_M_ECI;
        /* Clear interrupt */
-       if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
-                       EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
-                       cd->tx_check | cd->eesr_err_check)) {
+       if (intr_status & (EESR_RX_CHECK | cd->tx_check | cd->eesr_err_check)) {
                sh_eth_write(ndev, intr_status, EESR);
                ret = IRQ_HANDLED;
        } else
                goto other_irq;
 
-       if (intr_status & (EESR_FRC | /* Frame recv*/
-                       EESR_RMAF | /* Multi cast address recv*/
-                       EESR_RRF  | /* Bit frame recv */
-                       EESR_RTLF | /* Long frame recv*/
-                       EESR_RTSF | /* short frame recv */
-                       EESR_PRE  | /* PHY-LSI recv error */
-                       EESR_CERF)){ /* recv frame CRC error */
+       if (intr_status & EESR_RX_CHECK)
                sh_eth_rx(ndev, intr_status);
-       }
 
        /* Tx Check */
        if (intr_status & cd->tx_check) {
index 729e77e66f19c03850f8054712458801623dcdda..d05b60b826eb03aa3a51d6ecd78501bcf6796107 100644 (file)
@@ -248,6 +248,14 @@ enum EESR_BIT {
        EESR_CERF       = 0x00000001,
 };
 
+#define EESR_RX_CHECK          (EESR_FRC  | /* Frame recv */           \
+                                EESR_RMAF | /* Multicast address recv */ \
+                                EESR_RRF  | /* Bit frame recv */       \
+                                EESR_RTLF | /* Long frame recv */      \
+                                EESR_RTSF | /* Short frame recv */     \
+                                EESR_PRE  | /* PHY-LSI recv error */   \
+                                EESR_CERF)  /* Recv frame CRC error */
+
 #define DEFAULT_TX_CHECK       (EESR_FTC | EESR_CND | EESR_DLC | EESR_CD | \
                                 EESR_RTO)
 #define DEFAULT_EESR_ERR_CHECK (EESR_TWB | EESR_TABT | EESR_RABT | \