Browse code

core: fix for warning dereferencing type-punned pointer will break strict-aliasing rules

- related to timer list operation

Daniel-Constantin Mierla authored on 19/09/2013 13:17:38
Showing 1 changed files
... ...
@@ -157,6 +157,8 @@ static inline void timer_redist(ticks_t t, struct timer_head *h)
157 157
 
158 158
 static inline void timer_run(ticks_t t)
159 159
 {
160
+	struct timer_head *thp;
161
+
160 162
 	/* trust the compiler for optimizing */
161 163
 	if ((t & H0_MASK)==0){              /*r1*/
162 164
 		if ((t & H1_H0_MASK)==0){        /*r2*/
... ...
@@ -168,7 +170,8 @@ static inline void timer_run(ticks_t t)
168 168
 	/*
169 169
 	DBG("timer_run: ticks %u, expire h0[%u]\n",
170 170
 						(unsigned ) t, (unsigned)(t & H0_MASK));*/
171
-	_timer_mv_expire(&timer_lst->h0[t & H0_MASK]);  /*r1*/
171
+	thp = &timer_lst->h0[t & H0_MASK];
172
+	_timer_mv_expire(thp);  /*r1*/
172 173
 }
173 174
 #else
174 175