Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3549593ybi; Tue, 18 Jun 2019 02:37:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVqA22usha5YQsYFhoIKPv0ipLHuWQbvu1+FJvHGpDd8tT6i1/fkB3G0v4w/safPvgo6DE X-Received: by 2002:a63:2249:: with SMTP id t9mr1844114pgm.149.1560850650379; Tue, 18 Jun 2019 02:37:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560850650; cv=none; d=google.com; s=arc-20160816; b=BiA64p+SV2chLlPvqSwa7aqwFzBPKbqU/A0cIcCfC1Hb6xNLgTjbwHyDU+kotOtBxw Pn3ZCeRCKrmHpFb7sN7abiPT6bD3KoA5gBGu4I07HvxKZsCo6yDx7bVkwGR/dN3+pAU4 a5tDOMDS9rzEFe0nwuGJBFO96oNvM+ZTJSK4hmMrja4RK+NTXiWv80S1xGD0ofD+b46Y ZIsJZza/JXzfX/5K/cFnpBKBYVfxT7S9nR0KPmuEZGJuiO45fKtKABIQh/8qS30baW2H J6Gw3EPgkiFgsATmqaWRU/l/gMqr3d028sPB83AZsNFBfBkV3n1Lb5smQm00CPJMEKaP pEtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject; bh=/2VnRrtWq9RqVAUDALnfAOYsNWWNYymPK6N4Fk1tPkM=; b=OvcLkPUvbjMTV3Q0hCxOoNsKRDBv+XoDQ5fKQkBcacDSpJ60ZY1wPnxe99Gfs6Bjwn 8w26ckYgVVsEZiSweGOHVAwcBDxSBtMlTZa9daQxITbNhczVV8l3MGG/hxH6GBzM77QI o9KMcfpCm8OMvpwd1jJLLXm1FM4YtSBD8PI2BOnzFnNWwdoDTa6t0X8BP06SzAVL5s0y eZRJjWLwCCMRTT5lE4F3g8MjPyTk07JOGHEkfE5Y1cWf7JtA1n1yzl+hpw3LI5gpsSHd 8oUO2jIlbsTeTQFlgHbkQFHxjPdumydZyXhJUnRc1ZLYMBkoc1xuLZ6eGC7UqJLXMtWQ bHQA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w23si12684642ply.230.2019.06.18.02.37.15; Tue, 18 Jun 2019 02:37:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729408AbfFRJfx (ORCPT + 99 others); Tue, 18 Jun 2019 05:35:53 -0400 Received: from mout.kundenserver.de ([212.227.126.135]:43819 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729113AbfFRJfw (ORCPT ); Tue, 18 Jun 2019 05:35:52 -0400 Received: from [192.168.1.110] ([95.114.66.109]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MALql-1hkZRC0XyV-00Bwv7; Tue, 18 Jun 2019 11:35:37 +0200 Subject: Re: drivers: Inline code in devm_platform_ioremap_resource() from two functions To: Markus Elfring , Greg Kroah-Hartman , "Rafael J. Wysocki" , Bartosz Golaszewski Cc: cocci@systeme.lip6.fr, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko , Gilles Muller , Himanshu Jha , Linus Walleij , Masahiro Yamada , Michal Marek , Nicolas Palix References: <20190406061112.31620-1-himanshujha199640@gmail.com> <7b4fe770-dadd-80ba-2ba4-0f2bc90984ef@web.de> <032e347f-e575-c89c-fa62-473d52232735@web.de> <910a5806-9a08-adf4-4fba-d5ec2f5807ff@metux.net> From: "Enrico Weigelt, metux IT consult" Organization: metux IT consult Message-ID: <714a38fe-a733-7264-bb06-d94bd58a245a@metux.net> Date: Tue, 18 Jun 2019 11:35:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:QGOge7wGLS9wYOerll1EkGFgYhDGxxcXgNUpFw4ODbRJSI2IvQu EgNQDoUgqQPHmht+B4xha2yiDDCKlybReidxeoCxJ+rwoIdIkF5oOJWDdQN/PLJCYmtwsdY +k18JXBNva47Mqa/rQYAaiK0ltc20AueHqyQs7YbJfXMYwzLgf15a5PbvYUgkskfDAZUZwZ fKheijEjcUDc9U6yv4onQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:D189xkVVdIU=:GM0TjioBmaopMMZ9spYJwQ /GhJviRrSe4I/q2z8eiefDW9PTfL5f4N4KVWWRcVEqHG9mLc0DA99q6Y0ju2o0fUoCberydJX 4BC4/bu3rJdvu/cP47IU4PTARHfFiUK45y6i7RwQYXgVZn9JoDM3W+XkPI5iPEPEATyCJTr48 HOHBKoIO3s8E1tB31GqfjnFmIvI+sfnyNErcJfWbPyz+lzk6bhrmAV9tWvWTElDitBNyMtcrE /nw5ALsfbLExblh5UGhOHQ2uC6108yz0eUy7apSIDNa5rgX00meSVXZPR78zyD0uggmsY5ucD VkoGTI2PltiXzWFHICPdnK3bkGqXL5Z0Vce6aLH6Vc9Zea+25eUhtIIP6A94NQTTFE8XAronH WfI2YM+T6hbasa7Gmv/S412YZJot2Tgwz+Q2lwX1qIcdhTjVTbyjlDvjRWHQdsIhR2mICxgJE Bw8X/o9kRGQaN3X9JC1CIYEHsuPZyPQnjYBH/4a80KApu/eVGNztSLllSfiGIX3mNFxnfKHOd DHt36lWR3wnKxVUDh7DdQl/87N9x2X2O9Q6+JJ1QLTULsRtXOlRhT+TwSNhG2Ub0GGtTkZa3E jyHeGe3ZBj+bR7qPT9nMsJtLr6/o3t26k1xbdQYYSowkC7oC+qFpz3cPNUwBIaukQsuKpSVoE a6OxgLI13fyHWNRDnPsF+A7xdgMCyygZ+k/QSX3mWeb+TTNxLPtRvZA1YFE1kver6JbACU4If wxOR78EAJ7zu1ExTKYfWAm57352UHhTpWexv9GOB2cuxephEghAJ7PqnbnA= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 18.06.19 07:37, Markus Elfring wrote: >>> Two function calls were combined in this function implementation. >>> Inline corresponding code so that extra error checks can be avoided here. >> >> What exactly is the purpose of this ? > > I suggest to take another look at the need and relevance of involved > error checks in the discussed function combination. Sorry, don't have the time for guessing and trying to reproduce your thoughts. That's why we have patch descriptions / commit messages. It would be a lot easier for all of us if you just desribe the exact problem you'd like to solve and your approach to do so. >> Looks like a notable code duplication ... > > This can be. I doubt that code duplication is appreciated, as this increases the maintenance overhead. (actually, we're usually trying to reduce that, eg. by using lots of generic helpers). >> I thought we usually try to reduce this, instead of introducing new ones. > > Would you like to check the software circumstances once more > for the generation of a similar code structure by a C compiler > (or optimiser)? As said: unfortunately, I don't have the time to do that - you'd have to tell us, what exactly you've got in mind. If it's just about some error checks which happen to be redundant in a particular case, you'll have to show that this case is a *really* hot path (eg. irq, syscall, scheduling, etc) - but I don't see that here. What's the exact scenario you're trying to optimize ? Any actual measurements on how your patch improves that ? Look, I understand that you'd like to squeeze out maximum performance, but this has to be practically maintainable. I could list a lot of things that I don't need in particular use cases and would like to introduce build knobs for, but I have to understand that maintainers have to be pretty reluctant towards those things. --mtx -- Enrico Weigelt, metux IT consult Free software and Linux embedded engineering info@metux.net -- +49-151-27565287