From patchwork Tue Sep 12 10:13:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herve Codina X-Patchwork-Id: 138101 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9ecd:0:b0:3f2:4152:657d with SMTP id t13csp329813vqx; Tue, 12 Sep 2023 04:13:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5cMEKsDL+TtoDPDsg7DAGRX71lZtroqy0u63Tcz7LbBUZZ9vOw8lUz34PBN609dqSSddR X-Received: by 2002:a05:6808:1527:b0:3a8:5997:21e3 with SMTP id u39-20020a056808152700b003a8599721e3mr14689700oiw.33.1694517229931; Tue, 12 Sep 2023 04:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694517229; cv=none; d=google.com; s=arc-20160816; b=ATdcdrzUo2hvpdblvb/p9JmHLJHwbB8FsrbxSrI/VOVvXA9QLpTeIe0hyM2nC3aKhV +ytqDbcr9TJzM+D+irEfGuNsw2DE+FTSgfxz3cqazYElKQdutVBDqJrmAP8ebR9Gs13L sfEJ0K4R0I0gaP5iUbZhTiZA0NEQAEeMRAYRdj90aLttT9ALk+58M674nrsQOXN5pwaM e+525vcLmY/28SlWA2YAwuGfE4duHAYwV5Up1bmVJnynlfeRstS01Mf+AmCyI1PxwWyS SzMvxdVUCvngf37b5Il+k1blBE0QfH9ED3Fs/kGzt6q3uyQu4Kh0wi8Q4Bt9RKaUb/S1 e6rg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wQ9n/iAss2NyES0g9xehIz4CIRU5Od9sT5Iie5RFnB8=; fh=5rCQDomVZxLXb7yR2oN4iSS3zxUnzGJP2HoQaRzhQu0=; b=FhGUEQQ4jbfWmL4tJK6UnFlom0UJV7j6tb7LkA526Blk++YsgJL3lRJ7KuKrBoduGe 72c+SiD5Qb3B3r94cxUYqc6ycZB/G+EO5yN4pAo6M7nQiV8TZP2xFm2gOn6a/5sVIdso EnvEixv4FeHT83C5+OKF02zxugcN5FadIBDuqJ1YzRhXWgwpKYykJlc7zEg11mxtAJh7 OSuEglLx9a5gD1wnibyT98Jwbd+Ph693V3wr39JC4m0BxDwcHqXE8A6RH6P6F8XdI6EX DYqT018JbXP+XRVOpF1+QDdol42UmCZhVdLUsPMCyOJ7ObBxiESGn7oo/cbMVo0V70wi obYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SHp6C3Rc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ca3-20020a056a02068300b00573fa0fffcdsi8028238pgb.538.2023.09.12.04.13.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Sep 2023 04:13:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=SHp6C3Rc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 74A7E81FDB95; Tue, 12 Sep 2023 03:14:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233981AbjILKNu (ORCPT + 37 others); Tue, 12 Sep 2023 06:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233879AbjILKNq (ORCPT ); Tue, 12 Sep 2023 06:13:46 -0400 Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B7DD1FCA; Tue, 12 Sep 2023 03:13:39 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id B37E440006; Tue, 12 Sep 2023 10:13:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1694513618; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wQ9n/iAss2NyES0g9xehIz4CIRU5Od9sT5Iie5RFnB8=; b=SHp6C3RcCyPP8ldsMWVWJUDAN/1FHJeu6XNVn0qPDDAs88S0/ZybfVIy7K6PMiKoVo+YWy D1xdIPsIFWSOBbz33UwVCOSuFhp3FyHSw6w5whPTSk6ZyzlbkXg5kSmzbTf9uLqvfYiclf BBykBwWCMbqtnNDAwELWydd5hsFTHJdJMiFuse3pT/LBojXrkZU075N1cLnqS4b/HBIMe7 N/lm7qcm+rtCSDxx5dH8+f6oAe6g6WJfg5jrOops+SIZP2/RBqD/CFicu9cyguAt51s0Tp +N4+TksHepqD7h3U3MTWZwd3dN61gL6SWinUeTdXxlRqfxSybItrQiFC0/Olsw== From: Herve Codina To: Herve Codina , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Lee Jones , Linus Walleij , Qiang Zhao , Li Yang , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Shengjiu Wang , Xiubo Li , Fabio Estevam , Nicolin Chen , Christophe Leroy , Randy Dunlap Cc: netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alsa-devel@alsa-project.org, Simon Horman , Christophe JAILLET , Thomas Petazzoni Subject: [PATCH v5 15/31] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Tue, 12 Sep 2023 12:13:34 +0200 Message-ID: <20230912101334.225551-1-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230912081527.208499-1-herve.codina@bootlin.com> References: <20230912081527.208499-1-herve.codina@bootlin.com> MIME-Version: 1.0 X-GND-Sasl: herve.codina@bootlin.com Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 12 Sep 2023 03:14:08 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1776830098984280838 X-GMAIL-MSGID: 1776830098984280838 The newly introduced qmc_chan_setup_tsa* functions check that the channel entries are not already used. These checks are also performed by qmc_check_chans() and are no more needed. Remove them from qmc_check_chans(). Signed-off-by: Herve Codina Reviewed-by: Christophe Leroy Signed-off-by: Christophe Leroy --- drivers/soc/fsl/qe/qmc.c | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index 8e8bd1942c08..1189e6076e37 100644 --- a/drivers/soc/fsl/qe/qmc.c +++ b/drivers/soc/fsl/qe/qmc.c @@ -884,10 +884,7 @@ EXPORT_SYMBOL(qmc_chan_reset); static int qmc_check_chans(struct qmc *qmc) { struct tsa_serial_info info; - bool is_one_table = false; struct qmc_chan *chan; - u64 tx_ts_mask = 0; - u64 rx_ts_mask = 0; u64 tx_ts_assigned_mask; u64 rx_ts_assigned_mask; int ret; @@ -911,7 +908,6 @@ static int qmc_check_chans(struct qmc *qmc) dev_err(qmc->dev, "Number of TSA Tx/Rx TS assigned are not equal\n"); return -EINVAL; } - is_one_table = true; } tx_ts_assigned_mask = info.nb_tx_ts == 64 ? U64_MAX : (((u64)1) << info.nb_tx_ts) - 1; @@ -922,27 +918,11 @@ static int qmc_check_chans(struct qmc *qmc) dev_err(qmc->dev, "chan %u uses TSA unassigned Tx TS\n", chan->id); return -EINVAL; } - if (tx_ts_mask & chan->tx_ts_mask) { - dev_err(qmc->dev, "chan %u uses an already used Tx TS\n", chan->id); - return -EINVAL; - } if (chan->rx_ts_mask > rx_ts_assigned_mask) { dev_err(qmc->dev, "chan %u uses TSA unassigned Rx TS\n", chan->id); return -EINVAL; } - if (rx_ts_mask & chan->rx_ts_mask) { - dev_err(qmc->dev, "chan %u uses an already used Rx TS\n", chan->id); - return -EINVAL; - } - - if (is_one_table && (chan->tx_ts_mask != chan->rx_ts_mask)) { - dev_err(qmc->dev, "chan %u uses different Rx and Tx TS\n", chan->id); - return -EINVAL; - } - - tx_ts_mask |= chan->tx_ts_mask; - rx_ts_mask |= chan->rx_ts_mask; } return 0;