From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD6D3C43381 for ; Sun, 10 Mar 2019 09:46:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9BEBB20657 for ; Sun, 10 Mar 2019 09:46:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d4npUxi+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="fObSizws" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BEBB20657 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=UbUw5uppajiFOqRIFhTCIno3ebqNLiekCzNnTPoj1Zw=; b=d4npUxi+I/Vmfi 060gmk9v5S2Mty0cfSxL2jdVGihBKtgI2CRBj5YsAuqgLx1TuCIqpS0TaQlgJQ/IdeDUVzlQIzL8/ TIQvqBL5BUP/gKmMxaoAgOQtEtqv/H+4ohb/HzulYQLWqNkr+WckGeNP+gX8v7W4UnAqVValEggUb Kclv5CG4tMyljCdlUOfzqLiYQc+H2222POdpgG1lraot0dFYfiEdMncE5m9XIRQ0XyiTdIuQW5Ssp wzKcAruF2RPKcArSZ1CFotTdUF96pJNAjzDxpRmkzA2XJrk/1sy3C9Gcg2GUid29qPmR+xUBqakDj 3TMAhdFZirBt2WcoV4UQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2v1z-0002Yn-4Q; Sun, 10 Mar 2019 09:46:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h2v1w-0002YT-D9 for linux-arm-kernel@lists.infradead.org; Sun, 10 Mar 2019 09:46:06 +0000 Received: from archlinux (cpc91196-cmbg18-2-0-cust659.5-4.cable.virginm.net [81.96.234.148]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5AC9120657; Sun, 10 Mar 2019 09:46:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552211163; bh=OVB2k/NWWavwDhadOBIAMAJzLTgj8jcNf58kwfzmhnU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=fObSizwsq4IwmHClFG15DgBnTs/mCy2jV8jx0OXf4Be8jp9YdvLaRAikCjA9c2Buc oZsc4aepsyZzDzHBYlh3YV3v844zQmjfUHu4nmwaMaoyCe9GvTlgbw98r/xxspNwgS l/T0O0MMFRVAgzsBWS+xZskmBZ8v9luKkpd4yVcA= Date: Sun, 10 Mar 2019 09:45:56 +0000 From: Jonathan Cameron To: Nick Desaulniers Subject: Re: [PATCH] iio: adc: stmpe-adc: Shuffle an if statement around in stmpe_adc_isr Message-ID: <20190310094556.3ae7c5fa@archlinux> In-Reply-To: References: <20190307171604.27791-1-natechancellor@gmail.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190310_014604_473446_8AAA063C X-CRM114-Status: GOOD ( 16.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Max Krummenacher , Lars-Peter Clausen , Peter Meerwald-Stadler , clang-built-linux@googlegroups.com, linux-iio@vger.kernel.org, LKML , Stefan Agner , Philippe Schenker , Maxime Coquelin , Hartmut Knaack , Nathan Chancellor , Lee Jones , linux-stm32@st-md-mailman.stormreply.com, Linux ARM , Alexandre Torgue Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, 7 Mar 2019 10:31:55 -0800 Nick Desaulniers wrote: > On Thu, Mar 7, 2019 at 9:16 AM Nathan Chancellor > wrote: > > > > When building with -Wsometimes-uninitialized, Clang warns: > > > > drivers/iio/adc/stmpe-adc.c:204:13: warning: variable 'data' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] > > > > Clang can't tell that data will never be used uninitialized because the > > two if statements take care of all cases. Remove the first if statement > > and make it the else branch of the second one so that it is apparent to > > Clang that all cases are covered. > > > > Link: https://github.com/ClangBuiltLinux/linux/issues/387 > > Suggested-by: Nick Desaulniers > > Signed-off-by: Nathan Chancellor > > LGTM, thanks Nathan. > Reviewed-by: NIck Desaulniers Agreed. Seems obviously correct. Stefan, I'm only pushing this out as testing for now so happy to rebase if you have comments. Thanks, Jonathan > > > --- > > drivers/iio/adc/stmpe-adc.c | 5 ++--- > > 1 file changed, 2 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c > > index 37f4b74a5d32..7921f827c6ec 100644 > > --- a/drivers/iio/adc/stmpe-adc.c > > +++ b/drivers/iio/adc/stmpe-adc.c > > @@ -184,9 +184,6 @@ static irqreturn_t stmpe_adc_isr(int irq, void *dev_id) > > struct stmpe_adc *info = (struct stmpe_adc *)dev_id; > > u16 data; > > > > - if (info->channel > STMPE_TEMP_CHANNEL) > > - return IRQ_NONE; > > - > > if (info->channel <= STMPE_ADC_LAST_NR) { > > int int_sta; > > > > @@ -205,6 +202,8 @@ static irqreturn_t stmpe_adc_isr(int irq, void *dev_id) > > /* Read value */ > > stmpe_block_read(info->stmpe, STMPE_REG_TEMP_DATA, 2, > > (u8 *) &data); > > + } else { > > + return IRQ_NONE; > > } > > > > info->value = (u32) be16_to_cpu(data); > > -- > > 2.21.0 > > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel