From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Fri, 03 Nov 2017 16:39:21 +0000 Subject: Re: [PATCH] staging: comedi: usbduxfast: Improve unlocking of a mutex in usbduxfast_ai_insn_read() Message-Id: <1d91cb37-4b7d-3b2e-bc20-1bcd70f19c4b@users.sourceforge.net> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: Ian Abbott , devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman , H Hartley Sweeten , LKML , kernel-janitors@vger.kernel.org >> @@ -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