Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp976934pxa; Thu, 27 Aug 2020 23:28:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkN63hvUxW6oWxXlUDhAgqR2K09KWIW3H5SdQO6gAC/lymoAqDZKp7mJkWYVtLP1WL/Z0s X-Received: by 2002:a17:906:c452:: with SMTP id ck18mr273909ejb.500.1598596087531; Thu, 27 Aug 2020 23:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598596087; cv=none; d=google.com; s=arc-20160816; b=I1WUf9DaEF7cJ4WzYuX6GuLPwJSAxwGNfH7AADh8r5YQul9jMDX0d9Cs4lgOS/Llw4 NMavKuF3JNptMjXDoHV74YSJYagkrws0tq5Z8uykSS7bbagiPR7i1QOmVDlPqV3ezyZA rx0Q55giauOCLkzmJYxjAu9pzoRFhWR84UcixhyYSalFf67oMEpiiEnEu5GUy7ECw24v qv70YsLeLM4y7xwd2S1q5ZnYqECOsf76C31nXZfQlknBrF9AeyjFhWKkK4UkzW6XZhvY 7g6Cw6DVKWHACPIAchQ+LW9Sf2wzwlXH6YywXfcYIp3FDDCNWemfQdiMoM1tI69hUB9t JuSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=p5CxlDCkzVcslzoI2Y1jCiSF6kba4WwnH5Gi/cefvyw=; b=U/r3hCtc9THiWXxC4nS4CLyHI7NVarOePJUQdndIv7lXKaGyBS1fkfTxjYGo/uK7Dz cHn91yRRIfYaWysiB6ix0QV2nMp5+M4oGEA9KbnKblbjzSReWd88/Zsc1+ODgEwIu3OH YUHP0kRTgUtfBalLNR0R1SfWLQriLcht6Jg+b7zN6OgkoaWBdL0XaUz9MmnoYz5gi11I GBnXgkCXLvowCQG9h6c23ow/oXfKc3dpbuQszahdWpIVrJ6MXWNvZocCM5usUAPlCMen FxCxCzSo9QBDDN9m8kM7soBxZ6sIT+rKtJ8Kz8ZqKBCJ3yGwgjsxCg+NYI0c3mfjwhcq m8Rw== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si2955484edv.515.2020.08.27.23.27.42; Thu, 27 Aug 2020 23:28:07 -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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728310AbgH1GYt (ORCPT + 99 others); Fri, 28 Aug 2020 02:24:49 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:38138 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725858AbgH1GYt (ORCPT ); Fri, 28 Aug 2020 02:24:49 -0400 Received: by mail-ed1-f68.google.com with SMTP id b2so143178edw.5; Thu, 27 Aug 2020 23:24:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=p5CxlDCkzVcslzoI2Y1jCiSF6kba4WwnH5Gi/cefvyw=; b=A7xZo3sEwDq1/H+BBUomIsJU6WyFanOBQUHo3TMTDGltE2kvlvsXNSPA0QOdqvP83/ MimFnYqP80AjRw6Q4twPkuVoW56FbenTNB5lSCcPHpFPtltCDFlHKLSM0rqWP3/f5EzH NSzuugftvm04cHpd+oA84iibgy+kSXWdMCkkBge+gx7o1+EUWd3VBtuVkAF81D2dLYYT fhiKHZ7EHl00p8PZCBvLpsXv9Ueq/ZpWgp9IX9VDv04o9bXMnnDqwpKgTp+qidI9kTMM Jqbc3SxUL+OoE48h382crlhxo73Crpilsn+d9assNp1uvJZaLtMLs1/8MHcWNxshXGAp A+EQ== X-Gm-Message-State: AOAM532eBVHFBCmXnm2a5k2doo2qW9pkBNHtHoAczzUJRoy3CqLZJQSq OkbPcEKXENioM2BgkbnMz7g= X-Received: by 2002:a05:6402:2039:: with SMTP id ay25mr310806edb.87.1598595886637; Thu, 27 Aug 2020 23:24:46 -0700 (PDT) Received: from pi3 ([194.230.155.216]) by smtp.googlemail.com with ESMTPSA id w20sm3809310ejc.77.2020.08.27.23.24.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Aug 2020 23:24:46 -0700 (PDT) Date: Fri, 28 Aug 2020 08:24:43 +0200 From: Krzysztof Kozlowski To: Peter Rosin Cc: Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Kukjin Kim , Michael Hennerich , Kevin Hilman , Neil Armstrong , Jerome Brunet , Martin Blumenstingl , Marek Vasut , Maxime Coquelin , Alexandre Torgue , Beniamin Bia , Tomasz Duszynski , Linus Walleij , Andy Shevchenko , 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 Subject: Re: [PATCH v2 09/18] iio: afe: iio-rescale: Simplify with dev_err_probe() Message-ID: <20200828062443.GA17343@pi3> References: <20200827192642.1725-1-krzk@kernel.org> <20200827192642.1725-9-krzk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 27, 2020 at 11:46:40PM +0200, Peter Rosin wrote: > On 2020-08-27 21:26, 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 > > > > --- > > > > Changes since v1: > > 1. Wrap dev_err_probe() lines at 100 character > > --- > > drivers/iio/afe/iio-rescale.c | 7 ++----- > > 1 file changed, 2 insertions(+), 5 deletions(-) > > > > diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c > > index 69c0f277ada0..8cd9645c50e8 100644 > > --- a/drivers/iio/afe/iio-rescale.c > > +++ b/drivers/iio/afe/iio-rescale.c > > @@ -276,11 +276,8 @@ static int rescale_probe(struct platform_device *pdev) > > int ret; > > > > source = devm_iio_channel_get(dev, NULL); > > - if (IS_ERR(source)) { > > - if (PTR_ERR(source) != -EPROBE_DEFER) > > - dev_err(dev, "failed to get source channel\n"); > > - return PTR_ERR(source); > > - } > > + if (IS_ERR(source)) > > + return dev_err_probe(dev, PTR_ERR(source), "failed to get source channel\n"); > > Hi! > > Sorry to be a pain...but... > > I'm not a huge fan of adding *one* odd line breaking the 80 column > recommendation to any file. I like to be able to fit multiple > windows side by side in a meaningful way. Also, I don't like having > a shitload of emptiness on my screen, which is what happens when some > lines are longer and you want to see it all. I strongly believe that > the 80 column rule/recommendation is still as valid as it ever was. > It's just hard to read longish lines; there's a reason newspapers > columns are quite narrow... > > Same comment for the envelope-detector (3/18). > > You will probably never look at these files again, but *I* might have > to revisit them for one reason or another, and these long lines will > annoy me when that happens. Initially I posted it with 80-characters wrap. Then I received a comment - better to stick to the new 100, as checkpatch accepts it. Now you write, better to go back to 80. Maybe then someone else will write to me, better to go to 100. And another person will reply, no, coding style still mentions 80, so keep it at 80. Sure guys, please first decide which one you prefer, then I will wrap it accordingly. :) Otherwise I will just jump from one to another depending on one person's personal preference. If there is no consensus among discussing people, I find this 100 line more readable, already got review, checkpatch accepts it so if subsystem maintainer likes it, I prefer to leave it like this. > You did wrap the lines for dpot-dac (12/18) - which is excellent - but > that makes me curious as to what the difference is? Didn't fit into limit of 100. Best regards, Krzysztof