Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3325170iob; Mon, 16 May 2022 19:27:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUW2ijAZTsDFOkIAJKk6YJClq7OsDUrsVrJlBdt+xUQAeSbV85oin5fHMgitrmRTvV3CoN X-Received: by 2002:a05:6402:d64:b0:42a:9bce:1eb6 with SMTP id ec36-20020a0564020d6400b0042a9bce1eb6mr14239363edb.125.1652754438656; Mon, 16 May 2022 19:27:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652754438; cv=none; d=google.com; s=arc-20160816; b=DnfWSZuT0rkcIkhsuZ9K0CktyypE5Ow67hSExnI7jd2uqrdZW7oCu2Z0j9//uC7Fd0 Ma3QEkvbdGAOPE/KTBScPRSGWdQBGENCsUPQx4eJCKviNZ99zh4VMwNBAa2UC5oY3wqK eoR419AvOuNAvQyr6/qdfMxVahbE6IiAC7qaMgItgZS/7vL+hDVlYsJK/e1IDM4XY7hK P3vKteXGQNwJW14w6UZSaoWjSXJx5RQVzmcWx4OvPGtuPN6CQUum5veu3gf7Jf2Gh+xl VAHUDRwNbSatLRt9u59UG1oOFzeEMyxpGa9RGjZuqTUK3q45gZQDwL7p4M+HGfhnycaa W0PQ== 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=iJNQNa6dtYlhwqjJAQDqfn+tThhmNj05Ld4XtUBvbEo=; b=Z6p6Cv7OihLL8uoUtxoyvJCdef7T2zq0BqpJcr9oJxcGsoWUzpsXJmjEVynQiLGSNL Wbmi5SPV6rFAeIGrV01S1XOetvmHN7G2eYLc2FvyD62Redvgt8f/9eHfsEP3/3QUTfKe 23cCiY+QmvGb0KhDc+54xR6ZUxgIUedz+XOEnmM+MBHLgsl6Ju1+lu8dsic4Al03+tY0 Q7rvPSB1pFaP23lcSr9em6a4yAFfZ6cVP/FKPYq1AzpQSziaOXWK6lUYRLZbIErFAtqP OX86iT6OPSy49e293oJbWquVxKXbfXzsA2KffMfmX6jB+n6ahS4fplogLIZ/P3Vpnytd CAZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7CtKaEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ci18-20020a170906c35200b006e8d4fe9fefsi1116738ejb.115.2022.05.16.19.26.53; Mon, 16 May 2022 19:27:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7CtKaEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S245481AbiEPP42 (ORCPT + 99 others); Mon, 16 May 2022 11:56:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58206 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245485AbiEPP4Z (ORCPT ); Mon, 16 May 2022 11:56:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CB1ECA192 for ; Mon, 16 May 2022 08:56:24 -0700 (PDT) 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 231DDB80B55 for ; Mon, 16 May 2022 15:56:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72A1BC34113; Mon, 16 May 2022 15:56:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652716581; bh=pwSfhH/HA5ZWdWjfwL705LozCp1iZETX4zwonXvMW/Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V7CtKaEyAB8ODvl7ny9zrvtVhJK+Pl5lMh0P1rsukAk5RWs1K6KfkNv/vH2Awf7OF EA0Hc8HpnO7w7xSsl4RlQxpU4MApGVJeYisEZzXd8bN9buQ+U4ha0G0KZ45ygIePC3 gQycdxuqZHpP5w6pXQ3sjeWRVGnJXdbva7+JhV0kOBM7uK+Cej6RVnEQyLUrycg1+e CQKPfvOW2I5DKIs6nhLbTbmL+3aX1BFPGQHu0FzVzT2jS2m5QsYDEZK5pkRH2JpjVP recO/Al2ZQ27MmwGbXbW3B/ZYC7Z0uxo+kdQxCoW134be3ANFq78C1gQpby+TqBC2n bWXSrDiBEuEUA== Date: Mon, 16 May 2022 08:56:19 -0700 From: Nathan Chancellor To: Tom Rix Cc: arnd@arndb.de, gregkh@linuxfoundation.org, ndesaulniers@google.com, ricky_wu@realtek.com, kai.heng.feng@canonical.com, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] misc: rtsx: Set setting_reg2 before use. Message-ID: References: <20220516130047.3887590-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220516130047.3887590-1-trix@redhat.com> X-Spam-Status: No, score=-7.4 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 On Mon, May 16, 2022 at 09:00:47AM -0400, Tom Rix wrote: > The clang build fails with > rts5261.c:406:13: error: variable 'setting_reg2' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] > } else if (efuse_valid == 0) { > ^~~~~~~~~~~~~~~~ > > setting_reg2 is set in this block > if (efuse_valid == 2 || efuse_valid == 3) { > .. > } else if (efuse_valid == 0) { > // default > .. > } > But efuse_valid can also have a value of 1. > Change the 'else if' to 'else' to make the second block the default. > > Fixes: b1c5f3085149 ("misc: rtsx: add rts5261 efuse function") > Signed-off-by: Tom Rix I am not sure if this fix is correct from a functional standpoint (i.e. is treating efuse_valid == 1 the same as efuse_valid == 0 correct?) but it is better than not handling this value altogether. For what it's worth: Reviewed-by: Nathan Chancellor As a side note, it is unfortunate that this change made it into -next when there was an outstanding report about this warning: https://lore.kernel.org/202205100220.WyAyhKap-lkp@intel.com/ > --- > drivers/misc/cardreader/rts5261.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/cardreader/rts5261.c b/drivers/misc/cardreader/rts5261.c > index 749cc5a46d13..f22634b14dc8 100644 > --- a/drivers/misc/cardreader/rts5261.c > +++ b/drivers/misc/cardreader/rts5261.c > @@ -403,7 +403,7 @@ static void rts5261_init_from_hw(struct rtsx_pcr *pcr) > setting_reg1 = PCR_SETTING_REG4; > setting_reg2 = PCR_SETTING_REG5; > } > - } else if (efuse_valid == 0) { > + } else { > // default > setting_reg1 = PCR_SETTING_REG1; > setting_reg2 = PCR_SETTING_REG2; > -- > 2.27.0 > Cheers, Nathan