From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754930AbcAOLro (ORCPT ); Fri, 15 Jan 2016 06:47:44 -0500 Received: from mout.web.de ([212.227.15.14]:55297 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751002AbcAOLrm (ORCPT ); Fri, 15 Jan 2016 06:47:42 -0500 Subject: Re: gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection To: Joe Perches , netdev@vger.kernel.org References: <566ABCD9.1060404@users.sourceforge.net> <56866E7F.8080609@users.sourceforge.net> <5698C53C.8060204@users.sourceforge.net> <5698C5CB.80305@users.sourceforge.net> <1452854229.8586.48.camel@perches.com> Cc: Claudiu Manoil , LKML , kernel-janitors@vger.kernel.org, Julia Lawall From: SF Markus Elfring X-Enigmail-Draft-Status: N1110 Message-ID: <5698DC52.4050808@users.sourceforge.net> Date: Fri, 15 Jan 2016 12:47:30 +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: <1452854229.8586.48.camel@perches.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:oMgIqFKmi+Da/KAJMg458rmpaQDEPqxvOmykzirL0p/Osrhguoe 8DtOcLdDpVfEHDCJKyjhrDN1f1zkGsngvm2/F99eLaKmwyTOjbKdmA92YnhbqAqmuIMtZfX YO45CcnXgH2klKIElYazGd/2FXE0DsqPPLZtylxINhO3ME0fy0ZaWudkjZpk5eZ83f6RLX+ WE0MveoMBbd/KEFV7Herw== X-UI-Out-Filterresults: notjunk:1;V01:K0:mezpprGEgVY=:BjfJ2y1MOtdxmNb6V/Hf6l 0PA8u0B8DIbEP9et81v0GytfejsrVSUpSbgpF81uUrJshJYaZhr0pzm3X/mAqtpWPL551HxAx bXDIdm4MJWT6gqxw3J8xDqU+/ExEYA2ncic6jMD8OEQiqrskupRN6TCvPXllB5AZaGJkil1xW 4NjGcDRJfw9i73dkg6V85sf+kTYh578RhGVSNbceCHoO3XndY6QOQtZHJ7YpGnr7Il1WBKUoN 833FEXJFFrFWcAA6J7FhLh98i23dud5dsBCfsn28k4rWW16J3vQKOD3HkxFqkD+RP6NzHzGoz bQgM/xH+GPOMqQ+HUnvB4QfHyANHT1evBZbudaCrQh24xyvz6T30g0Sb5YB7dfbpst63q4u3c kykRa9KsNfEzYrob8KS8jKCq1kWF+/iz3Te2dywMdSUHGN3hA3bA3Ku4rJ/T6yp0355RiSXcF ebDjgUUfeDeqMmSp8sE7fMP7NHHy8nyqiGa0D1E99Af3PbB3UowBr3869XOnaNFBnfmh/NyPF C7aP5OHfzFTNuY14XKlixeroskVvSf7Hcg/Y+SB88kofNJ0wsWvOKCfaXCcoZTfZ30WcGovQR OgP5QUtsGcpVxG7JfCx5r4pYQ7oX4JlwBuBNjGFEaMZfrcEThIL7Fj6sHj8SVC8PvQqFdl2FO LuNDPO4uhCgpwSyGuHU82atnEKgV86rCK8CyRcYFB4zBQ09D1lnzd6tnrQ45IiThow6ryS/bD f+RMVwLP8krNq8fnlVTjS6xMuEKAfxfFhpN8BzLwJaGo2DB0e/dyad1niJ35ssKL3fWy/fkSM c6V/FoS Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >> * Return directly if a memory allocation failed at the beginning. >> >> * Adjust jump targets according to the Linux coding style convention. >> >> This issue was detected by using the Coccinelle software. > > Is this really better? > > Perhaps this particular static analysis isn't too useful. The opinions are still evolving for such a kind of search pattern. > Why not just allocate once and assign a second pointer? > > local_rqfpr = kmalloc_array(2 * (MAX_FILER_IDX + 1), > sizeof(unsigned int), GFP_KERNEL); > if (!local_rqfpr) > goto err; > > local_rqfcr = &local_rqfpr[MAX_FILER_IDX + 1]; Do you suggest to use only one array (instead of two as before) here? Regards, Markus From mboxrd@z Thu Jan 1 00:00:00 1970 From: SF Markus Elfring Date: Fri, 15 Jan 2016 11:47:30 +0000 Subject: Re: gianfar: Less function calls in gfar_ethflow_to_filer_table() after error detection Message-Id: <5698DC52.4050808@users.sourceforge.net> List-Id: References: <566ABCD9.1060404@users.sourceforge.net> <56866E7F.8080609@users.sourceforge.net> <5698C53C.8060204@users.sourceforge.net> <5698C5CB.80305@users.sourceforge.net> <1452854229.8586.48.camel@perches.com> In-Reply-To: <1452854229.8586.48.camel@perches.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Joe Perches , netdev@vger.kernel.org Cc: Claudiu Manoil , LKML , kernel-janitors@vger.kernel.org, Julia Lawall >> * Return directly if a memory allocation failed at the beginning. >> >> * Adjust jump targets according to the Linux coding style convention. >> >> This issue was detected by using the Coccinelle software. > > Is this really better? > > Perhaps this particular static analysis isn't too useful. The opinions are still evolving for such a kind of search pattern. > Why not just allocate once and assign a second pointer? > > local_rqfpr = kmalloc_array(2 * (MAX_FILER_IDX + 1), > sizeof(unsigned int), GFP_KERNEL); > if (!local_rqfpr) > goto err; > > local_rqfcr = &local_rqfpr[MAX_FILER_IDX + 1]; Do you suggest to use only one array (instead of two as before) here? Regards, Markus