Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp1479866rwl; Thu, 5 Jan 2023 14:21:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXtdyupdleZNk0MP8gTu9Nl6LSWw6Fh5NQ3p+J+lib/GTekr5luZLGQeujUf87bidWxLi8Ho X-Received: by 2002:a17:906:33d0:b0:7e0:e1a2:dd98 with SMTP id w16-20020a17090633d000b007e0e1a2dd98mr46608506eja.67.1672957311051; Thu, 05 Jan 2023 14:21:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672957311; cv=none; d=google.com; s=arc-20160816; b=mOfoKtQJ+zOlOuR7Qls4o3uecOxBnzRcw2Ymma9s0D8zw+p8rjhCKCuBXOEJsOOwZN TVT10qJEhhqI0R4CDfV13imIpnCtrT2g5ge9GMbrgQuKNueu6HdAHpc0ST4WVLyulDLB du9kJQ9h6ck9LliLQ98+2IiEQzy4bqRHQQGPrPSftdus38gwn65iz9Dm3VqmyRJ/2UeI 5jSmUCWIzlot+kfDEZI64F7Yi+0WqEATgdojzoxmp89mKUTXT3sW/qoOIzcPRWS4Uqhd KXLRzjelYTrFCzVCeYhLMzvOK1cOYzlvmoFSTp5lt7qXYG933CuVVF9XpEmNr1MMY20W 9vKQ== 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=BTToRzOFH0uxZHXVyVUGqKHxJIZaA1DXP0QicG4ThfY=; b=lfVgkQEEWqWn+w/MBI9VAGLJWzCdEKfIAscZK6FeXL91VFyxtuQ6Hu1ib5xtih2sht eG9JFfHY64u0fYnS9j6A0b5jVMcQeHS/lgQjMzzH2IpY4Olq6OGKDtEA6AFws2/CcMJH 6XBaijdNtUBAXccxUvTRIJEhmbcGrCwkoQvS87Df3XTDBNuLE006OOYFqGVZxgOqHjzG bqR2KxHlp5TMuDm5+G+Z8Cg9X0wgctrba82GkrH5nuJGNePp4hGSWh9/zgMeeKLIciom EJdQiYPe0t/FrRp1WsOYYxUDIB3C7yMl+xnnjCqXQ9JupKG9LT81CeCw3OJHNb25Ln9r F2yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k1vQhvrw; 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 xb3-20020a170907070300b0084c71a2cbdbsi25574664ejb.214.2023.01.05.14.21.38; Thu, 05 Jan 2023 14:21:51 -0800 (PST) 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=k1vQhvrw; 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 S235834AbjAEVvD (ORCPT + 55 others); Thu, 5 Jan 2023 16:51:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235793AbjAEVum (ORCPT ); Thu, 5 Jan 2023 16:50:42 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9AB146E407 for ; Thu, 5 Jan 2023 13:49:20 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 2CCB661C60 for ; Thu, 5 Jan 2023 21:49:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E1758C433F0; Thu, 5 Jan 2023 21:49:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672955359; bh=uPhaNTNENZf5mGw9EH+DvbTe4+iskK+IX8fyXCEc/b8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=k1vQhvrwks9De8sHyhAVIDK96HEI3Qp6V6J/94JngqUfbWfnIhx0UxaqicJ6hfvMk 6CjUqB4QjufqDBU2QaCZE22uIVoavl90IpYuTbynfhyv7/7wkt9Msv9yJ2x/1IoLdZ mBJGTLs2MNdLKXL3kEm2sbtG4fzlOOoFm+EX0V/t3yB1/CumMZfn02p5ZQOaMrHf1T nNIV2z3/Z1NcB53mCXZB7r1CsY83CJutYcLT7wyf+hEWvaplYYW89cWvvvju1Pbr5U F7ZeKW9t745T3t3LFVdog+vp7wd79YtTcmhtFaxcunAL2XJKxfFAhqtKb/0h4r+CMS EyFOXQpLG9b/w== Date: Thu, 5 Jan 2023 14:49:17 -0700 From: Nathan Chancellor To: Tom Rix Cc: lgirdwood@gmail.com, broonie@kernel.org, perex@perex.cz, tiwai@suse.com, ndesaulniers@google.com, Vijendar.Mukunda@amd.com, Syed.SabaKareem@amd.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] ASoC: amd: Return ENODEV if acp63 is not found. Message-ID: References: <20230105211912.824250-1-trix@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230105211912.824250-1-trix@redhat.com> 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 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 Hi Tom, On Thu, Jan 05, 2023 at 04:19:12PM -0500, Tom Rix wrote: > The clang build fails with > sound/soc/amd/ps/pci-ps.c:218:2: error: variable 'ret' is used > uninitialized whenever switch default is taken [-Werror,-Wsometimes-uninitialized] > default: > ^~~~~~~ > > When no device is found -ENODEV should be returned. > A switch with a single case is overkill, change to if-else. > > Fixes: 1d325cdaf7a2 ("ASoC: amd: ps: refactor platform device creation logic") > Signed-off-by: Tom Rix Thanks for the patch! I sent basically the same thing earlier today (sorry for forgetting to Cc you directly) and was told it was not correct: https://lore.kernel.org/6bb126b7-1cb4-0c4c-d357-fadc3ffdd3f9@amd.com/ I am just waiting for some feedback before sending a v2. > --- > sound/soc/amd/ps/pci-ps.c | 7 +++---- > 1 file changed, 3 insertions(+), 4 deletions(-) > > diff --git a/sound/soc/amd/ps/pci-ps.c b/sound/soc/amd/ps/pci-ps.c > index 401cfd0036be..cba8800ab4ea 100644 > --- a/sound/soc/amd/ps/pci-ps.c > +++ b/sound/soc/amd/ps/pci-ps.c > @@ -205,8 +205,7 @@ static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data > memset(&pdevinfo, 0, sizeof(pdevinfo)); > } > > - switch (adata->pdev_mask) { > - case ACP63_PDM_DEV_MASK: > + if (adata->pdev_mask == ACP63_PDM_DEV_MASK) { > adata->pdm_dev_index = 0; > acp63_fill_platform_dev_info(&pdevinfo[0], parent, NULL, "acp_ps_pdm_dma", > 0, adata->res, 1, NULL, 0); > @@ -214,8 +213,8 @@ static int create_acp63_platform_devs(struct pci_dev *pci, struct acp63_dev_data > 0, NULL, 0, NULL, 0); > acp63_fill_platform_dev_info(&pdevinfo[2], parent, NULL, "acp_ps_mach", > 0, NULL, 0, NULL, 0); > - break; > - default: > + } else { > + ret = -ENODEV; > dev_dbg(&pci->dev, "No PDM devices found\n"); > goto de_init; > } > -- > 2.27.0 > >