Re: [PATCH] [V3] net: emaclite: adding MDIO and phy lib support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: John Williams
Date: Tuesday, February 9, 2010 - 3:30 pm

Hi John,

Sorry If I'm painting bike-sheds here, just one tiny tweak might be in
order to standardise your mutex_unlock exit path:


[snip]



[snip]



Can this be better expressed like this:

my_func() {
  mutex_lock()
..

  if(some error) {
    rc=-ETIMEDOUT;
    goto out_unlock;
  }
  ...

  /* success path */
  rc=0;
..
out_unlock:
  mutex_unlock()
  return rc;
}


Is this style still favoured in driver exit paths?

Thanks,

John
-- 
John Williams, PhD, B.Eng, B.IT
PetaLogix - Linux Solutions for a Reconfigurable World
w: www.petalogix.com  p: +61-7-30090663  f: +61-7-30090663
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] [V3] net: emaclite: adding MDIO and phy lib su ..., John Williams, (Tue Feb 9, 3:30 pm)