From patchwork Fri Mar 19 08:58:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 12150421 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=-14.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 61804C433DB for ; Fri, 19 Mar 2021 08:59:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2E09C64F6B for ; Fri, 19 Mar 2021 08:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229880AbhCSI7O (ORCPT ); Fri, 19 Mar 2021 04:59:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40358 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbhCSI6q (ORCPT ); Fri, 19 Mar 2021 04:58:46 -0400 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 749DEC06174A for ; Fri, 19 Mar 2021 01:58:45 -0700 (PDT) Received: by mail-wr1-x433.google.com with SMTP id j18so8306007wra.2 for ; Fri, 19 Mar 2021 01:58:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=Ct6qr2O+gEmr0BPrtT8sM3etvwJoh/tDIBFVht/3fUE=; b=LP/PpIzF61EzrGOEej30H9csdVwrWwb0j5QEVDX5JyNcU5dzRo0OHwJcau7ZhGKGg7 Z1M2d1x9mqYhnwjXXuwLspReWvFxyIn480RQ2q8jXlpnQ+Xivc5oj3bNaH1gjSsMPHSM tzWS5IlskE/9R0Bd2JWZMzXvwAdP/b/kY+FUFo5qIxUKwSYgbSayG5M9RJaa544qyOgV xFYglGh8cBiLchaHGQpjf8MektsxAjeEdw16sdkUJX0UVybhMteDGaqa76OqUxwGnRQ0 pNJv+xYJMq8DSQ56Yq6vrTq4v7YA86DMizwO+M/pZeEwnwYrI1xOyHjwQB03+XbTLEUj oY2g== 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:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=Ct6qr2O+gEmr0BPrtT8sM3etvwJoh/tDIBFVht/3fUE=; b=XPoxh8/u7j0rnca7uIo2LDuBnbBKxJyAEV0+v5/6pPsiByv5nAZO22tL7m1B5Ej/+v PC4r4ECXl3RJii4ZfeS7BUwX8P+UX/dFw7Kj9TR2rcJSbGsFKghWvJbS99KyY57Ni1/V COzm29S6irWLdmEIePOI11AkX9CUDGyLDMwioKhZYtiqutNK8kEmbGm8EppfZpoleUH5 /mldP6jfiFO6mdYQZCdNUfkGsH0RW3fHWIJdYJHlVnnWw93Mo9srmCLxU1e/v7OsqyDh dBlBkh+3oeQxRPMJ/8HXYrgRtnhfZVsVKfVdipiuL8gLxvZhPf2e7Vft2QMpTTDqmxKx RicA== X-Gm-Message-State: AOAM530LWPZKx27Zwurc72BY8UmHsXPfehULLCu42kj+5v5Re/H2uso8 pGL3Hp4LbmjFVD0nLp1X9oFGe2+FxeUkvw== X-Google-Smtp-Source: ABdhPJyQORxRRrm36y7We7sWnRyYUZNmya41/ZBnQSZ5T9XqDxeyCxsDV+gs42Tku5g/4kJN4WHqdQ== X-Received: by 2002:a5d:6cd2:: with SMTP id c18mr3407488wrc.330.1616144323908; Fri, 19 Mar 2021 01:58:43 -0700 (PDT) Received: from ?IPv6:2003:ea:8f1f:bb00:fd2c:a424:dc3d:ffa1? (p200300ea8f1fbb00fd2ca424dc3dffa1.dip0.t-ipconnect.de. [2003:ea:8f1f:bb00:fd2c:a424:dc3d:ffa1]) by smtp.googlemail.com with ESMTPSA id w11sm6950188wrv.88.2021.03.19.01.58.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 19 Mar 2021 01:58:43 -0700 (PDT) From: Heiner Kallweit To: Jakub Kicinski , David Miller , Realtek linux nic maintainers Cc: "netdev@vger.kernel.org" Subject: [PATCH net-next] r8169: use lower_32_bits/upper_32_bits macros Message-ID: <9a7cfc5a-c4e2-f2a9-e256-856d0a69e4de@gmail.com> Date: Fri, 19 Mar 2021 09:58:36 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Use the lower_32_bits/upper_32_bits macros to simplify the code. Signed-off-by: Heiner Kallweit --- drivers/net/ethernet/realtek/r8169_main.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c index 7aad0ba53..8ea6ddc7d 100644 --- a/drivers/net/ethernet/realtek/r8169_main.c +++ b/drivers/net/ethernet/realtek/r8169_main.c @@ -1586,12 +1586,10 @@ DECLARE_RTL_COND(rtl_counters_cond) static void rtl8169_do_counters(struct rtl8169_private *tp, u32 counter_cmd) { - dma_addr_t paddr = tp->counters_phys_addr; - u32 cmd; + u32 cmd = lower_32_bits(tp->counters_phys_addr); - RTL_W32(tp, CounterAddrHigh, (u64)paddr >> 32); + RTL_W32(tp, CounterAddrHigh, upper_32_bits(tp->counters_phys_addr)); rtl_pci_commit(tp); - cmd = (u64)paddr & DMA_BIT_MASK(32); RTL_W32(tp, CounterAddrLow, cmd); RTL_W32(tp, CounterAddrLow, cmd | counter_cmd);