Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1619179pxb; Fri, 26 Feb 2021 16:17:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJyi67IpbS7CG60Ab+tqSMZNNKyEqIA3FMQYw8AYe1OvPKdenqtygsL20drXgjWW07fqsbRs X-Received: by 2002:a17:906:7d87:: with SMTP id v7mr6018473ejo.214.1614385049926; Fri, 26 Feb 2021 16:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614385049; cv=none; d=google.com; s=arc-20160816; b=s/53vlRcG65A0GTRFKqCZ6CGk3YV1rV8osghYWUWFlQJ6pk/8KXfyWUrmm3EH+CrDu Mv4tBl4ytdqtdK9PmurhnXBC0on/+70E1sNQY6hoXUdFL1pSg5STjzhiZPRNI80JuSzB 1PLrGlImcxEym5J8ZMtQSGeXwjSzd+cU8pGuV3VFRKP6tsrDuewhbs7BTxtKiIPmNSwV gaWc5udkMkozOaRj+embr0xfKUPkle4tTR7Vjs0iGQd9yDJP6/6MKX/abd2vgKSLDslh vY0kPZbBZd5xA5z09aw/LsKNcuQYLlkt7npZo+xYfVAEOaiRxntKcm1Uz27u6U94NaMP KtGw== 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; bh=bmwIPZqN5oa9HMr1OlWxOi+2/a8wXhYMpPn/5F1XSCk=; b=dEZJXTL1PxZkWxIbljuRAZDSe1lZyPTrKtljgefJavXIrOcegMi8vvACYJUDAvWNdl XLHTMhbxOn4AHxRzUmK7+T5BAbusnEI31eoyEjA/EImQY4fU/OfmddT9c3QqPebDz9My SB6AQgBaqlkyv70QbLk3Tk7PIJURRP6ZmlT4MSfetd+4977GzLKYWuZFW5Kgx6YGbA3w uwZyoMwsIdTv8oaJ89kFpjPnk0R6nT45J/3i2flaCWi2Th7ZN1id5WkFNy+AM/KCxvAi NE32BDE4Ertk9ogrbuN7feZQk51H3ok2E93GHsBX/ViIvazIyQWqIjHeftXgh6IMLu79 J6QA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si6929622edd.458.2021.02.26.16.17.07; Fri, 26 Feb 2021 16:17:29 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230045AbhB0AQ2 (ORCPT + 99 others); Fri, 26 Feb 2021 19:16:28 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:35176 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230019AbhB0AQZ (ORCPT ); Fri, 26 Feb 2021 19:16:25 -0500 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1lFnGZ-0004dU-Sc; Sat, 27 Feb 2021 00:15:27 +0000 From: Colin King To: Jaroslav Kysela , Takashi Iwai , Pierre-Louis Bossart , Wai Yew CHAY , alsa-devel@alsa-project.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: ctxfi: cthw20k2: fix mask on conf to allow 4 bits Date: Sat, 27 Feb 2021 00:15:27 +0000 Message-Id: <20210227001527.1077484-1-colin.king@canonical.com> X-Mailer: git-send-email 2.30.0 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Colin Ian King Currently the mask operation on variable conf is just 3 bits so the switch statement case value of 8 is unreachable dead code. The function daio_mgr_dao_init can be passed a 4 bit value, function dao_rsc_init calls it with conf set to: conf = (desc->msr & 0x7) | (desc->passthru << 3); so clearly when desc->passthru is set to 1 then conf can be at least 8. Fix this by changing the mask to 0xf. Fixes: 8cc72361481f ("ALSA: SB X-Fi driver merge") Signed-off-by: Colin Ian King --- sound/pci/ctxfi/cthw20k2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c index a855fb8c58bd..55af8ef29838 100644 --- a/sound/pci/ctxfi/cthw20k2.c +++ b/sound/pci/ctxfi/cthw20k2.c @@ -991,7 +991,7 @@ static int daio_mgr_dao_init(void *blk, unsigned int idx, unsigned int conf) if (idx < 4) { /* S/PDIF output */ - switch ((conf & 0x7)) { + switch ((conf & 0xf)) { case 1: set_field(&ctl->txctl[idx], ATXCTL_NUC, 0); break; -- 2.30.0