Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031163AbbDXLKZ (ORCPT ); Fri, 24 Apr 2015 07:10:25 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:31487 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965015AbbDXLKV (ORCPT ); Fri, 24 Apr 2015 07:10:21 -0400 X-AuditID: cbfec7f5-f794b6d000001495-53-553a249c09f5 Message-id: <553A2499.30501@samsung.com> Date: Fri, 24 Apr 2015 13:10:17 +0200 From: Karol Wrona User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-version: 1.0 To: Jonathan Cameron , linux-iio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Karol Wrona Subject: Re: [PATCH] iio: common: ssp_sensors: Fix uninitialized warning for timestamp References: <1429176624-19223-1-git-send-email-k.wrona@samsung.com> <5532AA55.3040609@kernel.org> In-reply-to: <5532AA55.3040609@kernel.org> Content-type: text/plain; charset=windows-1252 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrLLMWRmVeSWpSXmKPExsVy+t/xq7pzVKxCDVoWKlk8aFrFZLHr/xtm iyWT57NazDvyjsXi8q45bBa/dx1jt9izbguTA7vHzll32T0+fIzz2LSqk81jyZtDrB7nm48w enzeJBfAFsVlk5Kak1mWWqRvl8CVcWjGfPaCm7wVC58+Z21gnMrdxcjJISFgIrH9zncmCFtM 4sK99WxdjFwcQgJLGSVm3tzJCOE8Z5T4saiVFaSKV0BD4vTaW2A2i4CqxPezXYwgNpuAukTz jsXMXYwcHKICERLdJyohygUlfky+xwJiiwg4Sbzc9o0FZCazwCZGiY+774JtFgaqP39pBiNI r5BAssSEhQEgYU4BLYnJ/c9ZQMLMAnoS9y9qgYSZBeQlNq95yzyBUWAWkg2zEKpmIalawMi8 ilE0tTS5oDgpPddIrzgxt7g0L10vOT93EyMk0L/uYFx6zOoQowAHoxIPb8Mly1Ah1sSy4src Q4wSHMxKIryJQlahQrwpiZVVqUX58UWlOanFhxilOViUxHln7nofIiSQnliSmp2aWpBaBJNl 4uCUamA07ZD4Memh05u/Datuyl13FFppFLUprKlm0dfJr6qeuVbvemkavuFJqhIb94GTpSpx Yu1cV1bZKu7+VZPp9eTczUqtTxMj+PZdag7+8nzl27try8VfdrjPOmKzeWZX494Plve8PuTu dU7uUFq3J+msGLuQxArfuZ+4yr9wCdW9sU0SdNhzXdJYiaU4I9FQi7moOBEADF4DtHACAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1950 Lines: 53 On 04/18/2015 09:02 PM, Jonathan Cameron wrote: > On 16/04/15 10:30, Karol Wrona wrote: >> calculated_time variable caused warning as uninitialized. It was not harmful >> because it was evaluated in the path in which was used later but it is to >> satisfy the checkers. >> >> Signed-off-by: Karol Wrona > Dumb compiler. It's a false positive and as the function is an inline in the header, > it should be able to tell. > > What compiler is spitting out the warning? You should have krobot complain in the mail. Subject: "include/linux/iio/buffer.h:142:32: warning: 'calculated_time' may be used uninitialized in this function" This was sh compiler. I suppose that we can treat it as false warning. It will complain whenever the variable will stay uninitialized even if not used in such path. > >> --- >> 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 a3ae165..16180e6 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) >> > > -- > To unsubscribe from this list: send the line "unsubscribe linux-iio" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/