From patchwork Thu Aug 24 18:32:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13364565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E72D7C3DA6F for ; Thu, 24 Aug 2023 18:33:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T+STT/xyaAbUNpMVI4etemFYe9LBWZSdmhBADFTBlqI=; b=swmksr9uPE2pLM Rb+43KMXn/psRUBNRWvAYXSl7GKUnNtUiedHR6CLAkosPIYf3vk6RdqzZdj65rRbUg5aeflX3GFNd lMwJWSKYBnqKd9eIbLOc3HvJmKkIEYF8tQWQJracA6pnIV9UzDWY0CeuwZCcFR08PK6bjSFe4s4cp opb5vEm/zp5J2ij3EUshESjOWmtFJLngbCX1s4CIv2JfedRSMJr6NymhpIoMGtL7OSJ2myriThBu7 FRxyaLAFzhEfaHRT5HTrpYva4KMCEcFmLxV2KVbaUSP6hfdKumP0fP5x0Y1b0uJ/5Wjiqi/G7lCoh edQWNkr4sVtaim1GUbgg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZF8r-003b3w-1r; Thu, 24 Aug 2023 18:33:13 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qZF8h-003ayV-2M for linux-arm-kernel@lists.infradead.org; Thu, 24 Aug 2023 18:33:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692901981; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6MSPeUOmvEq1eUUgwQ2syHQsuZQFtArlwfrE4/FiNFk=; b=iFdvdw+ulYEFXeFUvBD5NmjzJiOG7j8bLoYqQ+yt72PR/7bZuCmYWLccWcyAKGgq0u1rPQ EklH2BzrR9993jw/wrV3JXBDDBuZRmTTTS0w1aI7ptFd+rFe0nIC3rMn2JMRXmu63RosP2 HV/CsOPaKGcueJNCJBQF/xxmkKFNPaQ= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-660-mWqLgYNqNymrAytbMI708A-1; Thu, 24 Aug 2023 14:32:59 -0400 X-MC-Unique: mWqLgYNqNymrAytbMI708A-1 Received: by mail-qv1-f71.google.com with SMTP id 6a1803df08f44-64ab5892bbcso2179836d6.0 for ; Thu, 24 Aug 2023 11:32:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692901979; x=1693506779; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6MSPeUOmvEq1eUUgwQ2syHQsuZQFtArlwfrE4/FiNFk=; b=By63nBwHVuNefN3fmUJokyn7Hg6/bTMYX0K4RrygHfJKieB/xCjxibi5SHHvNaT4W7 atRPwKW22OrHfyBy9HuX4GrZxS6kdcpuiv8u2MW+W1gJzZCtUc4Ai5t8ayEPCs+7Yi4J 512c39XIu4VMEAFt70URCCI1HYMI69LLOYKKyzs6YuYtec6jgXQOBu19pB1wiFsKtwTD dtGfg4JWaaWLZtK+/PyWhmtKk96z6qYhaYVXpwzvdD/dQFH42lHBb9+j/9hLB9DjsuGM n64heqlNpe40ZLNTS1rjrkm2YtXm+OGfEqsQ/o/831ELXA+5o2vtt3kEAceDURinGA+Z YZxA== X-Gm-Message-State: AOJu0YwP6UnbrSaZvcKOC2Ops1cL/tsOQ8jkxJ+0vrho7HMBc9Ap/RLk vQcIPeW3Jn/9nw/KqP9XqUysqcg7qVy04DOQ1KGfIcmJ1fQZfu3q6CgaD+w6sruAPVxSEmI137r p8Z0A/OahAFMuwU0cQ9Z7rGvbxQKQ4ExnGBk= X-Received: by 2002:a0c:e246:0:b0:647:2653:bcc with SMTP id x6-20020a0ce246000000b0064726530bccmr18915147qvl.13.1692901978978; Thu, 24 Aug 2023 11:32:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFOnxZtOm4Zbo/1b64keu9y2z8jyW5dWXMkNKbfmN/AXxPf8v016bCHVXCzjBnQUDUxKTav6w== X-Received: by 2002:a0c:e246:0:b0:647:2653:bcc with SMTP id x6-20020a0ce246000000b0064726530bccmr18915120qvl.13.1692901978737; Thu, 24 Aug 2023 11:32:58 -0700 (PDT) Received: from [192.168.1.165] ([2600:1700:1ff0:d0e0::37]) by smtp.gmail.com with ESMTPSA id j17-20020a0ceb11000000b0064f77d37798sm4209qvp.5.2023.08.24.11.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 11:32:58 -0700 (PDT) From: Andrew Halaney Date: Thu, 24 Aug 2023 13:32:52 -0500 Subject: [PATCH net-next 1/7] net: stmmac: Use consistent variable name for subsecond increment MIME-Version: 1.0 Message-Id: <20230824-stmmac-subsecond-inc-cleanup-v1-1-e0b9f7c18b37@redhat.com> References: <20230824-stmmac-subsecond-inc-cleanup-v1-0-e0b9f7c18b37@redhat.com> In-Reply-To: <20230824-stmmac-subsecond-inc-cleanup-v1-0-e0b9f7c18b37@redhat.com> To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Richard Cochran Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Andrew Halaney X-Mailer: b4 0.12.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230824_113303_838327_53536C08 X-CRM114-Status: GOOD ( 14.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Subsecond increment is the name of the field being programmed. Let's stop using a bunch of variations of that name and just use sub_second_inc throughout. Signed-off-by: Andrew Halaney --- drivers/net/ethernet/stmicro/stmmac/hwif.h | 2 +- drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 6 +++--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index 238f17c50a1e..bd607da65037 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -524,7 +524,7 @@ struct stmmac_ops { struct stmmac_hwtimestamp { void (*config_hw_tstamping) (void __iomem *ioaddr, u32 data); void (*config_sub_second_increment)(void __iomem *ioaddr, u32 ptp_clock, - int gmac4, u32 *ssinc); + int gmac4, u32 *sub_second_inc); int (*init_systime) (void __iomem *ioaddr, u32 sec, u32 nsec); int (*config_addend) (void __iomem *ioaddr, u32 addend); int (*adjust_systime) (void __iomem *ioaddr, u32 sec, u32 nsec, diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c index 540f6a4ec0b8..6dcf8582a70e 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c @@ -24,7 +24,7 @@ static void config_hw_tstamping(void __iomem *ioaddr, u32 data) } static void config_sub_second_increment(void __iomem *ioaddr, - u32 ptp_clock, int gmac4, u32 *ssinc) + u32 ptp_clock, int gmac4, u32 *sub_second_inc) { u32 value = readl(ioaddr + PTP_TCR); unsigned long data; @@ -56,8 +56,8 @@ static void config_sub_second_increment(void __iomem *ioaddr, writel(reg_value, ioaddr + PTP_SSIR); - if (ssinc) - *ssinc = data; + if (sub_second_inc) + *sub_second_inc = data; } static void hwtstamp_correct_latency(struct stmmac_priv *priv) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 7a9bbcf03ea5..67e4f65f0f68 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -836,7 +836,7 @@ int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags) { bool xmac = priv->plat->has_gmac4 || priv->plat->has_xgmac; struct timespec64 now; - u32 sec_inc = 0; + u32 sub_second_inc = 0; u64 temp = 0; if (!(priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) @@ -848,16 +848,16 @@ int stmmac_init_tstamp_counter(struct stmmac_priv *priv, u32 systime_flags) /* program Sub Second Increment reg */ stmmac_config_sub_second_increment(priv, priv->ptpaddr, priv->plat->clk_ptp_rate, - xmac, &sec_inc); - temp = div_u64(1000000000ULL, sec_inc); + xmac, &sub_second_inc); + temp = div_u64(1000000000ULL, sub_second_inc); /* Store sub second increment for later use */ - priv->sub_second_inc = sec_inc; + priv->sub_second_inc = sub_second_inc; /* calculate default added value: * formula is : * addend = (2^32)/freq_div_ratio; - * where, freq_div_ratio = 1e9ns/sec_inc + * where, freq_div_ratio = 1e9ns/sub_second_inc */ temp = (u64)(temp << 32); priv->default_addend = div_u64(temp, priv->plat->clk_ptp_rate);