From mboxrd@z Thu Jan 1 00:00:00 1970 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 C0165C54E41 for ; Mon, 4 Mar 2024 08:42:17 +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:In-Reply-To:From:References:CC:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=QtKW+9rGy7+asZdb9IzNkUn/PXa3nnpSraX9++5fS04=; b=uhRIaa1KNTnzHX K4xQeWqSQCXcaC1PLJhm6bFnZuC5ga6ahHjiuPMhIt+/YxuocszMi/HZ9v5gVHtbJ04TWr81rY10I Kfv7rVde0xJl5U30rqF1aRcG8CcRfByzMfia88qkAsOKBXpq3IuRJdhg47V7CdMtLadWRMFd31R65 /o6xNHyyTMtiZPnT5RHdBS+VcFCjuOMKxTCJ9Z32w1N4txJqMe2A1paGWD9rg3a0swlu5/B/RsAyi ToyOMi5i7HB2pU9tn24Hfyn7QWUXg2WGkB49RlDFvCsTAHEcMucYvDaqc0myR6NTuOBzkR3bdXOdr VmL8pp8NjaqOpweAVeTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh3tf-00000008AzO-1Ad3; Mon, 04 Mar 2024 08:42:07 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rh3tc-00000008AyM-15cQ for linux-arm-kernel@lists.infradead.org; Mon, 04 Mar 2024 08:42:06 +0000 Received: from pps.filterd (m0288072.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4247gAFC026675; Mon, 4 Mar 2024 09:41:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= selector1; bh=bJnRc0D0H74QihxsMJduhmW8GQyOwkO9RFjU12y0p4M=; b=m4 1JRwtTlXG3PcefLldIGEl77X0tUzuX+IDQXBAmHPBC+tOYP8w+XPQ9oqzVVDSJ8p dG9F5BbzPgdp6eHuOSyBrgE3B9oIFZA8U5rdki+EXke2aT4mQyO0sXWsUVt5bXFA 3+dO8XJm8hfWyt1RSiRnQHT1angHmSEvKMivYax6ZkCoeHnWxSFAFjjtvH/a3WM4 /RFWp74L8NlLfmaFny43+2JvSpVzbB2HVogeui34sDQhYfT95ZMLKZ1MC4KqyuYO EB++E08T+M3PlmY8fjXumYfQd0qtjfj/Du80U34MqRTLapNdflV0p6DblR6KSDWa smqORLvSC+TfwCrRRMnA== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3wktdkxss1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 04 Mar 2024 09:41:56 +0100 (CET) Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 7E2584002D; Mon, 4 Mar 2024 09:41:51 +0100 (CET) Received: from Webmail-eu.st.com (shfdag1node2.st.com [10.75.129.70]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id C3E60255E46; Mon, 4 Mar 2024 09:41:16 +0100 (CET) Received: from [10.252.5.201] (10.252.5.201) by SHFDAG1NODE2.st.com (10.75.129.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 4 Mar 2024 09:41:15 +0100 Message-ID: <562cdbfe-9353-4f5d-a804-34e158a190a7@foss.st.com> Date: Mon, 4 Mar 2024 09:41:14 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5] counter: Introduce the COUNTER_COMP_FREQUENCY() macro To: William Breathitt Gray CC: , , , , , , , References: <20240301102505.591918-1-fabrice.gasnier@foss.st.com> Content-Language: en-US From: Fabrice Gasnier In-Reply-To: X-Originating-IP: [10.252.5.201] X-ClientProxiedBy: EQNCAS1NODE4.st.com (10.75.129.82) To SHFDAG1NODE2.st.com (10.75.129.70) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-03-04_04,2024-03-01_03,2023-05-22_02 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240304_004204_938203_4B664621 X-CRM114-Status: GOOD ( 16.97 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 3/1/24 16:55, William Breathitt Gray wrote: > On Fri, Mar 01, 2024 at 11:25:05AM +0100, Fabrice Gasnier wrote: >> Now that there are two users for the "frequency" extension, introduce a >> new COUNTER_COMP_FREQUENCY() macro. >> This extension is intended to be a read-only signal attribute. >> >> Suggested-by: William Breathitt Gray >> Signed-off-by: Fabrice Gasnier >> --- >> Changes in v5 >> - "frequency" extension is read-only, so there's no need to provide >> a write parameter. >> - patch sent separately from "counter: Add stm32 timer events support" [1] >> [1] https://lore.kernel.org/lkml/20240227173803.53906-2-fabrice.gasnier@foss.st.com/ >> --- >> include/linux/counter.h | 7 +++++++ >> 1 file changed, 7 insertions(+) >> >> diff --git a/include/linux/counter.h b/include/linux/counter.h >> index 702e9108bbb4..0ac36f815b7d 100644 >> --- a/include/linux/counter.h >> +++ b/include/linux/counter.h >> @@ -602,6 +602,13 @@ struct counter_array { >> #define COUNTER_COMP_FLOOR(_read, _write) \ >> COUNTER_COMP_COUNT_U64("floor", _read, _write) >> >> +#define COUNTER_COMP_FREQUENCY(_read) \ >> +{ \ >> + .type = COUNTER_COMP_U64, \ >> + .name = "frequency", \ >> + .signal_u64_read = (_read), \ >> +} >> + >> #define COUNTER_COMP_POLARITY(_read, _write, _available) \ >> { \ >> .type = COUNTER_COMP_SIGNAL_POLARITY, \ >> -- >> 2.25.1 > > Hi Fabrice, > > Setting the structure members directly works, but why not use > COUNTER_COMP_SIGNAL_U64("frequency", _read, NULL) instead to keep the > code more succinct? Hi William, I originally wrote it this way, but I had a doubt since some macros use the structure members directly. I can update to use COUNTER_COMP_SIGNAL_U64() instead, that will spare few lines. Please let me know what you prefer (I guess your proposal above ?). Best Regards, Thanks, Fabrice > > William Breathitt Gray _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel