Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp999369pxk; Thu, 10 Sep 2020 04:36:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4SoX7YkIYl6zHtinF0zBPJTjOBCuLJKEhKBN5U+C0q1fPMGuFOSgpyicKifDatASvxD+7 X-Received: by 2002:a17:906:7d0d:: with SMTP id u13mr8719685ejo.448.1599737778037; Thu, 10 Sep 2020 04:36:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599737778; cv=none; d=google.com; s=arc-20160816; b=z4a2YT2ClBhdCnl4GlUaiNpMoGxoi4ZD7v5LcpDQCfsIkENSOGnOw6w3QcfMfuu5B6 9KCj77cOwjecr3CR/utpic79Y5GT9hbWL3kj9T4rSvmAHdRYCxliiSzah/SNNQ1opUwX +U3OSEsOH9xOeNeHEWn+DHjVDNhhPt9tVSJg3kDiivxgQnUddWZJxab+wdKAPJMDpT7W 3b8PKpc8jQTRqCmRvNGbBIO1hwnxyb+Hr8ym9cbXsXIF/96BB9ZOFoYoTnO0FEyWi/XW z5pXITnwnEyrooAW192PeIs3v3ls0CgGkjBwZZUVjURz13WJidjTU/7QjUv1YmlrSesl s0Wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=T1jU/BIULwBFdkoPS5XoMOevUkSDj3Vui3wyMh4knhM=; b=kdSbOi3Pnykew3m41ZFgaTpTwGbNgg+4vKkyo/qPCWA6sBJX0xHVkeRZ8+S783aZ9U BJXiiC//5uomIclOO32ptAbLRHDdrhEWFulQBbE8zvdPbXBlKU71MWZ0+Wr/dxYcc5tc ZW4I9Km3JTMX/1UfoLYra0LQa4CKWRivHNVYYSMgvnvM1vdG5Lha4MxgXahVO9jS6IWK nogZj9V68qIiIAkMS/LB1nC4wpGJKZ4r2BaScz2M5i51gDfmpN0HDy3yuljvf7GG6rUD EyjdsKoKCElK1ewpawFNweNBYKsxmv0fvqe1w1hHTpov1eD1OFLD4pellCJd45vfbLdJ HmGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kOioGQ5e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q12si3310282ejr.111.2020.09.10.04.35.55; Thu, 10 Sep 2020 04:36:18 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kOioGQ5e; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729876AbgIJLeg (ORCPT + 99 others); Thu, 10 Sep 2020 07:34:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55202 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730255AbgIJLYn (ORCPT ); Thu, 10 Sep 2020 07:24:43 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAEB4C061756; Thu, 10 Sep 2020 04:23:28 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id 5so4083897pgl.4; Thu, 10 Sep 2020 04:23:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=T1jU/BIULwBFdkoPS5XoMOevUkSDj3Vui3wyMh4knhM=; b=kOioGQ5evJcV7vpyJ2QT+b8KV74xlfj4V9gz+Gi9EJKijWhwcOR2jiYEUVAY3td3LW Y08bH84CTpx8e1jVbrmjV040DNvqg3GLneTw00f6P/lqlxejHGjOK+XxxAmKjlnNDMUH 1CL7nWgoCi8F9/LMTe4G7vr7hXTULJuAKlEwrpISSp9qOTNqMRqGI9sibilZLgXT+U+x 2S9vALT5XO91HHsPu7PAVi5LsQ35l8W0H5GMW5/W5UKQpM5mlE55S8I4sHH4fIZRCb4C elah9RPrcRcUVGWbTbX8KVhKd0AbE/DLcWiRSNsdVPZ47jX+2LBSaOScguSScmKG/Vhc cwPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=T1jU/BIULwBFdkoPS5XoMOevUkSDj3Vui3wyMh4knhM=; b=gVxhj0EYehb9J6fqyMhcyjfcM81GEFbREy+Dq1hW3kurKWHHzgvljrUSyYu+oNF4hK Od583C2k3iiGlBmRDWKzdDXdFFk4/pXYlxvKpEN3/52LncE9NjXzJjfcieyhp6/DTg+9 qHm4Aovw92QtNHsmsX2DS9ygyV/b/P+SvxCh3EodYn06i8IsGUpaXDBnijnDMCaYah0y S72R6qEDBTHaLx8G/NQboOHwyTN056RFZGxWqQ/+NxNMQV52BuSbqc7Wz71YoX5JJpmk 0fbx/2MZWCGatSG7EPql7Hb4v4/MhQrUgcDcnYQ+fv6frlqUGEctk9RHxUVEd3ZbA7Q3 gDOQ== X-Gm-Message-State: AOAM533ScDMQMj108uJ9jfPb5mLA5ar0Kbrk2pN7qd3m14vTlfol+Eh8 hMraFpNhWs5Ij/6vA1pURe62rVWXE4NwKwYRixQ= X-Received: by 2002:a63:ec4c:: with SMTP id r12mr4011616pgj.74.1599737008099; Thu, 10 Sep 2020 04:23:28 -0700 (PDT) MIME-Version: 1.0 References: <20200829064726.26268-1-krzk@kernel.org> <20200829064726.26268-8-krzk@kernel.org> <20200909193600.41970d8c@archlinux> In-Reply-To: From: Andy Shevchenko Date: Thu, 10 Sep 2020 14:23:10 +0300 Message-ID: Subject: Re: [PATCH v3 08/18] iio: adc: stm32: Simplify with dev_err_probe() To: Krzysztof Kozlowski Cc: Peter Rosin , Jonathan Cameron , Lars-Peter Clausen , Peter Meerwald-Stadler , Michael Hennerich , Marek Vasut , Tomasz Duszynski , "linux-iio@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-samsung-soc@vger.kernel.org" , "linux-amlogic@lists.infradead.org" , "linux-stm32@st-md-mailman.stormreply.com" , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 10, 2020 at 9:59 AM Krzysztof Kozlowski wrote: > On Thu, 10 Sep 2020 at 08:52, Andy Shevchenko wrote: > > On Thursday, September 10, 2020, Peter Rosin wrote: > >> 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: ... > >> >>> @@ -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. Yes, and that's what happened here. You missed optimization which led to an error. And this is a good showcase to see how dev_err_probe() may be misused because of overlooking subtle details. Perhaps we can do static inline __must_check dev_err_probe_ret(...) { return dev_err_probe(...); } (or other way around, introduce dev_err_probe_noret(), yes, name sucks) -- With Best Regards, Andy Shevchenko