Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2068630pxb; Wed, 9 Feb 2022 10:12:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5dhtpoUlC+6aTTaMESX8C9PhLvCiyi4md0YGYG5olW0i5zb9qX1MI+GNnF9DxplnFHH4J X-Received: by 2002:a63:7d4:: with SMTP id 203mr2890986pgh.246.1644430332172; Wed, 09 Feb 2022 10:12:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644430332; cv=none; d=google.com; s=arc-20160816; b=e80N5v6rd/7Z7cPHOvxEOZnIpy7F8qALLncQaZFCXvMmuzgeXqDNAQenR92tGHzJoY 3TxqzaO6Kw+CV74+fF4YU/xEXj/iFZPHctKmDZnagUIghJ3mLfdREaWX89ESJe9wrYIe E6AxU0AGKog/ViCmlgwaCTkcUFapcTh5QVTKsQZuJgmBii4Veh8Cji3/Rq6VdFsdbHk6 DbJug/kNr1ostQMlruJrgJvAfYWDnMsEAaWzuHoriD87WlRM2+cBbDhpNP1Q+rChCobL 51Uxug2XHuBzyGqXu2Mgwlja9o7eFA+5KWEZKe48hJrmLCzdp43RGowLESP+jiRx0/it ED7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=X9+gihl1sdcfaldMvCZfnICYiHUyYYACb1pPkwln93s=; b=lqrEiyIW+lhQq0/blyhm2WuBTUOWmJoQeNm/G9WkU9kg3ghLjbH+BLXzgqCdbqtnyr FNoYTv4Zx0lIXfjMOuIksiPz1gROWBMAOUj6euFx/6n8lxKTusTnBn51Jt1Ykwl5Spl/ nFalfZ+0WCM9D+4mgizHczYk5v55kALR+5+lI9VaK3SiMNzDdMNDPTR/MshdTdr5syd7 rsEdqg2vVpxGOwUPANGxGVORlfsXxO2OKAvZiIyp+FyR9NhebgyXesUWKcLISrFofeY1 +GdX4y91HVt/ZUZ456WeriVZNogO/IiIwU18hksdiZvPrVDh7GE5izjLiOFL3uw3gz8r OL1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tCWo92E4; 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 l184si16991573pge.145.2022.02.09.10.11.59; Wed, 09 Feb 2022 10:12:12 -0800 (PST) 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=k20201202 header.b=tCWo92E4; 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 S238099AbiBIRFx (ORCPT + 99 others); Wed, 9 Feb 2022 12:05:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237954AbiBIREn (ORCPT ); Wed, 9 Feb 2022 12:04:43 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D96B9C05CB8F; Wed, 9 Feb 2022 09:04:43 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8D3EEB82335; Wed, 9 Feb 2022 17:04:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B66F2C340E7; Wed, 9 Feb 2022 17:04:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644426281; bh=GIkXNhz8oaOhqayCMzeE+28iutBSWhbxVronQYj/VYs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tCWo92E4pLzlhQ6+xw81c43ydmZ9VGDk3KYy0l4f2x1rEnxiTOQzHtHSL+gD+hvLI BKB3Qzk9TbUSCIqXbCCYTAJFyc08OjHniWuHlobEremDJC+/3FwW8T5XkQZMkAOe2/ V8WUILhcW5eiiA6CdwH+0PU3Wc/ZeIda9OuWbhGPba4AvOEaHInI5pdoQcoUoS998B 0Rph2FYKB8xILFyT5bQj/mZjh2GQusPzZGUwzSi/zsCAi9DTnEMdTEuvgoCmqknQUG GEvvO0zYlqV6OpihOcQg1nJ60m0M6tjoUELV2TPXqmjQbbvhYOoe/5CnhD1z5kl7eb Mo+tITmGebotw== Date: Wed, 9 Feb 2022 17:04:36 +0000 From: Mark Brown To: Tom Rix Cc: lhjeff911@gmail.com, nathan@kernel.org, ndesaulniers@google.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] spi: initialize ret variable Message-ID: References: <20220209163029.2299009-1-trix@redhat.com> <61a545d5-224d-86fb-2fe3-406c3ffd78fb@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="LDdwV0VGGqx5cXxo" Content-Disposition: inline In-Reply-To: <61a545d5-224d-86fb-2fe3-406c3ffd78fb@redhat.com> X-Cookie: Disc space -- the final frontier! X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --LDdwV0VGGqx5cXxo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 09, 2022 at 08:44:21AM -0800, Tom Rix wrote: > On 2/9/22 8:33 AM, Mark Brown wrote: > > On Wed, Feb 09, 2022 at 08:30:29AM -0800, trix@redhat.com wrote: > > > Clang build fails with > > > spi-sunplus-sp7021.c:405:2: error: variable 'ret' is used > > > uninitialized whenever switch default is taken > > > default: > > > ^~~~~~~ > > > Restore initializing ret. > > Are you sure this is a good fix and that the compiler hasn't instead > > identifed that we should be returning an error in the default case? > If setting mode to idle is not really a valid state, then default should > return an error. Yes, that's what I'm asking. > The old behavior returned 0 and I am treating this as a regression. The goal here isn't just to shut up warnings, it's to fix any problems that they identify. Unconditionally initialising return values is a common way of fixing warnings while leaving real problems in place. --LDdwV0VGGqx5cXxo Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmID9CMACgkQJNaLcl1U h9D1pAf/SvFPCFoqJZgZ/loB28nIiwS4C9v290MFima/UTb7p3sdg9OudfxI543q Ht6y3f4vnCe3+BPqM4JSfeetuuDBcbHihhhMUUe8gucz9vsMV70O5uTcQneTHA8a KcNRt2ZpE/TUwZSr8SvyzQ/I8FKpyDSoW796eknGdXue1YpKDKO03RrbKXRcy983 H1DhiG7lppE3D2eh1R0xRsf5tVIzryeruIbbQzZSxi/fGvo6XxUcJ2CRrN7ib2cl 6uoFbFkHxJo3o385Exv6TwDyFmhrLYjGYDCxV0iUfYTwlEZpBupv7+sHqd+KBbLo LkQ/wHpMaWHZfmN5sQ4wieDHJHBplQ== =+R4u -----END PGP SIGNATURE----- --LDdwV0VGGqx5cXxo--