Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp1890676rwo; Sun, 23 Jul 2023 03:07:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlHp0vObzzOcUlfTjskyKYjAs3VC44HRYCQ1P5zXslWRbxlFiyPSkWIW+Aac1vygY3DzWB83 X-Received: by 2002:a17:906:7386:b0:99a:8053:158 with SMTP id f6-20020a170906738600b0099a80530158mr6820575ejl.68.1690106843346; Sun, 23 Jul 2023 03:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690106843; cv=none; d=google.com; s=arc-20160816; b=SBZdiVxBH4I11ubnph5fT3k9pQmMf4kfijqabPJjaK4f54brScR6bpfzG2AosIFifK /buUyx9fSxRJC/l//NIi1pDCjZiO3aAaLYEgNN8HfS2nOAs/UVllFB1t1tnKmPMYXsj5 mdyeS0csULtoLe2spkKmu0oz3L4ECH/+o6YWP3gWgP8HiRqySZO1U44wFnKkj0r2/fTb 2ECseK/i1flB1UR7wxm09X4xPzsV7U63VHJHB8MD9C9P09GFix5zUQMIF/pOu/wgTPKR CFln3ThzXQOVUbdgQ2xpV8c1jwTg50XwINNEAXDElLOMdkbaF9/hbT0yX+hx8xtbTU1C UYRA== 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=qFOnK4CVRdSgEemJInFv6Arkm6b2d8fe3ZvRb3gTyPs=; fh=hXZqJJZJy2kBvSIwtK1y24jCZlpvbojtkV5YMKVmUAQ=; b=hWtReUCyDTBigQD9Vy5dT4lno2RSrFU/Gyk1sQ9KjGRTTtXXTKNFw7wrCFghz6uPbF AG5QjPIYPeGQW2Vhga3kDPAc3iMdqExcx99E+8bfS6JGdQwRPIx2w1oEtLfhKvpQF3G2 FXPetd4iwOAWp3NXlJAkGdsR8eY6NkYxq5CWFBGEEMeCMLkfDBAiB5QpyXp40K0G4GZS /LqasU4d1VzGWReL48Z92HPB1hxPA1n9R6RdN+2eo6rbKgZLrxw6rhbzXtDeSFW7P2/P P7uX90zIEplFI1dT5UhzphRsOZjtOHft6Lh/O3g18CqlnZIWYHNybC/mnTzxJSctyJAQ a/HQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DCKWREIY; 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 m5-20020a170906258500b00992d8355decsi4773223ejb.249.2023.07.23.03.06.59; Sun, 23 Jul 2023 03:07:23 -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=DCKWREIY; 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 S229554AbjGWJQO (ORCPT + 99 others); Sun, 23 Jul 2023 05:16:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229468AbjGWJQM (ORCPT ); Sun, 23 Jul 2023 05:16:12 -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 209B019B; Sun, 23 Jul 2023 02:16:08 -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 9EA8660C6E; Sun, 23 Jul 2023 09:16:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CFB23C433C8; Sun, 23 Jul 2023 09:16:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690103767; bh=YR0xW1wnhiUCWmh+Rs4nFneJQ5jzk2gDscX++ESLFCc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=DCKWREIYTcvr396gebzgilZ5A5CvBGpmfuvvbCWgYgmfYSUlva8Gu2AQ6x23zWnuM byJKjEk25YmtS8/uCoQ/omA0aDt7+QPZ5yetw3SuzHXtkgkBeqlz6TA26uhOwX+/NX G0v0U71OEQlHqL0AZtiG3FhR6YFBCyPqizQFOJJtj8WXabZgrGW7XYGc5MOnaR7bWW kYMKDhHg5faklxfS2O8c8AdcJkA2kHfirHZyUC4sc1/d285SJvx0+AXYjuuf3MmqhK AqdhFpDlElcELPxtumls1ePjoHN0e1yR7V9XsiucMusnLaos1rxZWpbowsvf0rYjYw +PiCjIcAhnZIQ== Date: Sun, 23 Jul 2023 10:16:06 +0100 From: Jonathan Cameron To: Andy Shevchenko Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Lars-Peter Clausen , Nuno Sa Subject: Re: [PATCH v2 5/8] iio: core: Get rid of redundant 'else' Message-ID: <20230723101606.0bc28e72@jic23-huawei> In-Reply-To: <20230721170022.3461-6-andriy.shevchenko@linux.intel.com> References: <20230721170022.3461-1-andriy.shevchenko@linux.intel.com> <20230721170022.3461-6-andriy.shevchenko@linux.intel.com> 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 Fri, 21 Jul 2023 20:00:19 +0300 Andy Shevchenko wrote: > In the snippets like the following > > if (...) > return / goto / break / continue ...; > else > ... > > the 'else' is redundant. Get rid of it. > > Signed-off-by: Andy Shevchenko > Reviewed-by: Nuno Sa Applied. Thanks, Jonathan > --- > drivers/iio/industrialio-core.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/industrialio-core.c b/drivers/iio/industrialio-core.c > index 78cc67efa490..66cea23df7e0 100644 > --- a/drivers/iio/industrialio-core.c > +++ b/drivers/iio/industrialio-core.c > @@ -524,7 +524,7 @@ ssize_t iio_enum_read(struct iio_dev *indio_dev, > i = e->get(indio_dev, chan); > if (i < 0) > return i; > - else if (i >= e->num_items || !e->items[i]) > + if (i >= e->num_items || !e->items[i]) > return -EINVAL; > > return sysfs_emit(buf, "%s\n", e->items[i]); > @@ -1217,7 +1217,7 @@ static int iio_device_add_info_mask_type(struct iio_dev *indio_dev, > &iio_dev_opaque->channel_attr_list); > if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE)) > continue; > - else if (ret < 0) > + if (ret < 0) > return ret; > attrcount++; > } > @@ -1255,7 +1255,7 @@ static int iio_device_add_info_mask_type_avail(struct iio_dev *indio_dev, > kfree(avail_postfix); > if ((ret == -EBUSY) && (shared_by != IIO_SEPARATE)) > continue; > - else if (ret < 0) > + if (ret < 0) > return ret; > attrcount++; > }