Re: [PATCH 0/4] ath10k: a few incorrect return handling fix-up
From: Nicholas Mc Guire <hidden>
Date: 2014-12-30 19:42:44
Also in:
linux-wireless, lkml
On Tue, 30 Dec 2014, Sergei Shtylyov wrote:
On 12/30/2014 09:28 PM, Nicholas Mc Guire wrote:quoted
quoted
quoted
wait_for_completion_timeout does not return negative values so the tests for <= 0 are not needed and the case differentiation in the error handling path unnecessary.quoted
quoted
I decided to verify your statement and I saw that it seems wrong. do_wait_for_common() can return -ERESTARTSYS and the return value gets returned by its callers unchanged.quoted
the -ERESTARTSYS only can be returned if state matches but wait_for_completion_timemout passes TASK_UNINTERRUPTIBLE so signal_pending_state will return 0 and never negativquoted
my understanding of the callchain is: wait_for_completion_timemout with TASK_UNINTERRUPTIBLE -> wait_for_common(...TASK_UNINTERRUPTIBLE) -> __wait_for_common(...TASK_UNINTERRUPTIBLE) -> do_wait_for_common(...TASK_UNINTERRUPTIBLE) -> signal_pending_state(TASK_UNINTERRUPTIBLE...)quoted
static inline int signal_pending_state(long state, struct task_struct *p) { if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL))) return 0;Right. I didn't look into TASK_UNINTERRUPTIBLE thing before sending my mail.quoted
so wait_for_completion_timemout should return 0 or 1 only0 or the remaining time, to be precise.
yup - thanks for the confirmation!
quoted
quoted
quoted
patch was only compile tested x86_64_defconfig + CONFIG_ATH_CARDS=m CONFIG_ATH10K=mquoted
quoted
quoted
patch is against linux-next 3.19.0-rc1 -next-20141226quoted
quoted
Rather patches. It would have been better to send one patch instead of 4 patches with the same name.quoted
sorry for that - I had split it into separate patches as it was in different files - giving them the same name of course was a bit brain-dead.You should have mentioned the modified files in the subject. But IMHO it would be better to have just one patch.
resent as a single patch as v2 thx! hofrat