[PATCH 8/8] firmware: mark some structs as packed

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/baseband-devel@lists.osmocom.org/.

Alexander Huemer alexander.huemer at xx.vu
Wed Nov 23 22:59:44 UTC 2011


this eliminates the occurrance of gcc warning
warning: cast increases required alignment of target type
---
 src/target/firmware/include/comm/timer.h           |    4 +++-
 src/target/firmware/include/layer1/sched_gsmtime.h |    5 ++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/target/firmware/include/comm/timer.h b/src/target/firmware/include/comm/timer.h
index db7d1a5..7025cda 100644
--- a/src/target/firmware/include/comm/timer.h
+++ b/src/target/firmware/include/comm/timer.h
@@ -21,6 +21,8 @@
 #ifndef TIMER_H
 #define TIMER_H
 
+#include <defines.h>
+
 #include <sys/time.h>
 
 #include <osmocom/core/linuxlist.h>
@@ -51,7 +53,7 @@ struct osmo_timer_list {
 
 	void (*cb)(void*);
 	void *data;
-};
+} __packed;
 
 extern unsigned long volatile jiffies;
 
diff --git a/src/target/firmware/include/layer1/sched_gsmtime.h b/src/target/firmware/include/layer1/sched_gsmtime.h
index c40359e..36918fa 100644
--- a/src/target/firmware/include/layer1/sched_gsmtime.h
+++ b/src/target/firmware/include/layer1/sched_gsmtime.h
@@ -2,6 +2,9 @@
 #define _L1_SCHED_GSMTIME_H
 
 #include <stdint.h>
+
+#include <defines.h>
+
 #include <osmocom/core/linuxlist.h>
 
 struct sched_gsmtime_event {
@@ -9,7 +12,7 @@ struct sched_gsmtime_event {
 	const struct tdma_sched_item *si;
 	uint32_t fn;
 	uint16_t p3;	/* parameter for TDMA scheduler */
-};
+} __packed;
 
 /* initialize the GSMTIME scheduler */
 void sched_gsmtime_init(void);
-- 
1.7.8.rc1





More information about the baseband-devel mailing list