Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp903913pxk; Thu, 10 Sep 2020 01:26:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzV5gvN95AnJ2D1Fg5o3cEc9OKhe6BgwlhKYFS1YM5vWIR0bgLRLhq0bRoBeTnU/oDuR1WL X-Received: by 2002:a17:906:c154:: with SMTP id dp20mr7400973ejc.115.1599726416507; Thu, 10 Sep 2020 01:26:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599726416; cv=none; d=google.com; s=arc-20160816; b=xFk3p3o5jO+0Pm44mtrJcuyYE0+yjtlGB64yfd8NlOdFoXyh/JysVx3xpW5OPIVTIk 0uj2xyAF/7pLgWDPUSuuGLsUzErkZhjezdKLhJHXXf3TThFt5B15K2XlO+WjzITGQNlU om1HOzhY3Co++SpxlvbdSezIRWzwqUEPyEz0RZw9eSmPonIPI1h8eS95P/TA3zjtfsNV 11ZyzUpuKKNCdTK53rBaJBN9OZSPJZYLX7dtG0Tk+E6C9/ins+tMwsx8ceqY2/bVsMY0 4iFVn5iTJNuFSIbkvW8a4hm2mfznz05CQAQ/2KeHE7JZ3j2vQKx2APiFBgf3hxNCmk+k qeHw== 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:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date; bh=NA5jh12x5sxI7NLctSEYTqxgIHK+BOGvhBRKI4Zgm0k=; b=pt9yPg8TLVTTydGz9Dn0cqnwJ9adWIP3U8nltyrLBWY/pPAiUg6Aip2k/4LpprBSxo DBw0014TMtQwkk0egRt0dCkePRKF0vNFQt1daNFvxMy+ethobI9YE3HOit4SUvN25oGG e1mFeFu0G5a9KZjRnq8YpwN0OKGdR+HHcKrnHEzJR8xkz3fR+3qEor6YbgRLfcYiqjJi /E383CIKQ7JIts1jwYf2bsNZ5NHmoKbwA39rAyapxQsvCM1isi90ulF9M6HFLqVtva3t eb/qJp16nmptrgu5W56yTktYmcYLV4fFLoSEkjnPB/jDCIHyfIjB4q0D6AKJvkM9rQiU eLTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u20si3133345ejz.602.2020.09.10.01.26.33; Thu, 10 Sep 2020 01:26:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730369AbgIJIYp (ORCPT + 99 others); Thu, 10 Sep 2020 04:24:45 -0400 Received: from lhrrgout.huawei.com ([185.176.76.210]:2802 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726961AbgIJINp (ORCPT ); Thu, 10 Sep 2020 04:13:45 -0400 Received: from lhreml710-chm.china.huawei.com (unknown [172.18.7.108]) by Forcepoint Email with ESMTP id CCFBE850CD2915818418; Thu, 10 Sep 2020 09:13:43 +0100 (IST) Received: from localhost (10.52.121.43) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1913.5; Thu, 10 Sep 2020 09:13:43 +0100 Date: Thu, 10 Sep 2020 09:12:08 +0100 From: Jonathan Cameron To: Krzysztof Kozlowski CC: Andy Shevchenko , Lars-Peter Clausen , Tomasz Duszynski , "Michael Hennerich" , "linux-iio@vger.kernel.org" , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , Marek Vasut , "linux-samsung-soc@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Peter Meerwald-Stadler , "linux-amlogic@lists.infradead.org" , Peter Rosin , Jonathan Cameron Subject: Re: [PATCH v3 08/18] iio: adc: stm32: Simplify with dev_err_probe() Message-ID: <20200910091208.000055fa@Huawei.com> In-Reply-To: References: <20200829064726.26268-1-krzk@kernel.org> <20200829064726.26268-8-krzk@kernel.org> <20200909193600.41970d8c@archlinux> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; i686-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.52.121.43] X-ClientProxiedBy: lhreml712-chm.china.huawei.com (10.201.108.63) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 10 Sep 2020 08:58:57 +0200 Krzysztof Kozlowski wrote: > On Thu, 10 Sep 2020 at 08:52, Andy Shevchenko wrote: > > > > > > > > On Thursday, September 10, 2020, Peter Rosin wrote: > >> > >> Hi! > >> > >> On 2020-09-09 21:57, Krzysztof Kozlowski wrote: > >> > On Wed, 9 Sep 2020 at 20:36, Jonathan Cameron wrote: > >> >> > >> >> On Sat, 29 Aug 2020 08:47:16 +0200 > >> >> Krzysztof Kozlowski wrote: > >> >> > >> >>> Common pattern of handling deferred probe can be simplified with > >> >>> dev_err_probe(). Less code and also it prints the error value. > >> >>> > >> >>> Signed-off-by: Krzysztof Kozlowski > >> >>> Reviewed-by: Andy Shevchenko > >> >>> > >> >> I don't have the thread to hand, but this tripped a warning next > >> >> and the patch was dropped as a result. See below. oops. That is what I get for reading an email very quickly then looking at the code a few hours later. Still a problem here we need to fix unless I'm missing something. > >> > > >> > Thanks for letting me know. If you mean the warning caused by: > >> > https://lore.kernel.org/lkml/20200909073716.GA560912@kroah.com/ > >> > then the driver-core patch was dropped, not the iio one: > >> > https://lore.kernel.org/linux-next/20200909074130.GB561485@kroah.com/T/#t > >> > > >> > So we are good here :) > >> > >> No, we are definitely not good. See below. That means "See below", and > >> not "Please take a guess at what is being talking about". > > > > > > > >> > >> >>> @@ -596,12 +594,9 @@ static int stm32_adc_core_switches_probe(struct device *dev, > >> >>> priv->booster = devm_regulator_get_optional(dev, "booster"); > >> >>> if (IS_ERR(priv->booster)) { > >> >>> ret = PTR_ERR(priv->booster); > >> >>> - if (ret != -ENODEV) { > >> >>> - if (ret != -EPROBE_DEFER) > >> >>> - dev_err(dev, "can't get booster %d\n", > >> >>> - ret); > >> >>> - return ret; > >> >>> - } > >> >>> + if (ret != -ENODEV) > >> >>> + dev_err_probe(dev, ret, "can't get booster\n"); > >> >> > >> >> This tripped a warning and got the patch dropped because we no longer > >> >> return on error. > >> > >> As Jonathan already said, we no longer return in this hunk. I.e., you have > >> clobbered the error path. > > > > > > Exactly my point why I proposed _must_check in the first place. > > That was not exactly that point as you did not mention possible errors > but only "miss the opportunity to optimize". Optimization is different > things than a mistake. In this particular case we have introduced a bug. If the regulator returns an error other than -ENODEV we will carry on when really should error out. This includes deferred probe route in which it won't print a message but also won't actually defer. Jonathan > > Best regards, > Krzysztof > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel