From patchwork Wed Sep 21 09:33:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaroslav Kysela X-Patchwork-Id: 12983503 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 706F9ECAAD8 for ; Wed, 21 Sep 2022 09:34:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id A905FAE9; Wed, 21 Sep 2022 11:33:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz A905FAE9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1663752868; bh=cDYgxt6d9m7saKFCJeRSNNnqSUUfRNu1nLTtqBgnWfo=; h=From:To:Subject:Date:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=ECdtyfv4aYaQkLpL8rj87mG2sGB66r+m+1spxnFLMlQvVP79/+ohKuhHYX6fROJb3 b8DsMOt4HcQji89MEza/K87YPV2eWy38a0kDxqsVa1hxje/Tz4lYe1+/jO1vkKKgRu KPksmmMEX6K2TxgqDSxyFUfCEwE97DzJNyijnhVI= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 51F4AF80169; Wed, 21 Sep 2022 11:33:38 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id C448CF800C9; Wed, 21 Sep 2022 11:33:36 +0200 (CEST) Received: from mail1.perex.cz (mail1.perex.cz [77.48.224.245]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A790BF800C9 for ; Wed, 21 Sep 2022 11:33:29 +0200 (CEST) Received: from mail1.perex.cz (localhost [127.0.0.1]) by smtp1.perex.cz (Perex's E-mail Delivery System) with ESMTP id 54817A003F; Wed, 21 Sep 2022 11:33:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.perex.cz 54817A003F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=perex.cz; s=default; t=1663752809; bh=wgoml0GqFmReXn/XAl8JMlk1wSjcsTQ3VI5gtAdDVDM=; h=From:To:Cc:Subject:Date:From; b=ExL3ORkoAsQF+l2+3v6oEYRykdodbWGnXEVMBX4OLlK+slOj+/L2nTIfaZGj6JTdu jz0dnH8VASkCQPdPzlezPMHwS+eSwXj9LDnoLU1P3dvTWQidu24c1jDsqdLs9Muo7s aNE4gLerzKOpYDsF/BZEUmEmNRvBxvzBE0BQjpmo= Received: from p1gen2.perex-int.cz (unknown [192.168.100.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: perex) by mail1.perex.cz (Perex's E-mail Delivery System) with ESMTPSA; Wed, 21 Sep 2022 11:33:26 +0200 (CEST) From: Jaroslav Kysela To: ALSA development Subject: [PATCH] ALSA: hda/hdmi: Simplify the pcm_idx condition in hdmi_pcm_setup_pin() Date: Wed, 21 Sep 2022 11:33:22 +0200 Message-Id: <20220921093322.82609-1-perex@perex.cz> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Cc: Takashi Iwai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" Make the code more readable. Signed-off-by: Jaroslav Kysela --- sound/pci/hda/patch_hdmi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c index dc36af2928b7..e20e0ed759f6 100644 --- a/sound/pci/hda/patch_hdmi.c +++ b/sound/pci/hda/patch_hdmi.c @@ -1461,10 +1461,9 @@ static void hdmi_pcm_setup_pin(struct hdmi_spec *spec, int mux_idx; bool non_pcm; - if (per_pin->pcm_idx >= 0 && per_pin->pcm_idx < spec->pcm_used) - pcm = get_pcm_rec(spec, per_pin->pcm_idx); - else + if (per_pin->pcm_idx < 0 || per_pin->pcm_idx >= spec->pcm_used) return; + pcm = get_pcm_rec(spec, per_pin->pcm_idx); if (!pcm->pcm) return; if (!test_bit(per_pin->pcm_idx, &spec->pcm_in_use))