Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5109878pxj; Wed, 9 Jun 2021 09:20:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzGaTZn7g61IDnNnW7+wfyMn8sWYAYeF5+MZ9TjBqRAl4ecRXRGSyaCudOQ9/PKo/UxD3Pm X-Received: by 2002:a17:907:1b19:: with SMTP id mp25mr686403ejc.442.1623255609365; Wed, 09 Jun 2021 09:20:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623255609; cv=none; d=google.com; s=arc-20160816; b=f1sHObnlZss0b7fTPYVEf+SQMhKdISLgfa7Ik1Hud6GoBJx8Gkl/UUIfc8bmuViDXR MBIO9rH8CGx2rMTgTt6wHENwjOqaIZh0jMA/4kBs2rw5mksfCAl9/1+ErW3uLAGjENzp VF8ScVbWrCDFRMXcKuPVZ9pT+rp6WvQnbxZzN62IGbaoKI0BJqD16T2VLzVNkaAc9BF+ +bz6v+Bh+o48YazGQP8j/WBs/WUvL0dqt2bkmQngvIP/8Rhm7mdRYRX2TbmAsRPD7sKJ 9uGEoDYrE9ppAZH5MTaN+uOEq1izlh3xAwY9IGiaUsFeBlSvPNWeQZ7p667KHKPqT1lF ROpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=36/hMPy6ViRTwukCom3ijNPw5ofiLpNcy8cLzcEpB14=; b=ijqXXkMggLVOoImytjoSWSJ/3RlCostlFFGY2MUFdK6pgIYWrpN0GRq02G+aQkDSg/ XjVuetn3l64yOgyZxynkKv1X+kN4MzMvtu2kRHbtDiEpv423/LbRwfi4LCpYKUM5c2Dw 9JSDhlkClYN6HMxqveddgzRxiuIjuFwl8qtgaq+MQJSrSRJhU8nH1GxdNNWsrSF9fXhY tcXHR95ZlC8awX8yiT0mTV2cCJKMz47AzpcX9W4mtktYxEMkfq84LyIi20n5pMCX78zn lI2ETdpeXs7NV5VM9cVE0SbWwmeU2MJRE1Q/cH5oA/XxM4JYROx3aVNV0N91xUXQXCR6 z1tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 12si199619ejh.440.2021.06.09.09.19.45; Wed, 09 Jun 2021 09:20:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233624AbhFIPZt (ORCPT + 99 others); Wed, 9 Jun 2021 11:25:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:51400 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235847AbhFIPZq (ORCPT ); Wed, 9 Jun 2021 11:25:46 -0400 Received: from jic23-huawei (cpc108967-cmbg20-2-0-cust86.5-4.cable.virginm.net [81.101.6.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AB5D06100A; Wed, 9 Jun 2021 15:23:46 +0000 (UTC) Date: Wed, 9 Jun 2021 16:25:39 +0100 From: Jonathan Cameron To: William Breathitt Gray Cc: linux-stm32@st-md-mailman.stormreply.com, kernel@pengutronix.de, a.fatoum@pengutronix.de, kamel.bouhara@bootlin.com, gwendal@chromium.org, alexandre.belloni@bootlin.com, david@lechnology.com, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, syednwaris@gmail.com, patrick.havelange@essensium.com, fabrice.gasnier@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, o.rempel@pengutronix.de, jarkko.nikula@linux.intel.com, Fabrice Gasnier Subject: Re: [PATCH v11 10/33] counter: stm32-lptimer-cnt: Add const qualifier for functions_list array Message-ID: <20210609162539.33a3ab0e@jic23-huawei> In-Reply-To: <08830119594acdb3bc9d36ae2e65b2eb26589ade.1623201081.git.vilhelm.gray@gmail.com> References: <08830119594acdb3bc9d36ae2e65b2eb26589ade.1623201081.git.vilhelm.gray@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 9 Jun 2021 10:31:13 +0900 William Breathitt Gray wrote: > The struct counter_count functions_list member expects a const enum > counter_count_function array. This patch adds the const qualifier to the > stm32_lptim_cnt_functions to match functions_list. > > Reviewed-by: Fabrice Gasnier > Signed-off-by: William Breathitt Gray Applied. btw a different reasoning for all of these is that static const is read only and will let linker and compiler do various tricks that it can't do otherwise. Jonathan > --- > drivers/counter/stm32-lptimer-cnt.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/counter/stm32-lptimer-cnt.c b/drivers/counter/stm32-lptimer-cnt.c > index 937439635d53..0f7d3f1ec1b6 100644 > --- a/drivers/counter/stm32-lptimer-cnt.c > +++ b/drivers/counter/stm32-lptimer-cnt.c > @@ -134,7 +134,7 @@ enum stm32_lptim_cnt_function { > STM32_LPTIM_ENCODER_BOTH_EDGE, > }; > > -static enum counter_count_function stm32_lptim_cnt_functions[] = { > +static const enum counter_count_function stm32_lptim_cnt_functions[] = { > [STM32_LPTIM_COUNTER_INCREASE] = COUNTER_COUNT_FUNCTION_INCREASE, > [STM32_LPTIM_ENCODER_BOTH_EDGE] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4, > };