Skip to contentSkip to conversation

ww_mutex compile warning

DISCUSSION Hauke Mehrtens 2 participants 2 messages Aug 16, 2013 – Aug 28, 2013

lore
Share & tools
lore
#0 lore raw

Hi Luis,

The empty implementations of owner_running() and mutex_spin_on_owner() in backport/compat/kernel/ww_mutex.c should return something (one an in, one an bool), but they don't. That causes a compile warning about a missing return statement with kernel 3.9. I do not understand that code, could you please have a look into that.

Hauke

#1 lore raw
Quoted 7 lines · Hauke Mehrtens

Hi Luis,

The empty implementations of owner_running() and mutex_spin_on_owner() in backport/compat/kernel/ww_mutex.c should return something (one an in, one an bool), but they don't. That causes a compile warning about a missing return statement with kernel 3.9. I do not understand that code, could you please have a look into that.

Sure here's the fix, I'll submit. Thanks for reporting this.

Luis

backport/compat/kernel/ww_mutex.c +2 -0
index 257c2a4..204ac8f 100644
@@ -206,10 +206,12 @@ static void mspin_unlock(struct mspin_node **lock, struct mspin_node *node)
 
 static inline bool owner_running(struct mutex *lock, struct task_struct *owner)
 {
+	return false;
 }
 
 int mutex_spin_on_owner(struct mutex *lock, struct task_struct *owner)
 {
+	return 1;
 }
 
 static inline int mutex_can_spin_on_owner(struct mutex *lock)