From patchwork Wed Apr 17 09:52:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 789881 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 65755C4345F for ; Thu, 18 Apr 2024 15:59:37 +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 533D623D6; Thu, 18 Apr 2024 17:59:25 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 533D623D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1713455975; bh=EMzVQWGtX/eIzEA/zdNuq2XVLHcIfNLVAyy5jrhNRxQ=; h=Date:From:To:Cc:Subject:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=bpG8l3ypOjGd2zzqnbmh8kdiEpfXQz9eOuM4Oh1/rfFyvGFN4p2KsdV7KtvC3IAqI PnnJIG1/brGFFY2/B7nvMshmQHXKb80mz6+CkzqDZerWf7bRQ4wbkCW2bz2PG1bDGV wfy3KdE7PJmijNjJd8pXGTqtgr1ZM60tGOrtXjCw= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D3A91F89710; Thu, 18 Apr 2024 17:53:10 +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 5D3E9F89703; Thu, 18 Apr 2024 17:53:10 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 1A1A4F8025A; Wed, 17 Apr 2024 11:52:47 +0200 (CEST) Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 65A8EF80124 for ; Wed, 17 Apr 2024 11:52:39 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 65A8EF80124 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=od2JRNLN Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-57042f84cabso2386647a12.2 for ; Wed, 17 Apr 2024 02:52:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1713347559; x=1713952359; darn=alsa-project.org; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=aS8oohQSnWtm5/ggCUPuCf5r4nvKB3/gwwUVKLME+0Q=; b=od2JRNLNRmmOITJfxaszFRG5+OOkuXIg5ZNugxT4cZ1nnd80dZb0Zj28hgJWrA9/6y nT016aY9hGhYbSuMRnS08AQTFDmbpHqubciBhcRGJufDzyIhAcpGpYy0d8S5JO0lZ4iO JlvKKCE2GKuB24pbgDkijou88dAMKnRWbj8nQ4gCqwgLwPuaWoztSHj1CcZoAi4ZlLMx jimDTFTSWaDt8k9zcTbpt12kt5JI4LXOKSepZ1NYzK9iYyc9XWSt8bH6IoSEeU8uK8+K Lp/tsRUiWa5W2F3B+evAg9ZdxMmCUwW3L6uMoKsiZGuvjBS+WL0OVb0uXK1EAeOsAXGP Ojjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713347559; x=1713952359; h=content-disposition:mime-version:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=aS8oohQSnWtm5/ggCUPuCf5r4nvKB3/gwwUVKLME+0Q=; b=YKF9WlKmHi3sg6Tcx+NDpcfpvM7DEBWslNlm5hdUEmtGb10aKl959cBJ3+RLEv6DFv wT5PBbp0aP9r0sqa92G+B6r4dJKyyJ/p5HCJhxpFcAL9PRlbWupwPPhHMnOPbz8kpFm2 iRSEGGTHVSnNOxuquX2n1TgxR3A6dDppfYEW3Ky9qyvWptRbhxB7T9j8GgmWY0hoX9y0 mPD8uknr+8gJsOvl4q60h5UstfSV1mQPNd/V2Tl0KJy5hqoIJF8wI+GGmruDlgvDvrlJ 8yAf0Tv4VW1Df64dFqKpZBXfMZ3Z4zl2/LBjoUhPAn6q6fosJDQAQVbMqcxnyTwLyhxe WBLg== X-Forwarded-Encrypted: i=1; AJvYcCUJWj+xKLBI48VEG5Apmx26CNfhK/ZziIIODsyoMy4PDSCgPEkjtVfS8CN5n9QhKJ5ZZ0eZpaF0SphkJDMLdadWtZsoIu/t/Te/C/E= X-Gm-Message-State: AOJu0YyIbCpW4YX1MIXAIE8IpS9FAlMRteuPHQaHznfK2RRHlniXS9OM DcmYsRw5rO2s2d0awbi4urF6Jnpu6DP8pGVMqVzA6EaMN93C9VVl3mFrwGRFOX4= X-Google-Smtp-Source: AGHT+IHjbEE1PXIxusfNci6KoXg1ftVPH3rWidgWbOaaR9occvuaSUnnQtaaZswO2dIcUCmYmpgEHg== X-Received: by 2002:a50:9b1e:0:b0:568:bfcd:e895 with SMTP id o30-20020a509b1e000000b00568bfcde895mr10176685edi.41.1713347558535; Wed, 17 Apr 2024 02:52:38 -0700 (PDT) Received: from localhost ([102.222.70.76]) by smtp.gmail.com with ESMTPSA id j1-20020aa7de81000000b0056e62321eedsm7001133edv.17.2024.04.17.02.52.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 02:52:38 -0700 (PDT) Date: Wed, 17 Apr 2024 12:52:34 +0300 From: Dan Carpenter To: David Rhodes Cc: James Schulman , Richard Fitzgerald , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] ASoC: cs35l41: Delete unnecessary condition in cs35l41_pcm_hw_params() Message-ID: <1ee32bfb-6f6c-4b61-887b-6f655abbfc47@moroto.mountain> MIME-Version: 1.0 Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-MailFrom: dan.carpenter@linaro.org X-Mailman-Rule-Hits: nonmember-moderation 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 Message-ID-Hash: TCDCLOHHHIXZ25CWTIYJOASB7MXKFUPU X-Message-ID-Hash: TCDCLOHHHIXZ25CWTIYJOASB7MXKFUPU X-Mailman-Approved-At: Thu, 18 Apr 2024 15:52:45 +0000 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 code returns -EINVAL if "i" is out of bounds a few lines earlier. Delete this unnecessary check and pull the code in a tab. Signed-off-by: Dan Carpenter --- sound/soc/codecs/cs35l41.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index 2799ccd6b5c7..d3da6a9f7f2b 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -772,10 +772,9 @@ static int cs35l41_pcm_hw_params(struct snd_pcm_substream *substream, asp_wl = params_width(params); - if (i < ARRAY_SIZE(cs35l41_fs_rates)) - regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL, - CS35L41_GLOBAL_FS_MASK, - cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT); + regmap_update_bits(cs35l41->regmap, CS35L41_GLOBAL_CLK_CTRL, + CS35L41_GLOBAL_FS_MASK, + cs35l41_fs_rates[i].fs_cfg << CS35L41_GLOBAL_FS_SHIFT); if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { regmap_update_bits(cs35l41->regmap, CS35L41_SP_FORMAT,