From patchwork Wed Jun 19 19:29:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 2751721 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 589B09F8E1 for ; Wed, 19 Jun 2013 19:29:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 39C99204BD for ; Wed, 19 Jun 2013 19:29:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 65C222049B for ; Wed, 19 Jun 2013 19:29:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935119Ab3FST3Y (ORCPT ); Wed, 19 Jun 2013 15:29:24 -0400 Received: from mail-la0-f52.google.com ([209.85.215.52]:47685 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935107Ab3FST3X (ORCPT ); Wed, 19 Jun 2013 15:29:23 -0400 Received: by mail-la0-f52.google.com with SMTP id fo12so4968871lab.11 for ; Wed, 19 Jun 2013 12:29:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=to:subject:cc:from:organization:date:mime-version:content-type :content-transfer-encoding:message-id:x-gm-message-state; bh=8cfRhF6UOEKQOHNRMA0a+REMtL28j+mdgzbAPpABEk8=; b=V/4vRJ8ngdZCB54tcLU31f3EbNN9tEBvcUO5Cq0xW0D8+cuwb6MnvnlpsOvy7ik2jM DaKwSsJu/YvDvf1b7bF3+kECP9OqQhU+mnXfngOPHNVNdsz9brHit+qlxqOqc8SEyEGc 3yWGvSTUaGNDfdaKXrEB8TRRjkvv5tKxJLLQ7JNhwczviBqhWG+mxPSd7q+hViqMU7ye HAF0S84GokzV0RtXejNLkLFNVD1Kfirkn2aYfaieJcJextMQSHh2e7tTHZbNLyC3mWSp b5LwhJqPBBr0BprxzwO7iRS3S+GAHKWwfvgWADhobb4FXDnBPnasqmYnHU0xBZt3ZHHp xPnQ== X-Received: by 10.112.54.161 with SMTP id k1mr3986513lbp.21.1371670161910; Wed, 19 Jun 2013 12:29:21 -0700 (PDT) Received: from wasted.dev.rtsoft.ru (ppp91-76-156-235.pppoe.mtu-net.ru. [91.76.156.235]) by mx.google.com with ESMTPSA id s3sm9410635lbs.14.2013.06.19.12.29.19 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 19 Jun 2013 12:29:20 -0700 (PDT) To: netdev@vger.kernel.org Subject: [PATCH v2 1/2] sh_eth: define/use EESR_RX_CHECK macro Cc: nobuhiro.iwamatsu.yj@renesas.com, linux-sh@vger.kernel.org From: Sergei Shtylyov Organization: Cogent Embedded Date: Wed, 19 Jun 2013 23:29:23 +0400 MIME-Version: 1.0 Message-Id: <201306192329.24022.sergei.shtylyov@cogentembedded.com> X-Gm-Message-State: ALoCoQl5uVUCv08/UPbs3H11uVNt7As8XbCCid2/fIEbgIkjZRt7UPnLfK91XyM0SbcpNtbB3bU1 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- The patch is against the Dave Miller's 'net-next.git' repo. drivers/net/ethernet/renesas/sh_eth.c | 13 ++----------- drivers/net/ethernet/renesas/sh_eth.h | 8 ++++++++ 2 files changed, 10 insertions(+), 11 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net-next/drivers/net/ethernet/renesas/sh_eth.c =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.c +++ net-next/drivers/net/ethernet/renesas/sh_eth.c @@ -1497,23 +1497,14 @@ static irqreturn_t sh_eth_interrupt(int */ 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: net-next/drivers/net/ethernet/renesas/sh_eth.h =================================================================== --- net-next.orig/drivers/net/ethernet/renesas/sh_eth.h +++ net-next/drivers/net/ethernet/renesas/sh_eth.h @@ -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 | \