From patchwork Fri Mar 22 14:08:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 10865851 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F33C46C2 for ; Fri, 22 Mar 2019 14:09:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D05382A171 for ; Fri, 22 Mar 2019 14:09:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C1D212A80C; Fri, 22 Mar 2019 14:09:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A51C72A80C for ; Fri, 22 Mar 2019 14:09:44 +0000 (UTC) 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:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Sy6pWpEJ+0GY8Pq7S5Z0F/recssed68A4KCmmS4pa0k=; b=hae5EylPfTZudA 0ozvsMQIyaE9ocAmIz+TZqyYJncV5ubM98MgUH8bAgLcuFChVHGphzbPmVl9BmqxChfACl4BnAU6E rF8xbI42AmjXdaytw1kzdDFOMBVGXFrc7EIQXAtC/CGqfBqz+qUzyjLVy1+AyFQu29SqL1H3V1xnM 83dATYCQMXu38odAdDmz5oCEylZSIGFdjGAwh+w9ArZLr7BjAd8Tv5Cgs7GGhLCZTs/MzMnMRdl53 nWTl4j5aaDDxhfsC4n+Dv3ybn1NhSbCytNf6pfYzSm/8o2tqu0QLkb9x/rqCuaiwNAH47lPPAipHm +I2VHPB01k/QV3xVsCqA==; 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 1h7Kre-00007h-P0; Fri, 22 Mar 2019 14:09:42 +0000 Received: from mout.kundenserver.de ([212.227.126.130]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h7Krb-00007L-CR for linux-arm-kernel@lists.infradead.org; Fri, 22 Mar 2019 14:09:41 +0000 Received: from wuerfel.lan ([149.172.19.189]) by mrelayeu.kundenserver.de (mreue011 [212.227.15.129]) with ESMTPA (Nemesis) id 1MGzDv-1hCXvq27sJ-00E25M; Fri, 22 Mar 2019 15:09:09 +0100 From: Arnd Bergmann To: Jonathan Cameron Subject: [PATCH] iio: stmpe-adc: avoid harmless clang warning Date: Fri, 22 Mar 2019 15:08:39 +0100 Message-Id: <20190322140906.319267-1-arnd@arndb.de> X-Mailer: git-send-email 2.20.0 MIME-Version: 1.0 X-Provags-ID: V03:K1:LsArqJRnc8Nh4Hs3awc98LbB0oEkPJppi5wt30jJ9pQ28ugEIk/ Jm4cAL9MCDBiFJr7VLu+YWUmfnMBojlNyJEKZ3rSOByCQiTjc+Y42edEmBTwRKjEnXgRkta fuquITpE1ZPhoI4El/oshu1jTZQwKwfpBDjxGWK3A2Ons3shPsBySLhLInMy2Zfk52S769Y 48xqpH5mDaOFBAbSo+d6A== X-UI-Out-Filterresults: notjunk:1;V03:K0:Bg8IhLpgIxU=:+PtXwVmnCw+djAtLG9I0nn ejsH32So6S37sGTZioLsBgCRZZDqzoPaDMd+nCqUoNhn4tnl6fWFjqf5d+i+S0P+zYjtIhOmD WsP4IhOzrIKLbTMFBOm1Zw/MWVVWT+0JUy+tlHCnIIlrjUTm5qBMNCoL98MqM+xgAtrlZn6Kn kOfiEDuuhW0CVLlLNZCQfe/Df5vZrHLvvkYBNKUzGqy8IifrIM+Ue7vhDT91E8xQa4dr3Fr3j R9yWRlX+5ZF+8MPCHHoicc3kYoslm6x71NUgu8aBlp/Fo9FLIuQdI38J0lu1CH7lvC7piLYho vy4mR7UvlxpeDoc4in2Oar3NbPqQiRiZJZ5vdLOHWpK0mw/sGqvQt0kJ4TLYnKkIaqXiyg1HE jC6kEicb2Ztl0tEDHlqxJxjzu7FhuGM4kOpkZ9AMCnmFS3klD4Mk0wHUA/tliK1kGoP82Z4ox 8voguriLbfR5UyN6ujS09uz70iQM0/aMH8DEdhtr72Wf/R1/LjkeUJc0gxKSikn3tkaICpccf JcTCMBM5K0HeiS/K2QYw0ENxdkqNzFcDAiXBdoDBNXEBc4sMPtDQreJWeWJdb5RaQelJec5v1 bRuhvWKst+/JlwMk6rAs76BqZlvJA2mBHA1vOkUxMMM8VNlJRzs8C/CVCcqzIB6E1XThW1/gq rhcgf/j9O7gdvaeSFgU55zFbQHz4ZIdcmt8OF4Bq/wEauPbNCRXQVqAfAHptULP3shbKycILj an/9swV2ILGCXbdz+hDUfzbDbHLo6vlPQXKQkA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190322_070939_732205_FD60ECC2 X-CRM114-Status: UNSURE ( 9.31 ) X-CRM114-Notice: Please train this message. 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: Lars-Peter Clausen , Max Krummenacher , Arnd Bergmann , linux-iio@vger.kernel.org, Nick Desaulniers , linux-kernel@vger.kernel.org, Stefan Agner , clang-built-linux@googlegroups.com, Peter Meerwald-Stadler , Hartmut Knaack , Nathan Chancellor , Lee Jones , linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Clang points out a control flow bug, which happens to be harmless: drivers/iio/adc/stmpe-adc.c:204:13: error: variable 'data' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] The warning is sensible here, so let's just avoid the case by adding appropriate error handling. Signed-off-by: Arnd Bergmann --- drivers/iio/adc/stmpe-adc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/adc/stmpe-adc.c b/drivers/iio/adc/stmpe-adc.c index 37f4b74a5d32..ed3817c5c896 100644 --- a/drivers/iio/adc/stmpe-adc.c +++ b/drivers/iio/adc/stmpe-adc.c @@ -205,6 +205,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);