From patchwork Mon Apr 1 10:07:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oswald Buddenhagen X-Patchwork-Id: 13612734 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 C9D04CD1292 for ; Mon, 1 Apr 2024 12:23:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id D5CD72390; Mon, 1 Apr 2024 14:23:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5CD72390 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1711974219; bh=lF1BBIluGxrDjhQOQ3oCHejcgQ7bQW4CJ1hx/bEh7ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=paXFqCArceegT3jKxqK8xTC1yvKmyY7bdbQQ8kV8mK6NC5NfQrLMO8IADxZ+HC5oC H10GJ4BrFsLwcaPZGe3US1WKXoBPcVhMBQLS2Ro/3kVw2vta3TUdTlMF7m7IfB2SjS nu3L9VocLOAopMobvn1O7IG1ii8srn0jOBo8nSK4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B0AE8F8067E; Mon, 1 Apr 2024 14:21:57 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 83964F80673; Mon, 1 Apr 2024 14:21:57 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EC650F805EB; Mon, 1 Apr 2024 14:21:46 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.15.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id F18CCF80238 for ; Mon, 1 Apr 2024 14:21:33 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F18CCF80238 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=gmx.de header.i=oswald.buddenhagen@gmx.de header.a=rsa-sha256 header.s=s31663417 header.b=eajH5Cr1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.de; s=s31663417; t=1711974088; x=1712578888; i=oswald.buddenhagen@gmx.de; bh=lIxFNvaFLMZ4Wu3nEyl/CSG1r9On5GGz5QAPXFujn64=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To: References; b=eajH5Cr1SrqdXw3Fu9EJA2S2AZt7youyP91e4d9PV0jvQl30tCMi0qcFQggpk7h9 /mCj9YJwj+bixH/WI3yD6+fEdRGUVlmKy6FKGwZjrG2FnlxmMrA+GTrMbQjgRdBIk f9zXrcTwZKuJRnKmyGtPdictiE6nfID2ItQFMlyGtCqs96B3oCeAhR4qP/lWsTEjZ dFHDF3Jx3/serQZbP0vKagyY0lRKucX+MJxcjT9kR6EPScbWbEhK6ZVGgIRC6UyNm vToo16wqGPEAHp1ELUgxlN032HYe9JvWdCGQyI2Wt0qY/0NtHlNKFHhuMIgqiZjmZ qq3WX090cAhf1/gSYA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from ugly.fritz.box ([89.247.162.100]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MkHQh-1sXB451nar-00kiQu; Mon, 01 Apr 2024 14:21:28 +0200 Received: by ugly.fritz.box (masqmail 0.3.6-dev, from userid 1000) id 1rrEZq-7en-00; Mon, 01 Apr 2024 12:07:42 +0200 From: Oswald Buddenhagen To: alsa-devel@alsa-project.org Cc: Takashi Iwai , Jaroslav Kysela , Arthur Marsh Subject: [PATCH 13/18] ALSA: emu10k1: merge conditions in patch loader Date: Mon, 1 Apr 2024 12:07:37 +0200 Message-ID: <20240401100742.506001-14-oswald.buddenhagen@gmx.de> X-Mailer: git-send-email 2.42.0.419.g70bf8a5751 In-Reply-To: <20240401100742.506001-1-oswald.buddenhagen@gmx.de> References: <20240401100742.506001-1-oswald.buddenhagen@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:L/zRDdry4zhkaDjB4nGt8K5rDJCZOctdxN78+SSdRmS7RRsumlL TrovMcsLwZy1n75T4hdxm96EDlqa43lcuH0QlPGk8i/FHmD4TZb6B4+JK21T1KXSYmnvaDz fz1xg40hRIc7xD/tY75vaCOnZbMPWH9n1w/boFNaawCHkF7H/Myc3HrZJfoJ1RC39gcCQf+ xGlxc18aps2m+RDzhzEiw== UI-OutboundReport: notjunk:1;M01:P0:dgrhDZwhw+4=;4czIy96roT6fRlBYa4AX+tHNjrz d/rmH+0+7BS/YcxIu6YpZxvJwfJVK51muo5WNdvgOyza6UTCce26+70bujDzO4+nYU9hpvOWL 2mgLWl8GScDRpRGUc6A/56EAT4gtElRwvM5s4+wB7r5TDhzCk0xctRSTXemUqwVC7qu4Y0YXC p1aQL7QyH8hvFXIrbTzeX9C5HeULdUxVA/RgIym+mgZtHzUxdMWvd9sZ0Shh3SVpm95jkq5a5 G62/kzHopeyR9pz+wm/4alByJOkfPVLLXrGa4463UfXZ0YD7z5EiMer5/fvlZd98aRs7n4H5m ucHlOPappJVxfg0T1m/7/6Ot7+ii0NyrbUIPUKVgwWcNRKG4fyaAiOupGF4vd5mEgVC21O+fw nLKQK7vOoag1JXKx/ah72jn8MrHp5n+r1miS+V/YD5Jfx2IagG7/1gJkuN/aJ98y9Vx2RXu60 QfGECQ4IdoBBTDe/q8Me1sKjpeWEyjE+Y1EcpQDXD1kvNjtNd81dLStwT50AjUCY4LTKffoDk vm5SK0VHFtqoix/teikgchvZwkOTpK//iXqLMU6PN4BqLmRjxRNbsyjhhHtbYHhim7rTQotot BsXwwZ+tWLCqFhXf1tAh7JEBHJoI/rlgPGfOIsMz/5S0uxrYv8bwcwHMnzf6WDa6NLzldFXye c19VAZ7XMPiC3yGKMeDU5z3Kndr99ZdskowJjU7rlMCTnTt0PMUmpZbKd6QEx1dgxmQ9836gF NL6tGkgizLetEhdB5bZrJTBqruEYFnulTZfYNYhUkDbWQMMlVhA8uy1pm6cS7SEY10iNidKpE SDd3C2g6j1LTJoAX1pBj5SRl8u45zesIBJ65tCj9benCU= Message-ID-Hash: LIPZGUD4GK6A5WMKWRCP54DJZCXB7UWY X-Message-ID-Hash: LIPZGUD4GK6A5WMKWRCP54DJZCXB7UWY X-MailFrom: oswald.buddenhagen@gmx.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: This de-duplicates the code slightly. But the real reason is that it moves the code up, which the next patch will depend on. Signed-off-by: Oswald Buddenhagen --- sound/pci/emu10k1/emu10k1_patch.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.42.0.419.g70bf8a5751 diff --git a/sound/pci/emu10k1/emu10k1_patch.c b/sound/pci/emu10k1/emu10k1_patch.c index a2ba6246dbc7..c7d54f38d28c 100644 --- a/sound/pci/emu10k1/emu10k1_patch.c +++ b/sound/pci/emu10k1/emu10k1_patch.c @@ -53,8 +53,14 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp, /* compute true data size to be loaded */ truesize = sp->v.size + BLANK_HEAD_SIZE; - if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_NO_BLANK) + if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_NO_BLANK) { truesize += BLANK_LOOP_SIZE; + /* if no blank loop is attached in the sample, add it */ + if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_SINGLESHOT) { + sp->v.loopstart = sp->v.end + BLANK_LOOP_START; + sp->v.loopend = sp->v.end + BLANK_LOOP_END; + } + } /* try to allocate a memory block */ blocksize = truesize; @@ -93,14 +99,6 @@ snd_emu10k1_sample_new(struct snd_emux *rec, struct snd_sf_sample *sp, if (offset < blocksize) snd_emu10k1_synth_memset(emu, sp->block, offset, blocksize - offset, fill); - if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_NO_BLANK) { - /* if no blank loop is attached in the sample, add it */ - if (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_SINGLESHOT) { - sp->v.loopstart = sp->v.end + BLANK_LOOP_START; - sp->v.loopend = sp->v.end + BLANK_LOOP_END; - } - } - /* recalculate offset */ start_addr = BLANK_HEAD_SIZE * 2; if (! (sp->v.mode_flags & SNDRV_SFNT_SAMPLE_8BITS))