Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp251409ybi; Wed, 29 May 2019 20:40:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCWGGQ6/j0DO+8kMHAmJ4yoJBRJjEKTzYKlWFcXOlq2bjiM5X0CIewYdwt8jwSrPru6RNJ X-Received: by 2002:a17:902:18a:: with SMTP id b10mr1693413plb.277.1559187623856; Wed, 29 May 2019 20:40:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559187623; cv=none; d=google.com; s=arc-20160816; b=acSJwD7Ilnw8Pk2+izZTm/uWnjN8Ln1hA+cfAJa8l4Bn8cfqoXkSDtnWQX/4w8VemK IczMuZSbCedtmUntSHQodeR1ujQn6Uq5BYD4K5aqnuQFKoZxLt5E4vojp1CPghsiyql7 WQSE9W9YYLOMos1hv3yKasFon2yzw3Ff6obII1I7RMdjk8wlNzdPG91SjIwZIUBtnE3G S1WcwDF4Kax/iR1C9dlukHUriGqW8YV/J2Df+1CwyXIGvtijdBqnWcwevEJQgLwfokB8 ftFx2yqzFLnZ5L5VofEamxYhJ7tCETDSO54IsG04nPOGAq72M/btkO/MtWQZxOdGx17D c4Zg== 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=pUQ2d1SQ65niAef5Znuc5NFNPJvcU4u2e31rdYHUtdw=; b=K9o3ochy9yargxHFjD4YCoJd8Gq+3r2ev3WuJnKO9+BCnrYwDbqLSkzyhVRPiuJeAa 3svvPE5jQ727/QfJP+oorJcqLL2LYo91CoeO+AeDjw7iv/tbmDvOMBSVNyxRZ9eCou1w Z1J9AuC9fEZx1+80hkPXPaMDebceRJgTQEaeV+X2dITtFTORqAoVGQ5vh6xKskC+wDtH QhhIIcYTGiWIsAQatknKJWWL/OAK4O81Qfcb240A+9k9IBqOK5ese2mLNdR/b9g2bfyy CSQS6tUhNgb4q+pvhH8hmh0rk2A3w14nyhgzmoNL6yrD0vdKD3WIfTLNs1vZVA+3qAjC nQQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=J7VBSeLC; 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 p7si2148060pfb.213.2019.05.29.20.40.06; Wed, 29 May 2019 20:40:23 -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=J7VBSeLC; 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 S1733132AbfE3DXr (ORCPT + 99 others); Wed, 29 May 2019 23:23:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:47824 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731193AbfE3DRi (ORCPT ); Wed, 29 May 2019 23:17:38 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (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 DA0FF24590; Thu, 30 May 2019 03:17:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186257; bh=2wpiB4zzn6wBHIQlOWQviFupKUmKgjTIpgGgSQWBWKQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J7VBSeLC2X3zccMD14rXdIPipFxOIiF0O4RIvl8V5bEoMkAU8RPdyJs3bZoHeIfhA cMki4eVZuDHghg4bvaR7BEWZBT89svY/rkXHdnl/y1fhnr8FuxMSo7AcZj8qi1KZ4m afkJFlUEgCAEV1oEG2E4wplS7Vw3tHiI9lAvCLI0= 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.19 188/276] iio: common: ssp_sensors: Initialize calculated_time in ssp_common_process_data Date: Wed, 29 May 2019 20:05:46 -0700 Message-Id: <20190530030536.960912531@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@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 645f2e3975db4..e38f704d88b7e 100644 --- a/drivers/iio/common/ssp_sensors/ssp_iio.c +++ b/drivers/iio/common/ssp_sensors/ssp_iio.c @@ -81,7 +81,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