From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Hartmut Knaack <knaack.h@gmx.de>,
Lars-Peter Clausen <lars@metafoo.de>,
Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
Pravin Shedge <pravin.shedge4linux@gmail.com>,
Quentin Schulz <quentin.schulz@free-electrons.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: iio/gyro/bmg160_core: Improve unlocking of a mutex in five functions
Date: Sun, 18 Mar 2018 09:19:47 +0100 [thread overview]
Message-ID: <73f0a187-57d1-c877-ba9f-3b15f6a61640@users.sourceforge.net> (raw)
In-Reply-To: <20180317195422.037a8b57@archlinux>
Am 17.03.2018 um 20:54 schrieb Jonathan Cameron:
> On Wed, 14 Mar 2018 16:15:32 +0100
> SF Markus Elfring <elfring@users.sourceforge.net> wrote:
>
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Wed, 14 Mar 2018 16:06:49 +0100
>>
>> * Add jump targets so that a call of the function "mutex_unlock" is stored
>> only once in these function implementations.
>>
>> * Replace 19 calls by goto statements.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>
> Hi Markus,
>
> Some of these are good and sensible changes
Such feedback is nice.
> - others break the code.
Which concrete places do you find questionable here?
>> - return ret;
>> +
>> + goto set_power_state;
>> default:
>> return -EINVAL;
> We exit with the mutex locked now and it should not be.
I wonder about your source code interpretation here.
The mutex was (and is still only) locked within case branches, isn't it?
>
>> }
>>
>> return -EINVAL;
> Mutex is still locked here and the return is wrong.
Should this statement get any more software development attention?
Regards,
Markus
next prev parent reply other threads:[~2018-03-18 8:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 15:15 [PATCH] " SF Markus Elfring
2018-03-17 19:54 ` Jonathan Cameron
2018-03-18 8:19 ` SF Markus Elfring [this message]
2018-03-18 10:15 ` Jonathan Cameron
2018-03-19 9:51 ` SF Markus Elfring
2018-03-24 9:08 ` SF Markus Elfring
2018-03-18 10:05 ` [PATCH] " Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=73f0a187-57d1-c877-ba9f-3b15f6a61640@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=gregkh@linuxfoundation.org \
--cc=jic23@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=knaack.h@gmx.de \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
--cc=pravin.shedge4linux@gmail.com \
--cc=quentin.schulz@free-electrons.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome