From: SF Markus Elfring <elfring@users.sourceforge.net>
To: Ian Abbott <abbotti@mev.co.uk>, devel@driverdev.osuosl.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
H Hartley Sweeten <hsweeten@visionengravers.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] staging: comedi: usbduxfast: Improve unlocking of a mutex in usbduxfast_ai_insn_read()
Date: Fri, 03 Nov 2017 16:39:21 +0000 [thread overview]
Message-ID: <1d91cb37-4b7d-3b2e-bc20-1bcd70f19c4b@users.sourceforge.net> (raw)
In-Reply-To: <faf75ea4-e1cf-1959-2705-7da1d49bddde@mev.co.uk>
>> @@ -838,6 +834,10 @@ static int usbduxfast_ai_insn_read(struct comedi_device *dev,
>> mutex_unlock(&devpriv->mut);
>> return insn->n;
>
> Minor niggle: You could also remove that call to mutex_unlock() by replacing the above three lines with:
>
> ret = insn->n;
>
> which will fall through to the 'unlock:' label below.
Thanks for your suggestion.
Such a software refactoring is also possible if a corresponding
consensus could be achieved.
* Can such a change mean that the lock scope will be extended
for both use cases (successful and failed function execution)?
* How much does this implementation matter for you?
* Would you like to achieve a small reduction of the object code there?
* How do you think about consequences from special communication settings
by a well-known maintainer for my update suggestions?
Regards,
Markus
prev parent reply other threads:[~2017-11-03 16:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 19:40 [PATCH] staging: comedi: usbduxfast: Improve unlocking of a mutex in usbduxfast_ai_insn_read() SF Markus Elfring
2017-11-03 14:00 ` Ian Abbott
2017-11-03 14:14 ` Greg Kroah-Hartman
2017-11-03 17:07 ` SF Markus Elfring
2017-11-03 16:39 ` SF Markus Elfring [this message]
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=1d91cb37-4b7d-3b2e-bc20-1bcd70f19c4b@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=abbotti@mev.co.uk \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=hsweeten@visionengravers.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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