Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp606601imm; Sat, 8 Sep 2018 05:31:52 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZm7+T/RlVNBJedFqlf4MrrXV430MwuzDjsmQUpZ50eUc3Fd8FbEeOtUwxTpnN/+NDy6t+k X-Received: by 2002:a17:902:a5c5:: with SMTP id t5-v6mr12574628plq.6.1536409912242; Sat, 08 Sep 2018 05:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536409912; cv=none; d=google.com; s=arc-20160816; b=M30vTN4DRy5pJA2JsROOy+yC/4HuNIaCUIyTcA2zQo51pxUcFLy04lH8/Yp37/TsaP CSYN+Pm3aq5MPAcpX3SnR4byrB8nXla4BEw7PSFY6PukEgDZvdMcfLake60ad3wk+JQu DkC1yZpCCNpL5iTyjxGQQluJ3A9U+/PtiA2f8OW9MvJrz2/pR5WyvSmiv+cUfJivs2y+ OcM0jwKt2BKtufuvTVN2JVQ7o1o2xPezMf9rdRED5IgwuwY/H3MBLTUk1rTtv212pgwE /I7MT5RsKH2mVbs/Wlbp+h3YBxLYyLRAJHReNPeBqzYNjCytKAMp81JnDUcD22SGlPyJ zrdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uRh+6FT6o3DqkF+Muqt432oUQtZTIM1GyzWu56Qnldw=; b=xn7PYP7YgQCLkpFHcJqz1MMJEFaoBPCpWN/YFK6QOPFsRcUJi37TJrxtb9uSbQJCyh nDE4MwxeK1Mh/01tiX+vThEUxzAZn5a30GWz9sKIcgqZ8VNBjD4qZrdnLvSr34unPmyn c/cRALZZKJv8SFjdbv6cAP/k+KW76MZQrueTwPMQJG149JWKV6t/MMrMfAgnfUUE9N2C DESQDIQ702jdKEexxFNxQW74gYmHm1h0gmU/IwMFQJPNp+EGMUKzW5GLbPkLfIV+tX9T C8T/T/oF5E92NC6eAU/Z7Jf5Qz2RWgIFN4AIE4of9qwgFjGkxE6Gsb+1o0bBMWIvzE6Y mPHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bcvLR32H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16-v6si11670886pgj.61.2018.09.08.05.31.19; Sat, 08 Sep 2018 05:31:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=bcvLR32H; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726590AbeIHRO7 (ORCPT + 99 others); Sat, 8 Sep 2018 13:14:59 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38535 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbeIHRO7 (ORCPT ); Sat, 8 Sep 2018 13:14:59 -0400 Received: by mail-pg1-f195.google.com with SMTP id t84-v6so6422012pgb.5; Sat, 08 Sep 2018 05:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uRh+6FT6o3DqkF+Muqt432oUQtZTIM1GyzWu56Qnldw=; b=bcvLR32HUAsKhHMunb7Epj7rExxzRkLHi2cEHE/Di4BK2+KQjlMlCKHKh2i6KbehWR hgyCAykbOMp/TfQQx5ajbVgbg5kQqMar41nxhSF6QHuq2aSg+4k9D6FXEOcCeumMVGCQ ArqRXFLx8VUECH+Te3fTp57o4/HG+vsJZiqhxNfNwfD5ZodRw7fIC69WgvYAxA5nJ9Ir xCTTIab/vzEokWLP0Fr2Q4URML7eiRFBDtGruoprpYJi5q1RkSOrPwwBLXb++g8fENg4 JULRzjjMqQY+FROsKeVsUGMHhQAL4resgb8lhYQ3637YiZg/bcDlKnkZFexXBUk7tlxW dxBQ== 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:user-agent; bh=uRh+6FT6o3DqkF+Muqt432oUQtZTIM1GyzWu56Qnldw=; b=BO9YikAWiPla3PNIqd7Fs3TeXK562GrsSZ9a74oCZR78ZHoIMlQomIHzhGdQtZI+g1 gvulWa0cN4G8e14NRKDEbQbmqINCQa+kQWqPhAMljgTGgP4axH3qxG1G3xEALduu75nI SD+3RLQ30nlKWsT2YO6lpCMC0Li5QnedbIVzc33qzV/BqZ+ad13W6Cyr0EKNzdF4oV0d TmQE59VWKqVq5T0bqH/WT/HFfH4HL4Z08ySiY/vws1akiE4mIczoFrxlqScwnKBgkxOK uGc9GVlMf+UeIMAIjBTxVsu7Cgc+GE+MpO1Z8T4eAA/4+JDVyzwJWAtcHWetYuXSs8zQ qxvQ== X-Gm-Message-State: APzg51CKEk8DOvXkS+bGbSA7H5umUwzk5rKs/UysAXPK4wNHb4czUKBh 3Qj3QjJSZ+sIllEL/XGbCJc= X-Received: by 2002:a62:9c17:: with SMTP id f23-v6mr13609743pfe.209.1536409760967; Sat, 08 Sep 2018 05:29:20 -0700 (PDT) Received: from himanshu-Vostro-3559 ([103.233.116.134]) by smtp.gmail.com with ESMTPSA id f67-v6sm15858886pff.29.2018.09.08.05.29.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Sep 2018 05:29:20 -0700 (PDT) Date: Sat, 8 Sep 2018 17:59:13 +0530 From: Himanshu Jha To: zhong jiang Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de, pmeerw@pmeerw.net, linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: remove unnecessary condition judgment in am2315_trigger_handler Message-ID: <20180908122913.GA4445@himanshu-Vostro-3559> References: <1536404256-25189-1-git-send-email-zhongjiang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1536404256-25189-1-git-send-email-zhongjiang@huawei.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Sep 08, 2018 at 06:57:36PM +0800, zhong jiang wrote: > The iterator in for_each_set_bit is never null, therefore, remove > the redundant conditional judgment. > > Signed-off-by: zhong jiang > --- > drivers/iio/humidity/am2315.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/iio/humidity/am2315.c b/drivers/iio/humidity/am2315.c > index 7d8669d..dc12e37 100644 > --- a/drivers/iio/humidity/am2315.c > +++ b/drivers/iio/humidity/am2315.c > @@ -176,8 +176,7 @@ static irqreturn_t am2315_trigger_handler(int irq, void *p) > i = 0; > for_each_set_bit(bit, indio_dev->active_scan_mask, > indio_dev->masklength) { > - data->buffer[i] = (bit ? sensor_data.temp_data : > - sensor_data.hum_data); > + data->buffer[i] = sensor_data.temp_data; No, this seems wrong! We have buffer support to either take both readings(temp & humid) simultaneously, or only single channel using specified scan mask. Patch title should be: "iio: humidity: am2315: .... .. " Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology