From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756087AbdKCQje (ORCPT ); Fri, 3 Nov 2017 12:39:34 -0400 Received: from mout.web.de ([212.227.15.14]:53964 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751381AbdKCQjc (ORCPT ); Fri, 3 Nov 2017 12:39:32 -0400 Subject: Re: [PATCH] staging: comedi: usbduxfast: Improve unlocking of a mutex in usbduxfast_ai_insn_read() To: Ian Abbott , devel@driverdev.osuosl.org Cc: Greg Kroah-Hartman , H Hartley Sweeten , LKML , kernel-janitors@vger.kernel.org References: From: SF Markus Elfring Message-ID: <1d91cb37-4b7d-3b2e-bc20-1bcd70f19c4b@users.sourceforge.net> Date: Fri, 3 Nov 2017 17:39:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:BnerEk9gJNR8RojMwRXSA6esVk0vXQuhZlLIxQlwOt9u8i7BD1G PS0mJ9Q1ltaD7dlGveLAJ5qEMTn3pSq99pONyvpT2xJZC9mPzUWb3PWkZIsXKbWzG67f3Nw 6yQ3hcfZdoRHFTyFFuz2Ra3ONQ9cxpdKEmNmcVFXh3DjM70g6X7BrYy1yGa1bb5akwqSNJ7 9cni15TlCVgWXvJCKaghg== X-UI-Out-Filterresults: notjunk:1;V01:K0:Ke9f19FWTO4=:XeAJdy0lOAIpI3GXMnpSJS hlqeeO1980AY/bNGkkcrYUX7OXaC9ZwF6gf6XBPqQzL+354dAtEvjD5erw9KVO2vwtwstZAax waxKzMezWM2C4InJ+jYYGn80bVnFzrwADLzXPAhjd0jLxlRs+/Fq4fboGg7vM2kwKFN6CXNpq n6xGcUxnstFpemJWP+Yiw0ROrm4rOW56+ilTUjPet737wnaEDisWZcZOM272XsjSdiVtLetpy Uw/lc5TemIh5yLroKS3v07ANEJqX8GV0A1l3xOO+cumzNO8Xj9LVPFVMkWMadqUQDsO7gPUXJ yL5tdQ7UTSbXMs2vh9V2Q88hLzBli5pZo+0L8+LW1YwsjoCcb+Y0b2mzdijO6Vgrh8idBcKL6 K9G0GtXKEaSWMeN53kPrC4hs72WyJQLlBcIGGJo1CGDashDUOLYeZ9e3zEzH4ilV0pUUgURdd 9IUTg83puq/61/+v0uA+0nvAflik9eIzn15gWiTQxc8Vd9AGSYFWbONaeMMH5tyI1nC1Wtjg7 7Q9Nf44vp5cvovtwUdBurMGW3MFIJFK4dT4XjQA36hxwTaUSxAKqDR8TU2so48rUP2RNHE9R2 D5nZBHOz+rSKE9fK2fWvhSnX6FHfa3DsH1fwXyWmjFsb9xfsv4Bxi2fXlNloattqsKr9ZDvHK SXtRxJI53t6iJaHhWKWD0HajZuZlmtwDg9Vzl19nsrF2f/ZImbTuWU9rXgi7zaqcXZxgvkVr5 LzjIbK0fbYDhTULMsI6+bq4LA/16dDoeLSnLJZVzSuaLtuxFxENarA/hw8FWU3obb6JXiqhBl qU5Acrior8se4/zDsmcxxj22C+jpPgBJ3dtdB99lLip518fuQg= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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