From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753585AbdKXNvt (ORCPT ); Fri, 24 Nov 2017 08:51:49 -0500 Received: from mout.web.de ([212.227.15.4]:59464 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619AbdKXNvr (ORCPT ); Fri, 24 Nov 2017 08:51:47 -0500 Subject: Re: ASoC: da7218: Use common error handling code in da7218_of_to_pdata() To: Mark Brown , Adam Thomson , "alsa-devel@alsa-project.org" , support.opensource@diasemi.com Cc: Jaroslav Kysela , Liam Girdwood , Takashi Iwai , LKML , kernel-janitors@vger.kernel.org References: <07c631e4-e2df-7ae2-ea31-9430c89dc8e3@users.sourceforge.net> <32a4c9e8-2030-c4e8-eb54-9ce6712ef0cd@users.sourceforge.net> <2E89032DDAA8B9408CB92943514A0337014C1B11E5@SW-EX-MBX01.diasemi.com> <20171124125558.uvfognezm75dtlbc@sirena.org.uk> From: SF Markus Elfring Message-ID: <2a38fc07-ebf1-3e61-d809-ba6ed6dbe45a@users.sourceforge.net> Date: Fri, 24 Nov 2017 14:50:59 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <20171124125558.uvfognezm75dtlbc@sirena.org.uk> Content-Type: text/plain; charset=UTF-8 Content-Language: en-GB Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K0:xBE3ai7AnjU462+55RiddnQZbsTprNOFYYzB8tYwkGiS0EcTLer bR/w33N0+aRv+h56+Ev37QhyEsBIapIn664KrURkrvScEfevhicT4Nh6NAUP60rwBb/Gcg/ Hyssm9/IoM5Cw9uwBYgndk5HZbDPg00eZoII4lGOij3z7J705FFixNxsqs6wmOLodY1KAuK z/j3rfqQiqDwVDDRSedSA== X-UI-Out-Filterresults: notjunk:1;V01:K0:c7G5vtkJTVg=:W/3ye5j6BnyXQJ3Vyln2vC 96Q5w4MWV29M+IOrVhnspe68MnTMY3lUpmefzlmPrrlfCb/sKC38865ZGtjNEZK4qU2pGWKkb kVJMsNG9CFNMTnN05cN+d/1MDWunHCvO7Rz+RJ/EcA+8GFMrCnMZakLdVzC63rD2PP6AV/c+/ ijQfzcSFwZGgii4qv+dZFT3Ihi0zY4J8dKSXqJ0WvXYT5pTujQ+Uhie6w+net6L7/bArC80Zv o7U9avdLlhx/uDqq+Fm1rO+hgErFFCRtBDZwjgEELP3Y1WQsfAYMRxRfb6qoA6EbGZrT1zneT eLxD69Y0bBVUwqPiNo4VruC88QN/hOPAIyb3Ysb6oCt/3sFM77gw/tUpPU9v7nY++kdXKEJWT k6OIKqzSMn4JpexXFX8lIQKrXZaOQEvYMh20OgV8qkBdOSUK8Jgq9n7ScOjaRsDyK9K6UXf/o n0sf58sX1KCvr/FWq1/uqMPeiSuT0NW8gUuyaxodVtd+vPJdjerZcPk3sVMye36npSkZm8ZZZ Gx/WHbE4EcA7ftTKYxI40EsTweYq8cAK4m9KlGNNXq/EhIHNBB9jN8OwsN7/Ar7/g5CvRrODw sYYNlUmK6mjWMgqDpheMNT9IA3PFhDRUyYkPwUtZxUPDcrbBHsT3S9iLyYAqN/Z7Qn/j/A6Nt CAfFzm/BmrxcoRsgIJZqkpy35cXkCbUDLYio8WLFdErdkbSLi1KlXUS5pdk5MdVEEvML0R9Vy U92twpAV4YlxuF+Q35Ige8y79elcC7tRYVI2/z101PAyFvhXbwVPJSOIK7ztWkTaRtm/Z0jTu uAS7YoQTlNR1BCmYfF7iuLqdF7RwOv23WsIgbSTYMy2DXC1sLs= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>> Add a jump target so that a bit of exception handling can be better reused >>> in an if branch of this function. > >> Hmm. Doesn't really gain an awful lot this. Would understand if there were >> multiple return paths, but in that case I'd have implemented something like >> this anyway. Also your patch description isn't really correct. You're re-using >> code from the sunny day scenario to handle an exception. > > Other people have given him similar feedback on his other patches with > this pattern. I'm not intending to apply any of them. I can offer another bit of information for a software development discussion. ๐Ÿ’ญ The affected source file can be compiled for the processor architecture โ€œx86_64โ€ by a tool like โ€œGCC 6.4.1+r251631-1.3โ€ from the software distribution โ€œopenSUSE Tumbleweedโ€ with the following command example. my_cc=/usr/bin/gcc-6 \ && my_module=sound/soc/codecs/da7218.o \ && for XYZ in 0 s 3; do echo " _____ $XYZ _____" \ && my_extra="-O$XYZ" \ && git checkout ':/^ASoC: da7218: Delete two error messages for a failed memory allocation in da7218_of_to_pdata' \ && make -j4 CC="${my_cc}" HOSTCC="${my_cc}" EXTRA_CFLAGS="${my_extra}" allmodconfig "${my_module}" \ && size "${my_module}" \ && git checkout ':/^ASoC: da7218: Use common error handling code in da7218_of_to_pdata' \ && make -j4 CC="${my_cc}" HOSTCC="${my_cc}" EXTRA_CFLAGS="${my_extra}" allmodconfig "${my_module}" \ && size "${my_module}"; done ๐Ÿ”ฎ Do you find the following differences worth for further clarification? โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•คโ•โ•โ•โ•โ•โ•โ•— โ•‘ setting โ”‚ text โ•‘ โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ชโ•โ•โ•โ•โ•โ•โ•ฃ โ•‘ O0 โ”‚ -25 โ•‘ โ•‘ Os โ”‚ -14 โ•‘ โ•‘ O3 โ”‚ +11 โ•‘ โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•งโ•โ•โ•โ•โ•โ•โ• Regards, Markus