From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034866AbdAGBYz (ORCPT ); Fri, 6 Jan 2017 20:24:55 -0500 Received: from mleia.com ([178.79.152.223]:49996 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751662AbdAGBYr (ORCPT ); Fri, 6 Jan 2017 20:24:47 -0500 Subject: Re: [PATCH] i2c: core: helper function to detect slave mode To: Andy Shevchenko References: <73246c4a-504c-52d7-dde4-970a45dca0bd@mleia.com> Cc: Luis Oliveira , Wolfram Sang , Rob Herring , Mark Rutland , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , linux-i2c@vger.kernel.org, devicetree , "linux-kernel@vger.kernel.org" , Ramiro.Oliveira@synopsys.com, Joao Pinto , CARLOS.PALMINHA@synopsys.com From: Vladimir Zapolskiy Message-ID: <3748130b-5321-12eb-ec75-e2637dd9fc54@mleia.com> Date: Sat, 7 Jan 2017 03:24:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20170107_012443_143330_C352A88D X-CRM114-Status: GOOD ( 21.18 ) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/07/2017 02:19 AM, Andy Shevchenko wrote: > On Sat, Jan 7, 2017 at 1:43 AM, Vladimir Zapolskiy wrote: >> On 01/07/2017 12:45 AM, Andy Shevchenko wrote: >>> On Fri, Jan 6, 2017 at 11:46 PM, Vladimir Zapolskiy wrote: >>>>> + if (IS_BUILTIN(CONFIG_OF) && dev->of_node) { >>>> >>>> IS_BUILTIN(CONFIG_OF) looks excessive, check for non-NULL dev->of_node >>>> should be sufficient. >>> >>> Sorry, but you missed the point. >>> This will enable compile time optimization and basically be collapsed to no-op. >>> >> >> Good point, do you plan to add more "IS_BUILTIN(CONFIG_OF)" checks all >> over the code to reduce the size of the built image? > > There is no black and white, don't be silly. > >> >>>>> + } >>>>> + } else if (IS_BUILTIN(CONFIG_ACPI) && ACPI_HANDLE(dev)) { >>>>> + dev_dbg(dev, "ACPI slave is not supported yet\n"); >>>>> + } >>>> >>>> If so, then it might be better to drop else-if stub for now. >>> >>> Please, don't. >>> >> >> Why do you ask for this stub to be added? > > 1. Exactly the reason you asked above. Here is the code which has > built differently on different platforms. x86 usually is not using > CONFIG_OF, ARM doesn't ACPI (versus ARM64). Check GPIO library for > existing examples. >>From the context by the stub I mean dev_dbg() in i2c_slave_mode_detect() function, I don't see a connection to GPIO library, please clarify. > 2. We might add that support later, but here is again, just no-op. > > So, what is your strong argument here against that? > When the support is ready for ACPI case, you'll remove the added dev_dbg(), and I don't see a good point by adding it temporarily. What is wrong with the approach of adding the ACPI case handling branch when it is ready and remove any kind of stubs right now? On ACPI platforms the function returns 'false' always, will the function work correctly (= corresponding to its description) as is? PS, if it is possible, please give up on arrogance in discussion. -- With best wishes, Vladimir From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vladimir Zapolskiy Subject: Re: [PATCH] i2c: core: helper function to detect slave mode Date: Sat, 7 Jan 2017 03:24:40 +0200 Message-ID: <3748130b-5321-12eb-ec75-e2637dd9fc54@mleia.com> References: <73246c4a-504c-52d7-dde4-970a45dca0bd@mleia.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Andy Shevchenko Cc: Luis Oliveira , Wolfram Sang , Rob Herring , Mark Rutland , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Ramiro.Oliveira-HKixBCOQz3hWk0Htik3J/w@public.gmane.org, Joao Pinto , CARLOS.PALMINHA-HKixBCOQz3hWk0Htik3J/w@public.gmane.org List-Id: devicetree@vger.kernel.org On 01/07/2017 02:19 AM, Andy Shevchenko wrote: > On Sat, Jan 7, 2017 at 1:43 AM, Vladimir Zapolskiy wrote: >> On 01/07/2017 12:45 AM, Andy Shevchenko wrote: >>> On Fri, Jan 6, 2017 at 11:46 PM, Vladimir Zapolskiy wrote: >>>>> + if (IS_BUILTIN(CONFIG_OF) && dev->of_node) { >>>> >>>> IS_BUILTIN(CONFIG_OF) looks excessive, check for non-NULL dev->of_node >>>> should be sufficient. >>> >>> Sorry, but you missed the point. >>> This will enable compile time optimization and basically be collapsed to no-op. >>> >> >> Good point, do you plan to add more "IS_BUILTIN(CONFIG_OF)" checks all >> over the code to reduce the size of the built image? > > There is no black and white, don't be silly. > >> >>>>> + } >>>>> + } else if (IS_BUILTIN(CONFIG_ACPI) && ACPI_HANDLE(dev)) { >>>>> + dev_dbg(dev, "ACPI slave is not supported yet\n"); >>>>> + } >>>> >>>> If so, then it might be better to drop else-if stub for now. >>> >>> Please, don't. >>> >> >> Why do you ask for this stub to be added? > > 1. Exactly the reason you asked above. Here is the code which has > built differently on different platforms. x86 usually is not using > CONFIG_OF, ARM doesn't ACPI (versus ARM64). Check GPIO library for > existing examples. >>From the context by the stub I mean dev_dbg() in i2c_slave_mode_detect() function, I don't see a connection to GPIO library, please clarify. > 2. We might add that support later, but here is again, just no-op. > > So, what is your strong argument here against that? > When the support is ready for ACPI case, you'll remove the added dev_dbg(), and I don't see a good point by adding it temporarily. What is wrong with the approach of adding the ACPI case handling branch when it is ready and remove any kind of stubs right now? On ACPI platforms the function returns 'false' always, will the function work correctly (= corresponding to its description) as is? PS, if it is possible, please give up on arrogance in discussion. -- With best wishes, Vladimir -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html