From patchwork Fri Oct 21 19:13:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 6943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp863751wrr; Fri, 21 Oct 2022 12:17:07 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7+mIqOEu1HnuXMqwMd+RiBEGVk/swKXHizbOlyhHn0rmPxrJ87vR3ZrN1OuUlAMnOVn4wB X-Received: by 2002:a17:907:7704:b0:780:da38:4480 with SMTP id kw4-20020a170907770400b00780da384480mr17126011ejc.64.1666379826852; Fri, 21 Oct 2022 12:17:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666379826; cv=none; d=google.com; s=arc-20160816; b=q4LWXmpl62CMprtiycFkV2K0Y07ZPGQcXtk8pYKyi/g9w4U9B/sP233MaIAjP6crxQ hc68zLXEtQMNKvGYxiS91G5RS5/6BEgfgjnZSnLlTyjAGUJkrcAV1zJ26z2NTW9dGn9T 6rtkUKMZUWuMFug3WPKphLoDp2u9o++C+HdRnCh6SmxeGDL2dQOtP/Ory9K+hmW3jm3v NFNqPaWgwLcSem5N+YGtcf0mj95lGZy7+VgBXvy5kwDdDME2iaxvw3qX1gG4FtGJ3JAd IBNEZCyc3N0Rc929EvDT12RVULpky647tdAwUGRiN3bOL77+Ep72U0Wh3KTODiSJ0Bx3 Mt7g== 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=wjt6lwwJr+c+Of6ylCClx8YoFmO2MMnOutK8JcRmLRU=; b=XbCaH1dJnEbi5KlBxyhH0QcgCjucz97o+nhqMnN0wf0OTit1VcYU3moCR8Ml2uDHTs nzL5tO4lSoCbYt6M+LxyYzlyfBx8hLdcJjiOB7HXrZE5HgzlCgwWBnfvitmx0zZTKDm6 qwRPP2SHgGx/Z/t/SjqBpxvC4wM3L/bIFq0mgTbVRF57wAim3wwtJ4jwZc7nrmczQMWq CCwFw25VCaI0N0Rd0njToiywtvJz7Xmcm5/uxPkIdv2dVvHMXOTnopWCweCjnliwRgUY NgZyXitcU5jD8nD/vOs5PBZC2KM35gG1cg41QegwaoIDDVLELLEfrIIj/UEmr6MvpskB YiNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bGVqa57u; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gt11-20020a1709072d8b00b00783d5a873dcsi22919894ejc.341.2022.10.21.12.16.42; Fri, 21 Oct 2022 12:17:06 -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=@linaro.org header.s=google header.b=bGVqa57u; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230334AbiJUTNx (ORCPT + 99 others); Fri, 21 Oct 2022 15:13:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229995AbiJUTNs (ORCPT ); Fri, 21 Oct 2022 15:13:48 -0400 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29A6F15A8E3 for ; Fri, 21 Oct 2022 12:13:46 -0700 (PDT) Received: by mail-io1-xd36.google.com with SMTP id 187so3102162iov.10 for ; Fri, 21 Oct 2022 12:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wjt6lwwJr+c+Of6ylCClx8YoFmO2MMnOutK8JcRmLRU=; b=bGVqa57u8nMCh9FP/fCjSQ5u0DVbCFa53mamal5/83aBa+kQ4NkoBJE6olw2xjl+iR 88SryQ6n+YSObVt1oVhugpTLoql6ONsHN8dpbzuq6IKR0QnJ7VoGapzT5Dg+GUBCFUGc gmtNIL+EKGGpyw+bgryII70Zi0KZ3zq2Eb/HUmLmmTFfKerAva9QSrOxHZNz+Kq9nH7W eJ8yuXMNzoCh4d5FirqiFX/8Xd4QM9Bj8aa0FXlXStakz2/bJ6h50zSiSJ95faiwNa+A mMI2KXzgwpVhG4zav9XdEcFhfSt1x6A61lGgG56Xvye/5R2q0oCGW4GrpAlkV1ABJdx/ wryw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wjt6lwwJr+c+Of6ylCClx8YoFmO2MMnOutK8JcRmLRU=; b=d5IQgdUxYjiYmoB+Z+VAIruer/YvPX4RrWjJ+wFPfitpS5NZIav7kNzYw2aFEKJYK7 EJsDHk/dmHqVuUPNrPO+OSvJQ9rB9UGcOxfYC9isRQgmfLLrzdhq5L4fcra2xTxLu+QU 7ZeJD2wdwW7vEgn+E6QHqaom/ALqb/vxiLzfQt5WYPAkhx3LlbJW7bNX8mO3DWwKhlaW +FCCIj8M3q8u9EYibfyR9pBVvf6v4Y8AkmePSMK6NVtzz19BbvySGpBo7USUbbTTSfCG dHrJJ8aX0Nnj6ZKwq9slI2KibnZOQxkQ/Rih5hiT4qzb8krWPDxIm9wUYG38gYpLInA5 q34w== X-Gm-Message-State: ACrzQf3UEiVy0K7phzUnY7E1sHaTqifmuSTFy1hJJaa9f3iVunYP3XQd RxjvE0WQNQY7MpNcySIVWUAYjg== X-Received: by 2002:a05:6638:480c:b0:363:aed5:ed3c with SMTP id cp12-20020a056638480c00b00363aed5ed3cmr14275784jab.207.1666379626213; Fri, 21 Oct 2022 12:13:46 -0700 (PDT) Received: from presto.localdomain ([98.61.227.136]) by smtp.gmail.com with ESMTPSA id e3-20020a022103000000b00363c68aa348sm4439362jaa.72.2022.10.21.12.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 12:13:45 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com Cc: mka@chromium.org, evgreen@chromium.org, andersson@kernel.org, quic_cpratapa@quicinc.com, quic_avuyyuru@quicinc.com, quic_jponduru@quicinc.com, quic_subashab@quicinc.com, elder@kernel.org, netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 1/7] net: ipa: kill two constant symbols Date: Fri, 21 Oct 2022 14:13:34 -0500 Message-Id: <20221021191340.4187935-2-elder@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221021191340.4187935-1-elder@linaro.org> References: <20221021191340.4187935-1-elder@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747325893262702681?= X-GMAIL-MSGID: =?utf-8?q?1747325893262702681?= The entries in each IPA routing table are divided between the modem and the AP. The modem always gets some number of entries located at the base of the table; the AP gets all those that follow. There's no reason to think the modem will use anything different from the first entries in a routing table, so: - Get rid of IPA_ROUTE_MODEM_MIN (just assume it's 0) - Get rid of IPA_ROUTE_AP_MIN (just assume it's IPA_ROUTE_MODEM_COUNT) And finally: - Open-code IPA_ROUTE_AP_COUNT and remove its definition Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_table.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/ipa/ipa_table.c b/drivers/net/ipa/ipa_table.c index 510ff2dc8999a..74d7082b3c5aa 100644 --- a/drivers/net/ipa/ipa_table.c +++ b/drivers/net/ipa/ipa_table.c @@ -106,12 +106,6 @@ * ---------------------- */ -/* Assignment of route table entries to the modem and AP */ -#define IPA_ROUTE_MODEM_MIN 0 -#define IPA_ROUTE_AP_MIN IPA_ROUTE_MODEM_COUNT -#define IPA_ROUTE_AP_COUNT \ - (IPA_ROUTE_COUNT_MAX - IPA_ROUTE_MODEM_COUNT) - /* Filter or route rules consist of a set of 32-bit values followed by a * 32-bit all-zero rule list terminator. The "zero rule" is simply an * all-zero rule followed by the list terminator. @@ -342,11 +336,11 @@ static int ipa_route_reset(struct ipa *ipa, bool modem) } if (modem) { - first = IPA_ROUTE_MODEM_MIN; + first = 0; count = IPA_ROUTE_MODEM_COUNT; } else { - first = IPA_ROUTE_AP_MIN; - count = IPA_ROUTE_AP_COUNT; + first = IPA_ROUTE_MODEM_COUNT; + count = IPA_ROUTE_COUNT_MAX - IPA_ROUTE_MODEM_COUNT; } ipa_table_reset_add(trans, false, first, count, IPA_MEM_V4_ROUTE); @@ -561,8 +555,7 @@ static void ipa_filter_config(struct ipa *ipa, bool modem) static bool ipa_route_id_modem(u32 route_id) { - return route_id >= IPA_ROUTE_MODEM_MIN && - route_id <= IPA_ROUTE_MODEM_MIN + IPA_ROUTE_MODEM_COUNT - 1; + return route_id < IPA_ROUTE_MODEM_COUNT; } /**