Skip to contentSkip to conversation

firmware: arm_scmi: Add include guard to linux/scmi_protocol.h

PATCH New Sudeep Holla 1 participant 2 messages Apr 3, 2020 System control & power/management interface (SCPI/SCMI) Message Protocol drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 firmware: arm_scmi: Add include guard to linux/scmi_protocol.h

If this header is include twice, it will generate loads of compile time error with the following below error pattern. It was reported by 0day kbuild robot on a branch pushed with double inclusion by accident.

error: conflicting types for ‘...’
note: previous declaration of ‘...’ was here
error: redefinition of ‘...’

Add a header include guard just in case.

---
 include/linux/scmi_protocol.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/scmi_protocol.h +6 -0
index 5c873a59b387..ce2f5c28b2df 100644
@@ -4,6 +4,10 @@
  *
  * Copyright (C) 2018 ARM Ltd.
  */
+
+#ifndef _LINUX_SCMI_PROTOCOL_H
+#define _LINUX_SCMI_PROTOCOL_H
+
 #include <linux/device.h>
 #include <linux/types.h>
 
@@ -319,3 +323,5 @@ static inline void scmi_driver_unregister(struct scmi_driver *driver) {}
 typedef int (*scmi_prot_init_fn_t)(struct scmi_handle *);
 int scmi_protocol_register(int protocol_id, scmi_prot_init_fn_t fn);
 void scmi_protocol_unregister(int protocol_id);
+
+#endif /* _LINUX_SCMI_PROTOCOL_H */
Signature · 1 line
2.17.1
#1 lore raw

PATCH 2/2 firmware: arm_scpi: Add include guard to linux/scpi_protocol.h

If this header is include twice, it will generate loads of compile time error with the following below error pattern. It was reported by 0day kbuild robot on a branch pushed with double inclusion by accident. This is based on the similar change in linux/scmi_protocol.h

error: conflicting types for ‘...’
note: previous declaration of ‘...’ was here
error: redefinition of ‘...’

Add a header include guard just in case.

---
 include/linux/scpi_protocol.h | 6 ++++++
 1 file changed, 6 insertions(+)
include/linux/scpi_protocol.h +6 -0
index ecb004711acf..afbf8037d8db 100644
@@ -4,6 +4,10 @@
  *
  * Copyright (C) 2014 ARM Ltd.
  */
+
+#ifndef _LINUX_SCPI_PROTOCOL_H
+#define _LINUX_SCPI_PROTOCOL_H
+
 #include <linux/types.h>
 
 struct scpi_opp {
@@ -71,3 +75,5 @@ struct scpi_ops *get_scpi_ops(void);
 #else
 static inline struct scpi_ops *get_scpi_ops(void) { return NULL; }
 #endif
+
+#endif /* _LINUX_SCPI_PROTOCOL_H */
Signature · 1 line
2.17.1