Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4742824rwb; Tue, 8 Aug 2023 13:07:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFNEj24wkosHV/jNHqkQgvl8wIV1/ti7s78AG+3VWThpsLylB4RomT6XNHA8ScFx7G0SLkH X-Received: by 2002:a17:903:234e:b0:1b8:6984:f5e5 with SMTP id c14-20020a170903234e00b001b86984f5e5mr13097804plh.12.1691525271554; Tue, 08 Aug 2023 13:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691525271; cv=none; d=google.com; s=arc-20160816; b=h6tLB2du35KeNat9PahjVkOivitypEMCYY6lFMQijMen5vYC5y162BWKAQ4c6OnEOD C5DbI3QjwyGM9Cw/cFYYEPurwWcS3srkhfqsPEonIYc7R+v942vvxwgWWs1Ofpw5K6eN iOjmKDX1dtLMLWeaVudTmMKCxRQvDEdiac73vSx8aEb5GjmoohI/46he8a4rwlhTts/j HaeKmgIaT/D4kXdbwc1/CcRmMdIkmcQ6jMTEViinFX34whkdH/CIrQP7vKBhQi9rZzOH vJZY4dPST2vllVXBvnL71Y4KFnPRVXStsCZeKNp42PS0HfcyObVpiI6sGYbH1SOu2VxO wL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pALHleCL1yvRrlH8QmnRdmiy5ZNQLEnrQjaOMAb2cgo=; fh=zLmzx7qpzud6oSZ9diad6CjCZo40y/2quKn6i8s3h/4=; b=lDSgu9oB5epGEQgKvLpdYO1SMzZRmJn2laqX1Ae+fskQDNLttf2ogx9v28y3y0iGop DBIft1FmA9bz/ioIvVu7EejDUyTZycUinJmo4W2XG5Yt20WV5qwbQDlJjxu9eNHnf+8i 9A7ND4MEuxpmbRSawZbtEy5hP+inLe0JGmhc/UWmhOBAvkBkyCSLuiTBysRf+m6jjAsb 5kCS9BNWW8sWHQaEYGbbN4t1nX0PnDjOGItPHU1E74TXl09MiSsklmN2JytW/vx2nXGW Iv4prLGZ6R4aMpNdrqT1GsGacN9FnhQrsPaLIgFJhycZfYnarI9vXGmPohJicAt1Qy76 eUwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ALuJOr5z; 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 j12-20020a170902690c00b001b801bd7fbasi7609207plk.417.2023.08.08.13.07.39; Tue, 08 Aug 2023 13:07:51 -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=ALuJOr5z; 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 S235669AbjHHTOa (ORCPT + 99 others); Tue, 8 Aug 2023 15:14:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234188AbjHHTOC (ORCPT ); Tue, 8 Aug 2023 15:14:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 919D436871 for ; Tue, 8 Aug 2023 09:36:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 122A86253F for ; Tue, 8 Aug 2023 12:57:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B7EDC433C8; Tue, 8 Aug 2023 12:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691499430; bh=S0FBs7xD3Rf0XgcDIGN+SZnoxzu5hScAnRLm9gSsKfo=; h=From:To:Cc:Subject:Date:From; b=ALuJOr5zjEN0HXUfZj23CYhl/qslnq1Ul9nu3AiwMPIfPvJxHwRaegVzju60uur8J bxVTyQn9a7pQID1YwvQ3TVHiikXZM1AmhN5BNVELbwnMc8OTuZ1NsJNERgjxihgX2S pKSUqZ5hvzW9S9flCMuRgZKlCnC3T/DVApS/RFXg3p5EDvA7MYF1/bWBt8TT3PvvlH Dgo/3KPmI7ch1A15zpeyGO1dvP81nxbIj6IiYRwEDWpWh8fVHB6LXElveU+E4tgvd3 EAQMYZQwCf7CrbdlXAhZm1vtzl98mEbsXttJ17Er5BgOz1bwuD+EObjpfj7EPhBtRF 9XR+xjzLgvYWw== From: Arnd Bergmann To: Mark Brown , Weidong Wang Cc: Arnd Bergmann , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [PATCH] ASoC: codecs: aw88261: avoid uninitialized variable warning Date: Tue, 8 Aug 2023 14:56:54 +0200 Message-Id: <20230808125703.1611325-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS 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 From: Arnd Bergmann aw88261_reg_update() returns an unintialized error code in the success path: sound/soc/codecs/aw88261.c:651:7: error: variable 'ret' is used uninitialized whenever 'if' condition is false [-Werror,-Wsometimes-uninitialized] if (aw_dev->prof_cur != aw_dev->prof_index) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/codecs/aw88261.c:660:9: note: uninitialized use occurs here return ret; ^~~ sound/soc/codecs/aw88261.c:651:3: note: remove the 'if' if its condition is always true if (aw_dev->prof_cur != aw_dev->prof_index) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Return zero instead here. Fixes: 028a2ae256916 ("ASoC: codecs: Add aw88261 amplifier driver") Signed-off-by: Arnd Bergmann --- sound/soc/codecs/aw88261.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/aw88261.c b/sound/soc/codecs/aw88261.c index 82923b454dd47..6e2266b713862 100644 --- a/sound/soc/codecs/aw88261.c +++ b/sound/soc/codecs/aw88261.c @@ -652,6 +652,8 @@ static int aw88261_reg_update(struct aw88261 *aw88261, bool force) ret = aw88261_dev_fw_update(aw88261); if (ret) return ret; + } else { + ret = 0; } } -- 2.39.2