mhi.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mhi: make mhi_controller_config::event_cfg const
@ 2022-08-19 19:37 Jeff Johnson
  2022-08-19 20:57 ` Jeff Johnson
  0 siblings, 1 reply; 2+ messages in thread
From: Jeff Johnson @ 2022-08-19 19:37 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Hemant Kumar; +Cc: linux-arm-msm, mhi, Jeff Johnson

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 <quic_jjohnson@quicinc.com>
---
 include/linux/mhi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] mhi: make mhi_controller_config::event_cfg const
  2022-08-19 19:37 [PATCH v2] mhi: make mhi_controller_config::event_cfg const Jeff Johnson
@ 2022-08-19 20:57 ` Jeff Johnson
  0 siblings, 0 replies; 2+ messages in thread
From: Jeff Johnson @ 2022-08-19 20:57 UTC (permalink / raw)
  To: Manivannan Sadhasivam, Hemant Kumar; +Cc: linux-arm-msm, mhi

On 8/19/2022 12:37 PM, 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.

i'm spinning a v3

I was originally going to have changes to 
drivers/bus/mhi/host/pci_generic.c in a separate patch, but instead 
decided to squash them.

There will be a separate patch for wifi: ath11k

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-19 20:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-19 19:37 [PATCH v2] mhi: make mhi_controller_config::event_cfg const Jeff Johnson
2022-08-19 20:57 ` Jeff Johnson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).