diff mbox series

[4/4] firmware: arm_scmi: Remove fixed size typing from event reports

Message ID 20200708122248.52771-4-cristian.marussi@arm.com (mailing list archive)
State New, archived
Headers show
Series [1/4] firmware: arm_scmi: Remove zero-length array in SCMI Notifications | expand

Commit Message

Cristian Marussi July 8, 2020, 12:22 p.m. UTC
Event reports are used to convey information describing events to the
registered user-callbacks: they are necessarily derived from the underlying
raw SCMI events' messages but they are not meant to expose or directly
mirror any of those messages data layout, which belong to the protocol
layer.

Using fixed size fields mirroring messages structure is at odd with this:
get rid of them using more generic, equivalent, typing.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
---
 include/linux/scmi_protocol.h | 52 +++++++++++++++++------------------
 1 file changed, 26 insertions(+), 26 deletions(-)

Comments

Arnd Bergmann July 8, 2020, 8:39 p.m. UTC | #1
On Wed, Jul 8, 2020 at 2:25 PM Cristian Marussi
<cristian.marussi@arm.com> wrote:
>
> Event reports are used to convey information describing events to the
> registered user-callbacks: they are necessarily derived from the underlying
> raw SCMI events' messages but they are not meant to expose or directly
> mirror any of those messages data layout, which belong to the protocol
> layer.
>
> Using fixed size fields mirroring messages structure is at odd with this:
> get rid of them using more generic, equivalent, typing.
>
> Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Ok, I was expecting you would go with fixed-size structures without
implied padding, but either way makes it more consistent, so this
version is good, too.

       Arnd
diff mbox series

Patch

diff --git a/include/linux/scmi_protocol.h b/include/linux/scmi_protocol.h
index 7d4348fb7330..e51f392f464b 100644
--- a/include/linux/scmi_protocol.h
+++ b/include/linux/scmi_protocol.h
@@ -381,47 +381,47 @@  enum scmi_notification_events {
 };
 
 struct scmi_power_state_changed_report {
-	u64 timestamp;
-	u32 agent_id;
-	u32 domain_id;
-	u32 power_state;
+	unsigned long long	timestamp;
+	unsigned int		agent_id;
+	unsigned int		domain_id;
+	unsigned int		power_state;
 };
 
 struct scmi_perf_limits_report {
-	u64 timestamp;
-	u32 agent_id;
-	u32 domain_id;
-	u32 range_max;
-	u32 range_min;
+	unsigned long long	timestamp;
+	unsigned int		agent_id;
+	unsigned int		domain_id;
+	unsigned int		range_max;
+	unsigned int		range_min;
 };
 
 struct scmi_perf_level_report {
-	u64 timestamp;
-	u32 agent_id;
-	u32 domain_id;
-	u32 performance_level;
+	unsigned long long	timestamp;
+	unsigned int		agent_id;
+	unsigned int		domain_id;
+	unsigned int		performance_level;
 };
 
 struct scmi_sensor_trip_point_report {
-	u64 timestamp;
-	u32 agent_id;
-	u32 sensor_id;
-	u32 trip_point_desc;
+	unsigned long long	timestamp;
+	unsigned int		agent_id;
+	unsigned int		sensor_id;
+	unsigned int		trip_point_desc;
 };
 
 struct scmi_reset_issued_report {
-	u64 timestamp;
-	u32 agent_id;
-	u32 domain_id;
-	u32 reset_state;
+	unsigned long long	timestamp;
+	unsigned int		agent_id;
+	unsigned int		domain_id;
+	unsigned int		reset_state;
 };
 
 struct scmi_base_error_report {
-	u64 timestamp;
-	u32 agent_id;
-	bool fatal;
-	u16 cmd_count;
-	u64 reports[];
+	unsigned long long	timestamp;
+	unsigned int		agent_id;
+	bool			fatal;
+	unsigned int		cmd_count;
+	unsigned long long	reports[];
 };
 
 #endif /* _LINUX_SCMI_PROTOCOL_H */