From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753208AbcAGTbj (ORCPT ); Thu, 7 Jan 2016 14:31:39 -0500 Received: from mout.web.de ([212.227.17.11]:55887 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752731AbcAGTbf (ORCPT ); Thu, 7 Jan 2016 14:31:35 -0500 Subject: Re: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection To: Robert Richter References: <566ABCD9.1060404@users.sourceforge.net> <5685A273.6070607@users.sourceforge.net> <20160107110701.GE25086@rric.localdomain> Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sunil Goutham , LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Message-ID: <568EBCE7.4060502@users.sourceforge.net> Date: Thu, 7 Jan 2016 20:30:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <20160107110701.GE25086@rric.localdomain> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:PMYPFyKe8A63Hq1IeOmMa8lz8DU9BqDhg1e88/OwVHS2JJ5VpFb stKlI6200hVIu7mIpHjFr6CGVb86l+dVj3MwJdMqSJ/zK3hyg+2PyhgdULRKi7VUvDFZfve gby2I6Q6TCDfhHnkt+0kakXF+1GAueHNcUmSuN8sw1RdR/jz9sIbZwUrAxu806y4Lnbli8V kpkoWSM1LNB1GuCmaCY1g== X-UI-Out-Filterresults: notjunk:1;V01:K0:kigicu9CPd0=:emcOkYhwI9PZsQzs79L+3l p36gmOWogcncFw5OTQW5No9f00mGu+h7KpazIsmYrdhZN0mY8YIQ8fGPde6namw8YVGW4Gi/A 6U4Br6NI3FB5KKDBrlEd0lJREiURny8moAsdomVXJ2on8AhUZ2movHW0TRouyfnpzSDXdTUbI JcDHHjf2KAqDiibHleH3188IupPZJIkrbA0loOwC4IXie5dmN8TBCTZNkFXGTe9mmhlrjubXR F6PkeCwXKPgeNWDSIRagjFCG38azGHtt0mGriFjfLpZP5mw56SCzf4a7/HOl+bVerEbRvOGDe 1Awfyi+JMW2IVLfWeuYS66i0b7EOyFXsv/qbijeIgBgl3Weo7fcUrEr9zzE47ys2+9wRWEblE uegvJrv0H8cGGzA3jYImQ8svdWurlUUq3FABjT5tqhenK8G78bLzeYsg5ywMIskm8UFw65bSF nFJylF478Q7QRkQs9Th7K3wdqUL26WjosxQQUtyetObcDTH+DuPdNxpiYIyGMHtH9SEhcheoD 6kHjeD2vnGU6MJQXkT1Z0jZ8aZwZ5a83bPJMVLju1bsfqne27K9U0Rlq5OsAzTOSct2CnS37B SVm/xy1ik/K1Z4kxwi4p746nD/+JTwlkvVs/AUik07nt/EZkynZje/oO9iEpeVKIuHk+yTg9D kXBU6NdDVUT0WUFelzdZRvBupK2s3f+bOcHwJocufh5YOD8jO9iTwHfaIbbxdYdQ0UWLdSB6T Aos+sxGIxm3pZF/5hr/ZdHIEUH8J/mF753XBUgLY5DiiGqlk4ieEFAJg6iL0/PE7lSK+Y13H/ /nPg4Hv Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> Adjust a jump target to eliminate a check before error logging. >> Use the identifier "report_failure" instead of "err". > > I don't see much value in those changes. Thanks for your feedback. > Using the 'err' label is ok as it is not misleading and common use. Is such a short jump label enough explanation for the information "what" and "why"? > And, there is no need to optimize the check since this is not the fast path Really? - Is it a bit more efficient to avoid a double check for the variable "ret" at the end of the current implementation for the discussed function? https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/cavium/thunder/nicvf_main.c?id=40fb5f8a60f33133d36afde35a9ad865d35e4423#n940 > and will be compiler optimized anyway. How sure are you about automatic software optimisations? Can it occasionally help to jump to the really intended source code location directly? >> @@ -944,13 +944,12 @@ static int nicvf_register_interrupts(struct nicvf *nic) >> ret = request_irq(nic->msix_entries[irq].vector, >> nicvf_qs_err_intr_handler, >> 0, nic->irq_name[irq], nic); >> - if (!ret) >> + if (!ret) { >> nic->irq_allocated[irq] = true; >> - >> -err: >> - if (ret) >> - netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); >> - >> + return 0; >> + } >> +report_failure: >> + netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); >> return ret; >> } From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Thu, 07 Jan 2016 19:30:47 +0000 Subject: Re: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection Message-Id: <568EBCE7.4060502@users.sourceforge.net> List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <5685A273.6070607@users.sourceforge.net> <20160107110701.GE25086@rric.localdomain> In-Reply-To: <20160107110701.GE25086@rric.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-arm-kernel@lists.infradead.org >> Adjust a jump target to eliminate a check before error logging. >> Use the identifier "report_failure" instead of "err". > > I don't see much value in those changes. Thanks for your feedback. > Using the 'err' label is ok as it is not misleading and common use. Is such a short jump label enough explanation for the information "what" and "why"? > And, there is no need to optimize the check since this is not the fast path Really? - Is it a bit more efficient to avoid a double check for the variable "ret" at the end of the current implementation for the discussed function? https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/cavium/thunder/nicvf_main.c?id@fb5f8a60f33133d36afde35a9ad865d35e4423#n940 > and will be compiler optimized anyway. How sure are you about automatic software optimisations? Can it occasionally help to jump to the really intended source code location directly? >> @@ -944,13 +944,12 @@ static int nicvf_register_interrupts(struct nicvf *nic) >> ret = request_irq(nic->msix_entries[irq].vector, >> nicvf_qs_err_intr_handler, >> 0, nic->irq_name[irq], nic); >> - if (!ret) >> + if (!ret) { >> nic->irq_allocated[irq] = true; >> - >> -err: >> - if (ret) >> - netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); >> - >> + return 0; >> + } >> +report_failure: >> + netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); >> return ret; >> } From mboxrd@z Thu Jan 1 00:00:00 1970 From: elfring@users.sourceforge.net (SF Markus Elfring) Date: Thu, 7 Jan 2016 20:30:47 +0100 Subject: [PATCH] net-thunder: One check less in nicvf_register_interrupts() after error detection In-Reply-To: <20160107110701.GE25086@rric.localdomain> References: <566ABCD9.1060404@users.sourceforge.net> <5685A273.6070607@users.sourceforge.net> <20160107110701.GE25086@rric.localdomain> Message-ID: <568EBCE7.4060502@users.sourceforge.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org >> Adjust a jump target to eliminate a check before error logging. >> Use the identifier "report_failure" instead of "err". > > I don't see much value in those changes. Thanks for your feedback. > Using the 'err' label is ok as it is not misleading and common use. Is such a short jump label enough explanation for the information "what" and "why"? > And, there is no need to optimize the check since this is not the fast path Really? - Is it a bit more efficient to avoid a double check for the variable "ret" at the end of the current implementation for the discussed function? https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/tree/drivers/net/ethernet/cavium/thunder/nicvf_main.c?id=40fb5f8a60f33133d36afde35a9ad865d35e4423#n940 > and will be compiler optimized anyway. How sure are you about automatic software optimisations? Can it occasionally help to jump to the really intended source code location directly? >> @@ -944,13 +944,12 @@ static int nicvf_register_interrupts(struct nicvf *nic) >> ret = request_irq(nic->msix_entries[irq].vector, >> nicvf_qs_err_intr_handler, >> 0, nic->irq_name[irq], nic); >> - if (!ret) >> + if (!ret) { >> nic->irq_allocated[irq] = true; >> - >> -err: >> - if (ret) >> - netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); >> - >> + return 0; >> + } >> +report_failure: >> + netdev_err(nic->netdev, "request_irq failed, vector %d\n", irq); >> return ret; >> }