diff mbox series

[v2] mhi: make mhi_controller_config::event_cfg const

Message ID 20220819193702.24697-1-quic_jjohnson@quicinc.com (mailing list archive)
State Superseded
Headers show
Series [v2] mhi: make mhi_controller_config::event_cfg const | expand

Commit Message

Jeff Johnson Aug. 19, 2022, 7:37 p.m. UTC
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(-)

Comments

Jeff Johnson Aug. 19, 2022, 8:57 p.m. UTC | #1
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
diff mbox series

Patch

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;
 };