From patchwork Fri Mar 5 17:02:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis Efremov (Oracle)" X-Patchwork-Id: 12118589 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A46C7C4332D for ; Fri, 5 Mar 2021 15:05:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A3A365013 for ; Fri, 5 Mar 2021 15:05:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbhCEPFD (ORCPT ); Fri, 5 Mar 2021 10:05:03 -0500 Received: from mail-lf1-f42.google.com ([209.85.167.42]:45440 "EHLO mail-lf1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230052AbhCEPE5 (ORCPT ); Fri, 5 Mar 2021 10:04:57 -0500 Received: by mail-lf1-f42.google.com with SMTP id k9so4084869lfo.12; Fri, 05 Mar 2021 07:04:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FxXT3yR6v7qc7jItpADfb+0ke++RwOmzj7MngvZr5H0=; b=Wa3cT24mzVV/z1aC9S8Lmgg1h8Cnw1lDhtHGoNYGrmFEkTIysg1zLKPD90Un74Y1Nx MYJpyIjrhKhACy6jSDBM7eyPmB5TbOxOmxgAJV9qJPthT3eo80C4B6mtLuR1gn5ohdSz 9ZIoyTltQOxGTV8Wp/+zp+wggoSgIoO1aBUpvjk12Sm/flQZahya9LMvmzdhW6gjng9j l2NtqyGsvxgX9G2Qy0NZiaYFBuQXZWkftWFAdLNvKNLDemm7HEHxqD2QPV70qbfSvQvu k7qCF8+Ih7NvbkinNuca+goe71MxS5WigfJA87rRLs2AMMlAJ8rx1XCBQnuvSDvGRK73 YTpw== X-Gm-Message-State: AOAM532YMBtSjmZJYY6oeU86qmksWJg7mVURD44Cjs8yLaGhSb+oH9VH tlDvsJ1DiEJjW4OE3Gy7GbU= X-Google-Smtp-Source: ABdhPJxRyfHpDbCj9qZT15SJ39uV3oF8q5NUtgIH64IzW3fW+0ck5pg1xjdiX43XIaQLNW1ttGLwIw== X-Received: by 2002:a05:6512:b18:: with SMTP id w24mr5707094lfu.212.1614956695685; Fri, 05 Mar 2021 07:04:55 -0800 (PST) Received: from localhost.. (broadband-188-32-236-56.ip.moscow.rt.ru. [188.32.236.56]) by smtp.googlemail.com with ESMTPSA id q26sm351475ljg.90.2021.03.05.07.04.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 07:04:55 -0800 (PST) From: Denis Efremov To: "David S. Miller" Cc: Denis Efremov , Jakub Kicinski , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] sun/niu: fix wrong RXMAC_BC_FRM_CNT_COUNT count Date: Fri, 5 Mar 2021 20:02:12 +0300 Message-Id: <20210305170212.146135-1-efremov@linux.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org RXMAC_BC_FRM_CNT_COUNT added to mp->rx_bcasts twice in a row in niu_xmac_interrupt(). Remove the second addition. Signed-off-by: Denis Efremov --- I don't know the code of the dirver, but this looks like a real bug. Otherwise, it's more readable as: mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT * 2; drivers/net/ethernet/sun/niu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index 68695d4afacd..707ccdd03b19 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c @@ -3931,8 +3931,6 @@ static void niu_xmac_interrupt(struct niu *np) mp->rx_mcasts += RXMAC_MC_FRM_CNT_COUNT; if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP) mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT; - if (val & XRXMAC_STATUS_RXBCAST_CNT_EXP) - mp->rx_bcasts += RXMAC_BC_FRM_CNT_COUNT; if (val & XRXMAC_STATUS_RXHIST1_CNT_EXP) mp->rx_hist_cnt1 += RXMAC_HIST_CNT1_COUNT; if (val & XRXMAC_STATUS_RXHIST2_CNT_EXP)