lkml.org 
[lkml]   [2016]   [Oct]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/7] iio: light: tsl2583: change functions to only have a single exit point
On Wed, Oct 19, 2016 at 02:08:59PM +0300, Dan Carpenter wrote:
> On Wed, Oct 19, 2016 at 06:32:05AM -0400, Brian Masney wrote:
> > Change the following functions to only have a single exit point:
> > taos_i2c_read(), taos_als_calibrate(), taos_chip_on(),
> > taos_gain_store(), taos_gain_available_show(), taos_luxtable_store()
> > and taos_probe().
> >
>
> What's the point of this? This style of code just makes things more
> complicated and leads to "forgot the error code" bugs. People think
> that it future proofs the code in case we add locking but I have looked
> into this and it has minimal if any impact at preventing locking bugs.

The reason that I did this was due to the locking that I added later in
the patch series. Each function would only have a single call to
mutex_unlock(). I should have mentioned that in my message.

Brian

\
 
 \ /
  Last update: 2016-10-19 16:38    [W:0.153 / U:1.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site