From patchwork Thu Aug 24 18:32:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Halaney X-Patchwork-Id: 13364563 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 7920DC3DA6F for ; Thu, 24 Aug 2023 18:33:32 +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:MIME-Version:Message-Id:Date: Subject:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=pPRAHw5u24TSlA2jTxFD43st19l4O51luIVRNFCcI6U=; b=H4Tg0+iSEKnQWG +jZ4iqsi0LnyYB3UUozXwhAgMmS53qpoDV6ZwBigcBter7oq6lHzdqloJkhSVnUqlS8TBGIXS4EcT 9RUEeEZNjiogL02C9Wk6VaxI1lOom0dXIzQHXfQMnW79uFCI6c4xC9KsFnfvgj/lK94CdRioPDlai t06ykKxQNdo7N5zr7uypl7IWFUAP/MlSIbEiJLG+MTybJVZJ1/U8zb+z1ANKwo9VWtVh/8G0Zyrsx ESJUEcXYnIEbxeKaorFlbGTxLEKCOqd/ydMz0eoX5uhJAooj5WQUVpbG0JbzQ9+lN6dp3LhW1ERAU s6naZbOIsxqMB4aJh6+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qZF8j-003azc-2Y; Thu, 24 Aug 2023 18:33:05 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qZF8g-003ayF-3B for linux-arm-kernel@lists.infradead.org; Thu, 24 Aug 2023 18:33:04 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692901979; 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; bh=MENyLQ2N3cu7YkwE8woYh2Uz3htsa5ND2UWg2HZ3684=; b=QDXGl6VPv7eBYfdwpI0fabcutcVI1/68GGUxOfThn0l4pwe0YRXiiwOLqCsgpUW6Q3H1Jq LospK8jSkiYOVo/Y4pNx/kXmbzsKGATFGWPU3QsGN2zmmOYYoqHyXn7pJn+di1NQJxCzpQ c1vbZ8JiDDs+9pSbdUZ5usmVhhENILs= Received: from mail-ua1-f70.google.com (mail-ua1-f70.google.com [209.85.222.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-413-mvQwk0hxOM6hQDX2QFLqmg-1; Thu, 24 Aug 2023 14:32:58 -0400 X-MC-Unique: mvQwk0hxOM6hQDX2QFLqmg-1 Received: by mail-ua1-f70.google.com with SMTP id a1e0cc1a2514c-79d95342942so44009241.2 for ; Thu, 24 Aug 2023 11:32:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692901977; x=1693506777; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MENyLQ2N3cu7YkwE8woYh2Uz3htsa5ND2UWg2HZ3684=; b=fSp++8KcxEdTgHoYBjWmMCYnfUFKuwgDUzKe+h85FdgfMV9WEZw4QlVwnlV/L6hjTU 5olP02IJhTNlHX+93i+CYQp2g/ticqWDmw0TvJOL122ofOtKLmRznWgh8FoThWlLzpB1 0t9IfHBu1lghreLRVS3YVhehdgJItEA0o2HH2O2qXsejCuPZIxMB0QuCA6Unua134Ca0 dNQEi+inCoZ7LBjPbJi1V+58Lg4z6hr0Wc8Bm91tJ42iBlDKoLG+95g49uaVj2OIKqT5 GCaYW7UqG591gn5cUZ+vgpc5WjQGpuT5pjYDLT7z8ECCQ6p0Vw7lvFMitLCC/9G2IEET 9IjQ== X-Gm-Message-State: AOJu0YxJ+BOdC5DCZatp6Sr/YvKR6GeHw/CyMYmhoUcFfFqt98fiGMVf 1iM2UJCYo09nYlv85zRTcbrglC8QCvuNe6zxEXLV87SdyKECCivY74E7n54mSPfIRcC7EcnY+B1 otNELtWmcLU5aQHFRtoO6WzzSXNSLhw9aRkI= X-Received: by 2002:a67:e403:0:b0:44e:8874:585a with SMTP id d3-20020a67e403000000b0044e8874585amr4528627vsf.27.1692901977630; Thu, 24 Aug 2023 11:32:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEgMO96NWiKDcYXf5IRr9AXBP8x7ijYPK4xRhHHkKJy0v9wR6V9lgxekYM8Ssryo0WjBBvQqQ== X-Received: by 2002:a67:e403:0:b0:44e:8874:585a with SMTP id d3-20020a67e403000000b0044e8874585amr4528610vsf.27.1692901977351; Thu, 24 Aug 2023 11:32:57 -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.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Aug 2023 11:32:56 -0700 (PDT) From: Andrew Halaney Subject: [PATCH net-next 0/7] net: stmmac: Improve default addend/subsecond increment readability Date: Thu, 24 Aug 2023 13:32:51 -0500 Message-Id: <20230824-stmmac-subsecond-inc-cleanup-v1-0-e0b9f7c18b37@redhat.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAFOi52QC/x3MwQ6CMAwA0F8hPdtkbororxgPoyvaRApZByEh/ LuLx3d5OxhnYYNHs0PmVUwmrTifGqBP1DejpGrwzgfX+QtaGcdIaEtvTJMmFCWkL0ddZgzuGu4 3ail2CWoxZx5k+/dPUC6ovBV4HccPlXRkO3gAAAA= 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_111582_E4CC354A X-CRM114-Status: UNSURE ( 9.96 ) X-CRM114-Notice: Please train this message. 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 This series aims to improve the readability of the calculations for the default addend and subsecond increment values. I recently had to understand what the hardware did by reading this code, and it took me longer than I care to admit. These patches aim to make it more self explanatory. Suggestions to further improve this are very welcomed. Signed-off-by: Andrew Halaney --- Andrew Halaney (7): net: stmmac: Use consistent variable name for subsecond increment net: stmmac: Use NSEC_PER_SEC for hwtstamp calculations net: stmmac: Precede entire addend calculation with its comment net: stmmac: Remove a pointless cast net: stmmac: Correct addend typo net: stmmac: Fix comment about default addend calculation net: stmmac: Make PTP reference clock references more clear drivers/net/ethernet/stmicro/stmmac/hwif.h | 5 +++-- .../net/ethernet/stmicro/stmmac/stmmac_hwtstamp.c | 14 +++++++------- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 22 ++++++++++++---------- 3 files changed, 22 insertions(+), 19 deletions(-) --- base-commit: 9f6708a668186dc5b38532fc1d1ff2f5311722d6 change-id: 20230824-stmmac-subsecond-inc-cleanup-305397c6ca8d Best regards,