Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp3828629rwp; Sat, 15 Jul 2023 10:09:46 -0700 (PDT) X-Google-Smtp-Source: APBJJlHl5X4JBAr5GzeJ2tz6C+ufX3FLz9KZKKWex8Q2RBIdULsYBpDQkn/c1d2sxvwfzuRnwa7T X-Received: by 2002:a17:902:e807:b0:1b8:17e8:5472 with SMTP id u7-20020a170902e80700b001b817e85472mr2709064plg.1.1689440986526; Sat, 15 Jul 2023 10:09:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689440986; cv=none; d=google.com; s=arc-20160816; b=BK7MswP3xcNXYQe403HttoBe5MObGs0cRa+Vo/S2zVJOA6/BQS9ErViuIWYuRZqdji DvvYq4SVqHejpKAMVsmOVbMk7MK6brCYsGEl4CZvD1KvUaqbtbRhhI8UdTrbPEY046Ij ermB6T4flUWKIvoTjaI077vg7vdqYq3JrvrSoDz/DOU07LTOtBm7lM7n12S76FSRmV/U 8Ts/O/IuUCZbJUf52Bq3bR3IOs3W5+eAOutAraBSuBZeESz77bsUoiF68O4nrQvL4td7 JI0SlYbkotDZXy0a1Qn9O8PUnyyQN8OnofIQa28juWAaKsNuMkp/kUkVKBv1PEt3heVR 28gA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/a/OinbW3iD3+qkYPPdGVBEeVsj6H/9zjpFoe9J1mzU=; fh=c5ZO+eiGAp9EssQerSkC8VHC2SPAjSvcsSZOvhkikVg=; b=GpHQB10Vl9w/0F4j1tt+X1k1bEukntj+eU+So6MJW+N0XL5CSETA8FUo4BgtrxH3Y+ /TrdqNmi9sjr3NLI6KT0moAEjqtmqzrjgWRJVMac0uGYBOnVPMjbndYUr+KmYi/lWFHf jIBlVU/wmABqndIquYhygTtIQsGlY5nyfq1/GicVEaT9TqCMPrsJHCRPRVS0PaYUGUom jEM2Yww71TbJvg9d9f2mQqJfN1ZEFryPuPTLfuDpNQYrSWPIgVymLscRYKbz4K8wlTww HbimL7cu4jPdoB58mqXhGpOvErH8DpnuAhagZI3zq0FLvwu/kORkdLh2koxhyMl0T345 KN0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lxRIPk2T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a170902cf4600b001b074fbdce3si8535267plg.478.2023.07.15.10.09.33; Sat, 15 Jul 2023 10:09:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lxRIPk2T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S229986AbjGOQvs (ORCPT + 99 others); Sat, 15 Jul 2023 12:51:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52226 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229483AbjGOQvr (ORCPT ); Sat, 15 Jul 2023 12:51:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02B9C2120; Sat, 15 Jul 2023 09:51:47 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A90760BB1; Sat, 15 Jul 2023 16:51:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1D1DC433C8; Sat, 15 Jul 2023 16:51:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1689439906; bh=YlFK3AHkaic1SjsI95VZzhKDCOhIMferUe25/lIzgeI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=lxRIPk2TJiryZ5c5zEwpaL3ln/exBHBaXxHSQ6dOS5b+H1yedjsaTfaLSGepgYC67 BbSzY8EckW1OnIlEX9cHumPwrx82JdFtTkRh6SEV//Vl9cCA+Pg+wO7IXiYVuLmYJk 4hoboHrWn3MX4YxwVTRrxuFIkjVIrhf7Vfsgp68QjY5n7jE7BJuq0x1bR4INmSUHt0 Z9jHXGddicgKVn418mVeOJXQ6X8AIfqMfTgwjFahRnZApf0u2E92Cb8Y4D+/Bis+7Q 18i/F+3QX1tGgSsLyXXhEWDLrf3mUOvWoZjzwxeEZ85I9S/iXCTZzcBPr2kzT2ghPn vPgg/bIW1627A== Date: Sat, 15 Jul 2023 17:51:39 +0100 From: Jonathan Cameron To: Waqar Hameed Cc: Lars-Peter Clausen , , , Subject: Re: [PATCH 2/2] iio: Add driver for Murata IRS-D200 Message-ID: <20230715175139.2b0ebaae@jic23-huawei> In-Reply-To: References: <20230617143508.28309834@jic23-huawei> <20230625120604.3ecc54bf@jic23-huawei> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 12 Jul 2023 17:33:09 +0200 Waqar Hameed wrote: > On Sun, Jun 25, 2023 at 12:06 +0100 Jonathan Cameron wrote: > > [...] > > >> >> + dev_err(data->dev, "Could not write hp filter frequency (%d)\n", > >> >> + ret); > >> >> + return ret; > >> > > >> > drop this return ret out of the if block here. > >> > > >> > In general being able to ignore possibility of ret > 0 simplifies handling. > >> > >> I try to be consistent and it also "helps" the next person potentially > >> adding code after the `if`-statement and forgetting about adding > >> `return`. We can drop the `return here, but then we should do the same > >> in other places with a check just before the last `return` (like > >> `irsd200_write_timer()`, `irsd200_read_nr_count()`, > >> `irsd200_write_nr_count()` and many more), right? > > > > I don't feel particulartly strongly about this, but there are scripts > > that get used to scan for this pattern to simplify the code. > > > > Sure on the other cases. I don't tend to try and label all cases of things > > pointed out, just pick on one and rely on the patch author to generalise. > > I started to remove the returns but then realized that it got a little > messy. For example, in some cases we can't drop the return (side effects > after the return etc.). > > Since you didn't have any strong opinions on this, I kept them in v2. > Hope that's fine! Absolutely. I wasn't advocating removing separate returns in general, just this cases where there was nothing after the if check. Thanks, Jonathan