Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3001343pxk; Mon, 21 Sep 2020 02:43:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhFPgd6pJuzFIT++rEMpzjPIuTFtopiljylTAlfcyxMGN8QEHYdLpn4Eo9uca1otcYctJy X-Received: by 2002:a05:6402:1779:: with SMTP id da25mr50125494edb.75.1600681407632; Mon, 21 Sep 2020 02:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600681407; cv=none; d=google.com; s=arc-20160816; b=QSfEpuzoRNgXMpEJdhgoLFLDns7l6sCgoZS8GHKSWQCkj+70UGE6EG0dqyPNGASv1Q jJMVLgZe++X7NtipyzEKUHjl96DYF7QgVsIpvqlmlXktQoYB95IR97ePy0Kl+VlpBHlR Ak6f0VHt14Ms02KO78LneN0ENLSeij9qCM5pzlicxqWSRrlFo175S2AzU28gAwZ/8V+j cmu8liF3KcnZWHNpH1w4pN5ERnIOQA3r7/O8gc3/Er0WX19oQSWRHLBJrZL8Mw7IwT5B IbD00LBpJkJ86EMt6Yuji2kfUCDAXjYM0gex05o/nQZb0dXgKFksF/XuFiTFi/Jtq2vs Uu/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=Xo11H3SINyUPeRRZirK3RI3tsYdtx9uldHQSR/SV7e0=; b=W92tieplHh0jwx/Qg3Rm7oIL+HYrVc/WhfN2bVbEA+yChNexV8XhLycW5NvXCOP+O7 tillIHj8d4hvG38nTD2X5CqLeGm0RFQLXW1AwtD2rhd7NtRxxyZruD8BXGwcn6B/3zXC exToFdAg8va0o3PNWb4gJ46+xBvYskh1ZJXzbgBwbBvKo6aAmZZWOhBOfX4zdQQWIS0H JtE9l9n4ixJLyHWpNRBx8tAfJ65jsGBiFCpaIuGYb2uIWKHUEwCpSrr1JixJ+yim+BCd Fa8ER14vNoX3dNd9H3Bao2FO0hDZPVlaCtG8ngC17VFbStGt9zCOWsCJtiYRu+alW1fl wxLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q5Dtqh6r; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v11si7474959edr.99.2020.09.21.02.43.04; Mon, 21 Sep 2020 02:43:27 -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=@kernel.org header.s=default header.b=Q5Dtqh6r; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726515AbgIUJjS (ORCPT + 99 others); Mon, 21 Sep 2020 05:39:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:59878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726367AbgIUJjS (ORCPT ); Mon, 21 Sep 2020 05:39:18 -0400 Received: from localhost (p5486cf2a.dip0.t-ipconnect.de [84.134.207.42]) (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 E3A0B2151B; Mon, 21 Sep 2020 09:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600681157; bh=aMczpGqXtPI/LNHqyP5LpS7scjs+KqG3Q940lW72ss8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Q5Dtqh6rIDcSpfWs/+63d0rQFosBoVOA2fRD46aTCXY/VOUR4PVdMGfNz4i1yWYv+ eSok+EhNkGgvDV6U25OtfYL6cW/XHVzPY1sEljzA6KgUv3PDf094lfF/ZcZNBQpnJ/ p3ZrNYA/1vkFIDiymhgds6C/mCkF26rYJdwrimmA= Date: Mon, 21 Sep 2020 11:39:14 +0200 From: Wolfram Sang To: trix@redhat.com Cc: syniurge@gmail.com, nehal-bakulchandra.shah@amd.com, shyam-sundar.s-k@amd.com, natechancellor@gmail.com, ndesaulniers@google.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH] i2c: amd_mp2: handle num is 0 input for i2c_amd_xfer Message-ID: <20200921093914.GJ1840@ninjato> References: <20200904180647.21080-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GvznHscUikHnwW2p" Content-Disposition: inline In-Reply-To: <20200904180647.21080-1-trix@redhat.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --GvznHscUikHnwW2p Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 04, 2020 at 11:06:47AM -0700, trix@redhat.com wrote: > From: Tom Rix >=20 > clang static analyzer reports this problem >=20 > i2c-amd-mp2-plat.c:174:9: warning: Branch condition evaluates > to a garbage value > return err ? err : num; > ^~~ >=20 > err is not initialized, it depends on the being set in the > transfer loop which will not happen if num is 0. Surveying > other master_xfer() implementations show all handle a 0 num. >=20 > Because returning 0 is expected, initialize err to 0. >=20 > Signed-off-by: Tom Rix Applied to for-next, thanks! --GvznHscUikHnwW2p Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAl9odMIACgkQFA3kzBSg KbYswA/8Dr/QwVbjfGkDlOvW2zJybPB+fpYamXJdBiftsNc/WyLDoLrw3236A987 oRLA/UXcxyVRaXsFNDc7hoGG1GwxpqmiVFL34mGo02O20PtpO3VBFbDGk+oDYyF7 AqWjxFw1xLSWx2pYQM6KXcd4JG7+wPT/XJ5eoRayLabLMoIboQWTM6LB2QxH4HV1 /uDlVXuIY/q6kWJLuR1kUJ8loYo2n2TV5+9LSPLxNPfkmfnKfbDsf1AnqNEWRG+3 y8CSda2VL/jvP3FAfsef+4i+2hKpW3PWoFrClgSl5mErw5g75+AO9P6WO7mQGdyd I4RybjsfXh5BaEMzyRVu1jcefcTdsir3Qt5025hRloMxZHNa3FnEU4XYvqHmNchG zSpMR6ynpQgbUGYh1N0Vi/jv1EJgPVi/vjH7XlA7+wMBOt9lIUiXdABSrWDEquOQ k4SJpDfIrSc0s2PWwMKiSPZkIH+wcrEnbXiFv/oVEw/AFf6mOihCVGbsomGn0hMh jSaHryCszQlzWn3J0NIyu/1v6chPTL/WuP9tVXP0lKRmSFzAdCUxupemqLWnIwuf I454ZgIKhZLsWk7v9qicDG9MTpJEEK63U4tBtmjHzCsg0f5cHO7YY/+liIT4H5/b Vyp27XqWrVJMriJda3rfF8htS3BcN+FXZtBVmXk22NCGQqhYN6I= =Kytx -----END PGP SIGNATURE----- --GvznHscUikHnwW2p--