[v2,11/28] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans()
Message ID | 20230726150225.483464-12-herve.codina@bootlin.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a985:0:b0:3e4:2afc:c1 with SMTP id t5csp474039vqo; Wed, 26 Jul 2023 08:18:13 -0700 (PDT) X-Google-Smtp-Source: APBJJlFoxfQBreWygerQXZHjaQbmS913f0quz1StkUJ4prVKgSFJNvF65uWXDMuwzpJp45FCTB4s X-Received: by 2002:a2e:8747:0:b0:2b9:412a:111d with SMTP id q7-20020a2e8747000000b002b9412a111dmr1755364ljj.42.1690384693418; Wed, 26 Jul 2023 08:18:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690384693; cv=none; d=google.com; s=arc-20160816; b=cKFStWWgvxKlKA5vur0HurmvxsAaZJ+0sl4nye+29bKTmZHwLl4Quf+QMrJIYoNKzQ Z7j9Cvr2udcrv58GhnTVIBwKAEO41PK0X+MZeK4sOHlWDgNBUVQSSotulyyRzP4H9u3X 0eQygnCCnTikh0n0jEJn2cFsVrQ7ngW3rn/rgSXu3zr2rFPSNUYu9skam8MDKMCckTmK mwFj6ZI2DJrwpIVKvQZnTM+1LOLyik7LPRp2p8Kv6fbRYPm64fSLn5LAh6Q88VmsF8cq BIPsrUHY6GONYfB1GuX4zXPUsEL35qsZ0NwGFQc+SO15QA7RGiQByV+JsyF0kKyOhcdu gHnA== 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=jWDfTkNWUWVC40dKv/rKQXNIu51Rr0yZUR6I3WqTAH8=; fh=OtJVFpZ5Y8/ND7g8QcUIbRSFhG4LznwcYYtG4zWKevM=; b=r8lyaIBH2V9PoUx0NZoxlYOZjUuwyuAOyTQ0NmjBWHEfeJkV9U1G0STxG4haNfTloQ /B5HjUAGWKhdRDEH+corcUH+127rl7JW5KH5j7zgJPdqhB76usP18TZN96duFWTFCEAJ n1vMmwoLrKq4rRxD04EkL9aZyir8WiKpk3uEvol4s3BUdSTzSSTbP2xCIdU5WNoou0Nt ktfLyuxEmqgoPVflxtOqh6BcXmSaQ2K5mEnEBC+biQTClvC2Ld77GYrblvUkFu6EfyJQ PRXYKkXukpVYmVn6FwRveuesoXU57gsQ33c10Xc7KqVsm1+ORtzGIIUN3A614kGp+8tR okjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RRZPpWGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qq28-20020a17090720dc00b0099396547000si9913031ejb.767.2023.07.26.08.17.47; Wed, 26 Jul 2023 08:18:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=RRZPpWGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234709AbjGZPDq (ORCPT <rfc822;kloczko.tomasz@gmail.com> + 99 others); Wed, 26 Jul 2023 11:03:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234672AbjGZPD1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Jul 2023 11:03:27 -0400 Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97E7A11B; Wed, 26 Jul 2023 08:03:19 -0700 (PDT) Received: by mail.gandi.net (Postfix) with ESMTPA id C4A3A1C0009; Wed, 26 Jul 2023 15:03:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1690383798; 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=jWDfTkNWUWVC40dKv/rKQXNIu51Rr0yZUR6I3WqTAH8=; b=RRZPpWGpZp7gJrVM99Nn5HIPu/jFBwUMcCu58ttZO8vB6HDMsXTjxUl6MdGiIQpi74BA6j XlkoJCRD5Yd2tXrj/NyDQOWAf8dBGKoGyA5tR4kN+9sgeLPoFqo+MseGQNtHUUcAuDx+iU EP20QgU1EeKOnBvGG57+vP+T11B6+YvXzX9NHMfOHtXGPdvYjBRrJiHWiooNw72JvXP/ts DyXpagpOVM68Sa2ro0K9oKY3XtdYhPjCmUPXvOeqHXyzcDPOPa5iO3pBCRBnAY1FN/uC9x hIAe7PNXwaaCAGRVx+ygRdEuLfkh3X0C012qim1LaqCpmODRRE/iUg5ZntsClw== From: Herve Codina <herve.codina@bootlin.com> To: Herve Codina <herve.codina@bootlin.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Andrew Lunn <andrew@lunn.ch>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Lee Jones <lee@kernel.org>, Linus Walleij <linus.walleij@linaro.org>, Qiang Zhao <qiang.zhao@nxp.com>, Li Yang <leoyang.li@nxp.com>, Liam Girdwood <lgirdwood@gmail.com>, Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>, Shengjiu Wang <shengjiu.wang@gmail.com>, Xiubo Li <Xiubo.Lee@gmail.com>, Fabio Estevam <festevam@gmail.com>, Nicolin Chen <nicoleotsuka@gmail.com>, Christophe Leroy <christophe.leroy@csgroup.eu>, Randy Dunlap <rdunlap@infradead.org> 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, Thomas Petazzoni <thomas.petazzoni@bootlin.com> Subject: [PATCH v2 11/28] soc: fsl: cpm1: qmc: Remove no more needed checks from qmc_check_chans() Date: Wed, 26 Jul 2023 17:02:07 +0200 Message-ID: <20230726150225.483464-12-herve.codina@bootlin.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230726150225.483464-1-herve.codina@bootlin.com> References: <20230726150225.483464-1-herve.codina@bootlin.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772496820370355910 X-GMAIL-MSGID: 1772496820370355910 |
Series |
Add support for QMC HDLC, framer infrastruture and PEF2256 framer
|
|
Commit Message
Herve Codina
July 26, 2023, 3:02 p.m. UTC
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 <herve.codina@bootlin.com>
---
drivers/soc/fsl/qe/qmc.c | 20 --------------------
1 file changed, 20 deletions(-)
Comments
Le 26/07/2023 à 17:02, Herve Codina a écrit : > 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 <herve.codina@bootlin.com> Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu> > --- > 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 c5552a0b5b19..33761c39aee1 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;
diff --git a/drivers/soc/fsl/qe/qmc.c b/drivers/soc/fsl/qe/qmc.c index c5552a0b5b19..33761c39aee1 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;