Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2429788ybi; Sun, 9 Jun 2019 11:34:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxesORYCWoLonNtwhuvAeQr4PWvMZREcXvFM8yvgtH+Cd/oqpyKXAIhMFd22vFw0I7PeX/u X-Received: by 2002:a65:6383:: with SMTP id h3mr12449302pgv.452.1560105269643; Sun, 09 Jun 2019 11:34:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560105269; cv=none; d=google.com; s=arc-20160816; b=AsOW+WL8GfYrYjIUZ1G9pPn0MdDAommOss5+mesUrvbXKjhPiSXS04I559ywbRX5pF bdUdWHmdPV99gchgJEyCNJValXnylbq/fUrvFz6J8EN4EnCBRErzADfcPrQGor8Qeey8 1eLSVmD01ZEbYc2lMTMuY42D1AxwgHxEtaLPwRbRgrGrDBT4oBzLBgH1GTK3i2EnKJDo xvk/NeXuMbTg1JY+NBDKXz3HpIakKa8HqslBcrHngEF/wjngPNNrvfFoSDlbrmzA7eq5 k6g5mL9n9lRMOLg2HMx24NL3BOFTjc5v1+xqHLCDELsza+tmEr4jKJC78VsQbjzRKvT7 K5QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0qzfnfVEik1lliEfc8f7O0JriJ7TSOOe6gps7TBaV3c=; b=KMRiS6z77K9+G2b8pU6T7whxJAD9WyJRDP2MUYatmmf2vEpsv8gCy4pGtWDCZ7Rsn0 Y1VXJn+O4XM2CHdytemPb9VuZCmsBh0w0lp2I+ZA8Tq/4QdemPUYp/VcNa5NgLxVEluS QZS7wfsJWO4C9k1wAaXan4r7TCPYiZ2j3mrIe/LsHah1+w9MCxXbyPa0s9nKFLkmJji8 tDsurwH572LArmcy4yP9JtWaLOJHq2a/Cjuf3dIRwMbVQY715/JZELJXMJItJ1cMx16x 0L2P5sv5+f2PC0WYz/6hsJ2T0YHH96xM/Fb7gxnVWp0PJoZKsJ9alNXBFmIrMZKa/YS9 De5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=vFspVEOx; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj12si1197604plb.378.2019.06.09.11.34.13; Sun, 09 Jun 2019 11:34:29 -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=@kernel.org header.s=default header.b=vFspVEOx; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388766AbfFIRKq (ORCPT + 99 others); Sun, 9 Jun 2019 13:10:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:40208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388222AbfFIRCV (ORCPT ); Sun, 9 Jun 2019 13:02:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 55C1820833; Sun, 9 Jun 2019 17:02:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560099740; bh=d03wGcSLh8G/HpcgAyBKycnljy+lMikE51SomgRCph0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vFspVEOxSMYnDmlRliMNp2weJSupYXPb528VsEisfotx54UHnS6T/3QDmUDMRYFlk yO5jyOD2yEX6xAU76dGN71+3GmSz+pkUTaPtpM6dV9So3/7FOe8v0+YGdVs3tHWo1n njT5TwOosZuywVGAWvkf0ZJiFfB14UU3m38XGqDU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Chancellor , Nick Desaulniers , Jonathan Cameron , Sasha Levin Subject: [PATCH 4.4 150/241] iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data Date: Sun, 9 Jun 2019 18:41:32 +0200 Message-Id: <20190609164152.105384275@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190609164147.729157653@linuxfoundation.org> References: <20190609164147.729157653@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 6f9ca1d3eb74b81f811a87002de2d51640d135b1 ] When building with -Wsometimes-uninitialized, Clang warns: drivers/iio/common/ssp_sensors/ssp_iio.c:95:6: warning: variable 'calculated_time' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] While it isn't wrong, this will never be a problem because iio_push_to_buffers_with_timestamp only uses calculated_time on the same condition that it is assigned (when scan_timestamp is not zero). While iio_push_to_buffers_with_timestamp is marked as inline, Clang does inlining in the optimization stage, which happens after the semantic analysis phase (plus inline is merely a hint to the compiler). Fix this by just zero initializing calculated_time. Link: https://github.com/ClangBuiltLinux/linux/issues/394 Signed-off-by: Nathan Chancellor Reviewed-by: Nick Desaulniers Signed-off-by: Jonathan Cameron Signed-off-by: Sasha Levin --- drivers/iio/common/ssp_sensors/ssp_iio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/common/ssp_sensors/ssp_iio.c b/drivers/iio/common/ssp_sensors/ssp_iio.c index a3ae165f8d9f3..16180e6321bd4 100644 --- a/drivers/iio/common/ssp_sensors/ssp_iio.c +++ b/drivers/iio/common/ssp_sensors/ssp_iio.c @@ -80,7 +80,7 @@ int ssp_common_process_data(struct iio_dev *indio_dev, void *buf, unsigned int len, int64_t timestamp) { __le32 time; - int64_t calculated_time; + int64_t calculated_time = 0; struct ssp_sensor_data *spd = iio_priv(indio_dev); if (indio_dev->scan_bytes == 0) -- 2.20.1