Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp262501pxv; Thu, 8 Jul 2021 20:37:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4SGE0K/MzGbbIdznHMvJ2ASWXSbg9RYCbs6fPp13GSHbHHI9fi8dQZCkE0vVLRt7ekapK X-Received: by 2002:a02:b78e:: with SMTP id f14mr14411071jam.136.1625801878111; Thu, 08 Jul 2021 20:37:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625801878; cv=none; d=google.com; s=arc-20160816; b=sXqC3Oq2b4yw+86YZJnvASirCZUmkh7Etr1ZoZUutToBGFhqLIkhlQa0l7wKMC4KiK kPzDbcPESsAZzSh/TzU21Q8+2yPvIxjXt4tA+b9msUZRY2EztD+IT/RDdrjYJsW5eyjH /TZONQhVzqjwgYKkcKFrzsCsulyWu7O895sISjejGc/ogAgI8l5SubjoNAlbmGr8xjvJ kbE4O7IugYs9n0YLuIKZT9RePfUYUqfwx3ui0X+M/ytjaDqVftQUG6hKuTTuN3lcqatN 7sARPNPAHt5RTDzpoWnmRt9HJHmkth6PZCdWwWP0tvmw+OaHdjgEEUw4YyWKKSQzi6Iw /Pnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XgObjxd836J01Nl5oCqassoOm41G96StAN2mBy6f6k4=; b=KYoyXnIwaXwDm8XAaghCDs4wa7bAUkjD+Y4hEVky0yoBNzB2hxh2h3gxJXDK/OMf1q 9ONvUnA/kKYlFs+Gqv+lHmJN54/tqxZBj7z2f4hLxza+yANTzkiD+7Q2YSSRfQTUlryd Pusri+dTWXeXqziVajC6fYcyV9nlkalyVY74w78a4RKO7l4vJ1TZrY1K1rmBKSMq0Lkr wKj9q8lAyS5c2/Flwmg6gPgjnAbn4U/BmS2qGoL6pmaPr0UsIjyfIPliiv2dXZ+KkDYu pv0RaH2qPo11w4J6RczMXPt5J93MOqEAUhLSh4WcugaGjNX8rDyJNKffAebAkGFdGQQ5 f+9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M33c2EL7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f16si4178783iol.39.2021.07.08.20.37.46; Thu, 08 Jul 2021 20:37:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=M33c2EL7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231258AbhGIDjV (ORCPT + 99 others); Thu, 8 Jul 2021 23:39:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231233AbhGIDjV (ORCPT ); Thu, 8 Jul 2021 23:39:21 -0400 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [IPv6:2a00:1450:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64D4DC061574; Thu, 8 Jul 2021 20:36:38 -0700 (PDT) Received: by mail-lf1-x12b.google.com with SMTP id p1so20354662lfr.12; Thu, 08 Jul 2021 20:36:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=XgObjxd836J01Nl5oCqassoOm41G96StAN2mBy6f6k4=; b=M33c2EL7z+WEZC3oDvuC3shlwtFr4uiO3JilGf9Eo4z6vLw6dx+Jf+BZ36qnTRiA18 6Wb5vaAAAMAKIRgRGaFzSMoKV/b9G/mphNE3Ygrs3MUoI3tOtVBGhkBpcgBb3/qGThlM wX/+0FWZ1Ejtgd+2u+/PVDbklQgiSvMmgKXy4OyL5HlGTe8MMy03rFBbCYoEGvJhxoLU usBTJ6Bx0yn4xScP4jbLaXF5ePg7w4rJlum2bTAgyU33jawZj9VGWVysTJ7oQ3/EuBIV FRAv/EE/1q4ccZdJnJPplMJJtbrSVYmoOsCsqlfi22hfN2LNRgkCHRRhv91Db3WdvUqN Nkpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=XgObjxd836J01Nl5oCqassoOm41G96StAN2mBy6f6k4=; b=fI83NZzIVYxmy4JCz0nmoVHRJnbg2Pshyorgcwli+qcatlAu7+sSOLrTQFcrYUpmBU YhlbWjDORGVqql8eYlPr/YT/cdEChZFUW5otrXDREqbRthZt5EEZunm9niUAXaGQq+r4 fua/pAZv5i5/XJIYdBGCm8Mbkur1eqhukFnOGpkxVeJS4Lqx1zvom8bavZMRdfgYivHD BEKDiujanl/xmVthvjjjfCnriSURkyMAh2JqU89zSBPyaOC/rA93EI0K74weIvYICcx6 jpUMlPYAGYCuwvsk7WJFnFNTT2L+03o2HC8yFAnR+A7li4Rn7l9JwGosv8Nq2SmFrsma AiYg== X-Gm-Message-State: AOAM530rITqJSWT1uxtdZeKzfE9rJRy/CgsYdXJtF5LCWcn6G6NS51Ne z/vfN28YRJH28kzFC+DtNIRXDhPfAclHqEoEXvA= X-Received: by 2002:a19:5016:: with SMTP id e22mr24174635lfb.539.1625801796743; Thu, 08 Jul 2021 20:36:36 -0700 (PDT) MIME-Version: 1.0 References: <20210709031526.30746-1-jrdr.linux@gmail.com> In-Reply-To: <20210709031526.30746-1-jrdr.linux@gmail.com> From: Fabio Estevam Date: Fri, 9 Jul 2021 00:36:25 -0300 Message-ID: Subject: Re: [PATCH] iio: accel: fxls8962af: Initialize return value To: Souptick Joarder Cc: Jonathan Cameron , Lars-Peter Clausen , Sean Nyekjaer , Andy Shevchenko , Linus Walleij , linux-iio@vger.kernel.org, linux-kernel , kernel test robot , Dan Carpenter Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Souptick, On Fri, Jul 9, 2021 at 12:17 AM Souptick Joarder wrote: > > kernel test robot throws below warning -> > > smatch warnings: > drivers/iio/accel/fxls8962af-core.c:640 > fxls8962af_i2c_raw_read_errata3() error: uninitialized symbol 'ret'. > > Initialize it. > > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Souptick Joarder > --- > drivers/iio/accel/fxls8962af-core.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/iio/accel/fxls8962af-core.c b/drivers/iio/accel/fxls8962af-core.c > index 078d87865fde..8af1c8f58e83 100644 > --- a/drivers/iio/accel/fxls8962af-core.c > +++ b/drivers/iio/accel/fxls8962af-core.c > @@ -628,7 +628,7 @@ static int fxls8962af_i2c_raw_read_errata3(struct fxls8962af_data *data, > u16 *buffer, int samples, > int sample_length) > { > - int i, ret; > + int i, ret = -EINVAL; > > for (i = 0; i < samples; i++) { > ret = regmap_raw_read(data->regmap, FXLS8962AF_BUF_X_LSB, Would the change below work? --- a/drivers/iio/accel/fxls8962af-core.c +++ b/drivers/iio/accel/fxls8962af-core.c @@ -637,7 +637,7 @@ static int fxls8962af_i2c_raw_read_errata3(struct fxls8962af_data *data, return ret; } - return ret; + return 0; }