Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp48007rwp; Wed, 12 Jul 2023 09:28:55 -0700 (PDT) X-Google-Smtp-Source: APBJJlFaaO8ZYkMSebgXrab2+hY24B9TQdrtwxiVE3z2WN7+AzWC03vXsNg+qFIhnrNwNULexYPS X-Received: by 2002:a2e:b0cd:0:b0:2b6:e332:d089 with SMTP id g13-20020a2eb0cd000000b002b6e332d089mr16838863ljl.41.1689179335655; Wed, 12 Jul 2023 09:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689179335; cv=none; d=google.com; s=arc-20160816; b=UUWpQnXyecWdkp2QdosVDbq+clR+bGCWYDxfPNuzwYpzylUZ5Z2avkdfVaqrN0N5BR XAxcq/dPKnMeIGR0DkKMkkQvTndVrulmWeNz6h2rO7GIwfQSMo+7hm5WhRHM7P478uNV KOq1HFEcabTAjpP95X7BnVB+24/+Q1co/Ko2guWWHch4Tkj3axdrzVBqaFCAPisW+PWv jv8F6uiFBkdxhyQ8wyWPBdraI7wgIWfTMmuU/c/4JbsIOIwS4TK1wyzQFDL9hNrUdrmr IhTjOkRH+EVDGgfu7eIH2fAYnMi9lbbTk5DMJG6P3fXeitELO7h/WjhrfatDk7qNwzPl eKUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:in-reply-to:date:subject :cc:to:from:user-agent:references:dkim-signature; bh=6YY5K6Pv6QqKIIYQnBoSV5Kj79iqnwblWu7VX/RxeuA=; fh=D3wmJsKoiZaAroXvj+ZPbhHLSVxAKBdnBcov5pc5hiM=; b=ba4ujeOmOrJlGZTLl+RAmGAYDfE7PMdZoQ6RV347JmrtYK3642aarceWngKvUWdik8 wAEyq5zyTpEw5w7obkcPF4A9J3ERCfMgB7T2UQNXAwc4uHF7I8cd0OqPP7jMlMYQ4AZV VWNZjcRzDAtXRqMWVK5MmhrT/AOusJ8ngBZtfEYMIN8LhRMFvbILg2JGSccqgEoGxM5L PPlRRtIQiiGx7P9/3JPnnxakzLMKPt9jD4Gt37Vol9Lz+xOa9Kcw9Sh5kqZPrWszCW4b p1zs5POdoSqctE2+ZokHimNtEiePOzVwGLcr0xStaRJGBVN707KUct3IklPkI6cJz8t4 rWmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=lg+bEeOl; 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=axis.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k18-20020a170906a39200b0099392706398si5219373ejz.231.2023.07.12.09.28.31; Wed, 12 Jul 2023 09:28:55 -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 (test mode) header.i=@axis.com header.s=axis-central1 header.b=lg+bEeOl; 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=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233744AbjGLPjy (ORCPT + 99 others); Wed, 12 Jul 2023 11:39:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233742AbjGLPjw (ORCPT ); Wed, 12 Jul 2023 11:39:52 -0400 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20F291BB; Wed, 12 Jul 2023 08:39:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1689176391; x=1720712391; h=references:from:to:cc:subject:date:in-reply-to: message-id:mime-version; bh=6YY5K6Pv6QqKIIYQnBoSV5Kj79iqnwblWu7VX/RxeuA=; b=lg+bEeOl87Tju5BnH1hQxTURXL31LjrUMXE95iZD95QrBob+doYrKwK/ mY5rnWKU/tn4Qn3bkJo9qvZFovQHCGiQenJAFQd3V4xDN4AGFL+ix4Wni Z4j1ILH+sRM9H0u4vZas1cizi+yNKMTq099MNj0frDJc8NkRSFM/9Oq0B RM0TvKYbTk7sAIC7QCaH//MiiS34kgWF+WTj3qO4yxK1lCs9yfWGNQYFY IRZfadoP0eO5oljD5rKKzqA2CjJpzOJW7+mp4FVNLsd++Qdk3puh10tBD ZT5jBsMb97Gb1LIpauYNcl612yvRpYeQG1qVHFGeHeOEK/sFG9IjnRuSD w==; References: <20230617143508.28309834@jic23-huawei> <20230625120604.3ecc54bf@jic23-huawei> User-agent: a.out From: Waqar Hameed To: Jonathan Cameron CC: Lars-Peter Clausen , , , Subject: Re: [PATCH 2/2] iio: Add driver for Murata IRS-D200 Date: Wed, 12 Jul 2023 17:33:09 +0200 In-Reply-To: <20230625120604.3ecc54bf@jic23-huawei> Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail01w.axis.com (10.20.40.7) To se-mail01w.axis.com (10.20.40.7) X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 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!