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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 08224ECAAA1 for ; Tue, 30 Aug 2022 07:47:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229750AbiH3HrD (ORCPT ); Tue, 30 Aug 2022 03:47:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46706 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229956AbiH3HrC (ORCPT ); Tue, 30 Aug 2022 03:47:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 268977FFA1 for ; Tue, 30 Aug 2022 00:47:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B4108614D1 for ; Tue, 30 Aug 2022 07:47:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E67D6C433C1; Tue, 30 Aug 2022 07:46:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1661845620; bh=jNJcCiEVrx4RDwhr8ThMHWXXkwAN+LdWh9IhEa2aldk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=a4cZ//8ae4t2/3QEe4Y+QD7Zxl42hOSkJNhXgxYFJpz+Mhv8aOS71WD6p216JOvSp nR5Quwp3EJwfcF/z8ml7DxSDI+R5UvKevHb/SLs/NMe/HrRVL19aINynmjXkbXgww8 kAVEpH6+o8SEzFfO3bbYtcijw0WY8Ee1ei+x8k8dL/tb91hJjmoJVY4cHv34j3G9FJ mjemPDAzHFPsU5vfeIV/thjzf+zLepPvvp+Q4KsxnNrpQXP8X+yOsm9fW0tqYgilRr eMZyjmrDVtuOik1Hdi87t+24zo1+9Ql9sfIPHHe3j9dHAu1FU/9Ze9eThqVB3mTgwb rsaClZtuxxLyQ== Date: Tue, 30 Aug 2022 13:16:47 +0530 From: Manivannan Sadhasivam To: Jeff Johnson Cc: Manivannan Sadhasivam , Hemant Kumar , linux-arm-msm@vger.kernel.org, mhi@lists.linux.dev Subject: Re: [PATCH v4] bus: mhi: host: make mhi_controller_config::event_cfg const Message-ID: <20220830074647.GA135982@thinkpad> References: <20220819210230.17773-1-quic_jjohnson@quicinc.com> <20220829205112.12036-1-quic_jjohnson@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220829205112.12036-1-quic_jjohnson@quicinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Mon, Aug 29, 2022 at 01:51:12PM -0700, Jeff Johnson wrote: > Currently the event_cfg pointer in struct mhi_controller_config is not > defined as a const pointer. This prevents clients from registering a > read-only configuration unless they use a typecast. Since the > event_cfg should not be modified once registered, add the const > qualifier to event_cfg. This is aligned with the definition of ch_cfg. > > Signed-off-by: Jeff Johnson > --- > v4: updated subject, rebased to v6.0-rc3 > > v3: added pci_generic.c change > > v2: added S-O-B > > drivers/bus/mhi/host/pci_generic.c | 14 +++++++------- > include/linux/mhi.h | 2 +- > 2 files changed, 8 insertions(+), 8 deletions(-) > > diff --git a/drivers/bus/mhi/host/pci_generic.c b/drivers/bus/mhi/host/pci_generic.c > index 9e545f2a5a26..8db63543ce8f 100644 > --- a/drivers/bus/mhi/host/pci_generic.c > +++ b/drivers/bus/mhi/host/pci_generic.c > @@ -238,7 +238,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3), > }; > > -static struct mhi_event_config modem_qcom_v1_mhi_events[] = { > +static const struct mhi_event_config modem_qcom_v1_mhi_events[] = { > /* first ring is control+data ring */ > MHI_EVENT_CONFIG_CTRL(0, 64), > /* DIAG dedicated event ring */ > @@ -305,7 +305,7 @@ static const struct mhi_channel_config mhi_quectel_em1xx_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3), > }; > > -static struct mhi_event_config mhi_quectel_em1xx_events[] = { > +static const struct mhi_event_config mhi_quectel_em1xx_events[] = { > MHI_EVENT_CONFIG_CTRL(0, 128), > MHI_EVENT_CONFIG_DATA(1, 128), > MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100), > @@ -344,7 +344,7 @@ static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3), > }; > > -static struct mhi_event_config mhi_foxconn_sdx55_events[] = { > +static struct const mhi_event_config mhi_foxconn_sdx55_events[] = { You still haven't fixed this... Thanks, Mani > MHI_EVENT_CONFIG_CTRL(0, 128), > MHI_EVENT_CONFIG_DATA(1, 128), > MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100), > @@ -391,7 +391,7 @@ static const struct mhi_channel_config mhi_mv3x_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 512, 3), > }; > > -static struct mhi_event_config mhi_mv3x_events[] = { > +static const struct mhi_event_config mhi_mv3x_events[] = { > MHI_EVENT_CONFIG_CTRL(0, 256), > MHI_EVENT_CONFIG_DATA(1, 256), > MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100), > @@ -438,7 +438,7 @@ static const struct mhi_channel_config mhi_sierra_em919x_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 512, 2), > }; > > -static struct mhi_event_config modem_sierra_em919x_mhi_events[] = { > +static const struct mhi_event_config modem_sierra_em919x_mhi_events[] = { > /* first ring is control+data and DIAG ring */ > MHI_EVENT_CONFIG_CTRL(0, 2048), > /* Hardware channels request dedicated hardware event rings */ > @@ -472,7 +472,7 @@ static const struct mhi_channel_config mhi_telit_fn980_hw_v1_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 2), > }; > > -static struct mhi_event_config mhi_telit_fn980_hw_v1_events[] = { > +static const struct mhi_event_config mhi_telit_fn980_hw_v1_events[] = { > MHI_EVENT_CONFIG_CTRL(0, 128), > MHI_EVENT_CONFIG_HW_DATA(1, 1024, 100), > MHI_EVENT_CONFIG_HW_DATA(2, 2048, 101) > @@ -511,7 +511,7 @@ static const struct mhi_channel_config mhi_telit_fn990_channels[] = { > MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3), > }; > > -static struct mhi_event_config mhi_telit_fn990_events[] = { > +static const struct mhi_event_config mhi_telit_fn990_events[] = { > MHI_EVENT_CONFIG_CTRL(0, 128), > MHI_EVENT_CONFIG_DATA(1, 128), > MHI_EVENT_CONFIG_HW_DATA(2, 1024, 100), > diff --git a/include/linux/mhi.h b/include/linux/mhi.h > index a5441ad33c74..ada2f18af4d6 100644 > --- a/include/linux/mhi.h > +++ b/include/linux/mhi.h > @@ -281,7 +281,7 @@ struct mhi_controller_config { > u32 num_channels; > const struct mhi_channel_config *ch_cfg; > u32 num_events; > - struct mhi_event_config *event_cfg; > + const struct mhi_event_config *event_cfg; > bool use_bounce_buf; > bool m2_no_db; > }; > -- > 2.37.0 > > -- மணிவண்ணன் சதாசிவம்