Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2432813ioo; Sat, 28 May 2022 13:30:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLLCbChqvKFC7laKj3V0xMAEYKx9AXNHUe+QctFVWir3FjRnf2PGDkbdUVg3e/XUo+ldiT X-Received: by 2002:a17:902:e552:b0:163:6a5e:4e08 with SMTP id n18-20020a170902e55200b001636a5e4e08mr16433729plf.130.1653769827840; Sat, 28 May 2022 13:30:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653769827; cv=none; d=google.com; s=arc-20160816; b=UZ2F6siDYy8UeWVV6NRwL0msoPnTF4qNesZWAtwXpIsWXFVoTbvTKxQwutTBeECdUV R39HCjAEKBR23WgSxTuVVLpSyLwR7A+HB3GBDH2OLZGUiDXz6CCCppM4myMvTgVWBvEX gZjLvP91xYHWmGYpLUNDNdyjkjNAiRRSO5fSFEv6gzOlQU3R8sM0jNX/mygXFkuuFNgz iMFsDH+DL7CAdaBfbHC74jF25VGeLD6gSrQKOrlh1PNegcxGreZEMPX95RDfSeCJtka0 /9XFR7LXlN2MsMYpxrHjS/yu/DZQ900q1WqoqhYi8jnN8mAAcchVXoBQ58jiK5nVEU2o xyBw== 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=VoRhLutGofXX3rwf/qGiTPljPE82fElQZe4nMtMzP0A=; b=sw0UPjVvkH6AsJwv+/fZi9iDGpQsDjD/2ZN2aXV1NtbPdbDJ/du5vSMmjIGAKMl1md TbO9MuoWvTh1IPstRM13CGa649Qvsny+y2vQ8f72wb2WQoJEMwiEQFMNe2s4wxYZ8D4u z1zuj+b73zm07k7EM0/yWBtbENcbDu2fYVmTqr+692CGui6FDFtF0ElP8d4SsAOcLhVo SAHMsGCBejLj6czsZuU9gR192hyXinMbQkjQxBkj5T/i5kj8cITBUnJzvI7/myAgP5d8 PKSuOH15IhIq3ohY5siDW47OR4fLn9UaiMhTziLJowyjAJg7P08scIg8qIqQxJO57gTq XxAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fflB+u6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k62-20020a638441000000b003c66e022eddsi1923685pgd.10.2022.05.28.13.30.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:30:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fflB+u6l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 742461248EE; Sat, 28 May 2022 12:40:03 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238928AbiE1RFP (ORCPT + 99 others); Sat, 28 May 2022 13:05:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238896AbiE1RFL (ORCPT ); Sat, 28 May 2022 13:05:11 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEAEB14024; Sat, 28 May 2022 10:05:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 878AC60F44; Sat, 28 May 2022 17:05:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CC8FC34100; Sat, 28 May 2022 17:05:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653757509; bh=RbAT92bIRAtXe0cIR/KDQSi25eFquv7AlgWb4wDfJMk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fflB+u6lPkTB015Mj7ATvDLCOSZTNEOaT3vSWNSqD5yc0JjGzo1/rnXSbkidDyJfO 4R3V3H39X3NsxdVbxCQ5r2HSOX6ZgCrgUl/US1VZ8Vk9SExltkLN2EKo7LaugATSZu BFibpKLlCuFLF0Y51jN1xNekwkYMqLpF59g84+hQUsUQVRBeVLmyHKtuFWBOrk1eIE RUlUNfqo0OIwV6+OBltfia6A9M85W4wlHFncc9kiZ+mehZKWuTtilb9wOw2QK4CPGc kNgD3Qw/+W+aKr31uCgvCkabw3Fsb7hqMzp87N/aIy3ObSHliD7EDQW5Q4D7FnvIit rm76/vqBdzsvA== Date: Sat, 28 May 2022 18:14:03 +0100 From: Jonathan Cameron To: Andreas Klinger Cc: Li Zhengyu , lars@metafoo.de, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: srf08: Remove redundant if statement Message-ID: <20220528181403.16c0971d@jic23-huawei> In-Reply-To: References: <20220523122755.90638-1-lizhengyu3@huawei.com> X-Mailer: Claws Mail 4.1.0 (GTK 3.24.34; 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=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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, 25 May 2022 08:33:38 +0200 Andreas Klinger wrote: > Acked-by: Andreas Klinger > > Li Zhengyu schrieb am Mo, 23. Mai 20:27: > > (!val) has been checked outside the loop, remove redundant (val &&) > > from loop. > > > > Signed-off-by: Li Zhengyu Hi Li Zhengyu, Applied to the togreg branch of iio.git which is initially pushed out as testing or 0-day to see if we missed anything. I'll push it out for linux-next to pick up once the merge window closes. Thanks, Jonathan > > --- > > drivers/iio/proximity/srf08.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/iio/proximity/srf08.c b/drivers/iio/proximity/srf08.c > > index ac1ab7e89d4e..7ed11339c31e 100644 > > --- a/drivers/iio/proximity/srf08.c > > +++ b/drivers/iio/proximity/srf08.c > > @@ -354,7 +354,7 @@ static ssize_t srf08_write_sensitivity(struct srf08_data *data, > > return -EINVAL; > > > > for (i = 0; i < data->chip_info->num_sensitivity_avail; i++) > > - if (val && (val == data->chip_info->sensitivity_avail[i])) { > > + if (val == data->chip_info->sensitivity_avail[i]) { > > regval = i; > > break; > > } > > -- > > 2.17.1 > > >