From patchwork Fri Mar 26 15:11:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 409518 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1518993jai; Fri, 26 Mar 2021 08:12:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP6NYhftD2VzDcM3zVncgPznRJH0+rnqcLujI/pcmp/O/VZGM3GXdEa5xHCsvfUfI/1mc2 X-Received: by 2002:a17:906:4cd6:: with SMTP id q22mr15797717ejt.469.1616771558035; Fri, 26 Mar 2021 08:12:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616771558; cv=none; d=google.com; s=arc-20160816; b=Sj/wu1y102/Sc/g0YYivsGKbE8MG3LsbIw3Hapn61fBud6mvbrHG4rOnIJBpmpwvas geOF2QiPFEWynPAyX+IGZimJovWksQEQrggp0Ab9bZaFdC6f/iAXvCJuH91Qjhjz3ho8 rquvTw0PAQGgcMMWcTXOL7TvjgGE0FVnC4PbrsIyGWkO7Dtc9Jdae+tclCJCZH3ed7vZ QPkVcy2JhFqe4KoXb5erb3gCuWAcY3KPM8VmNkfusoLlPLElWcQynz8cTHgSrZdZcfFs 0JkcJmJr0/QW3StTWv8W17uBl+c2gTDUv8beJdOiXqD+2jD6WJy5s6QnzNNasm5+Ozwq HjBg== 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=/5IZFT/IwO11mtS+DXxe3NtvichQwOJMJ1ayd2gN1yo=; b=a2cu5nAFmLIUF+S8juAq71lFjUW9Fz1qCBwuIYP7fR1BZlg2CmFQKGWDnvRPv/kp+2 Kkp5nfXJs0VtV46jxk9zFP+Sm4QYUyujEYJYDyQZMzhDOMv4+eHnXwfnf8/TmdqdnHD2 gxhMi7dLY1/FxJ9e2GlEfpso8AnICj9ck5T6NZuNBttq7s3BOj94l25fs+CIchY9E6UK ZGS/kyOrLmTCB0ILI8n7r7SXxZ1KO6xMRJ4cHhp2BquT4c2nuT6NsrjFsSFQh4Q3nkdY BLXwLwHitpyK6AHQtAvW+ypVs7rTjnp9Fq9e/wzpBL3I1BgdUqu9hkBrK0Cq1qi0+Kyr hL9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ixexIqir; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lw25si6533712ejb.357.2021.03.26.08.12.37; Fri, 26 Mar 2021 08:12:38 -0700 (PDT) Received-SPF: pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ixexIqir; spf=pass (google.com: domain of netdev-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=netdev-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 S231180AbhCZPMO (ORCPT + 8 others); Fri, 26 Mar 2021 11:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbhCZPLf (ORCPT ); Fri, 26 Mar 2021 11:11:35 -0400 Received: from mail-io1-xd34.google.com (mail-io1-xd34.google.com [IPv6:2607:f8b0:4864:20::d34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5D42C0613B5 for ; Fri, 26 Mar 2021 08:11:34 -0700 (PDT) Received: by mail-io1-xd34.google.com with SMTP id x17so5737402iog.2 for ; Fri, 26 Mar 2021 08:11:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/5IZFT/IwO11mtS+DXxe3NtvichQwOJMJ1ayd2gN1yo=; b=ixexIqirmRdA+c2o4TECW8V8V4Gwi+ZzcC0cLlqgrkkCjNUrNVWx9/v2SbU6xHFUNB OKwxejb4yKc22ZNjtaYKZ1jMPRV71zYwkP5vuUbW7NmgLGIouur87Rp5YinP0mhCBrfn Z/5IpULs+1me7bxb/jKmwuKuIqEaYGQbI51TY4UQrJC5aE0AbWyxvgAm2vROguaGKzyl QHrK2Z8uliO/ig6ejLTdTtvp6HhwB61i7F5tT6Fm/EQMFInaZDFokIuJVSLUvAqMpyMQ sWuyiIyNXz9i850Iur41SE+HrrIpUaAANh4tTqgZs8VDLrrqncsJSwmfjYFaWq7FHsEc Jz0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=/5IZFT/IwO11mtS+DXxe3NtvichQwOJMJ1ayd2gN1yo=; b=aS/a5Csxx4Lq9bd3f/WkmKVvNIv36jZzAJgSjI8gxjUx6nl+2IsIhk8T8bCD4EKcuY MG6TapNj4WJq7x4Yr9uZRBRNb2GQ/Q9F+g6FVjDxfbvSc1gSJbJTcFpSMRkL5H8Uo1Fa KgdVhvC76xMuTUsFDD7oRDPPHpXBAZVtuEaIeWUTKo0L40Kmjjw/2lKvKucUoMmSMKL1 AMmU8LcuczSmHiFBaNJTlpvDzXGM1nooCCkxHKty+zfeLQQ/GoIjIdqeGb+JptfHFY6o Z+eM3Ycwzvh5sHHqHkv8rtH0kj7oCgBDHmy6kEhQ+d8Vif7pI80pW65oxPfOK55XyUhg NDoQ== X-Gm-Message-State: AOAM530VlhlMuxuzoICFAtP+/2OiDMsu1W8XUn5VHfM8dOZc32pxhFs1 duthYYHK9a3FUWN8xEkRH7G6dA== X-Received: by 2002:a02:ccd9:: with SMTP id k25mr12310553jaq.43.1616771494040; Fri, 26 Mar 2021 08:11:34 -0700 (PDT) Received: from localhost.localdomain (c-73-185-129-58.hsd1.mn.comcast.net. [73.185.129.58]) by smtp.gmail.com with ESMTPSA id j17sm4537706iok.37.2021.03.26.08.11.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 08:11:33 -0700 (PDT) From: Alex Elder To: davem@davemloft.net, kuba@kernel.org Cc: bjorn.andersson@linaro.org, evgreen@chromium.org, cpratapa@codeaurora.org, subashab@codeaurora.org, elder@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH net-next 08/12] net: ipa: combine source and destination group limits Date: Fri, 26 Mar 2021 10:11:18 -0500 Message-Id: <20210326151122.3121383-9-elder@linaro.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210326151122.3121383-1-elder@linaro.org> References: <20210326151122.3121383-1-elder@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace IPA_RESOURCE_GROUP_SRC_MAX and IPA_RESOURCE_GROUP_DST_MAX with a single symbol, IPA_RESOURCE_GROUP_MAX. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data.h | 11 +++++------ drivers/net/ipa/ipa_resource.c | 10 +++++----- 2 files changed, 10 insertions(+), 11 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index e1096d8ba5751..d6d14818a3968 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -47,8 +47,7 @@ */ /* The maximum value returned by ipa_resource_group_{src,dst}_count() */ -#define IPA_RESOURCE_GROUP_SRC_MAX 5 -#define IPA_RESOURCE_GROUP_DST_MAX 5 +#define IPA_RESOURCE_GROUP_MAX 5 /** enum ipa_qsb_master_id - array index for IPA QSB configuration data */ enum ipa_qsb_master_id { @@ -206,18 +205,18 @@ struct ipa_resource_limits { /** * struct ipa_resource_src - source endpoint group resource usage - * @limits: array of limits to use for each resource group + * @limits: array of source resource limits, indexed by group */ struct ipa_resource_src { - struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_SRC_MAX]; + struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_MAX]; }; /** * struct ipa_resource_dst - destination endpoint group resource usage - * @limits: array of limits to use for each resource group + * @limits: array of destination resource limits, indexed by group */ struct ipa_resource_dst { - struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_DST_MAX]; + struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_MAX]; }; /** diff --git a/drivers/net/ipa/ipa_resource.c b/drivers/net/ipa/ipa_resource.c index 506bcccaef64f..38b95b6a5193d 100644 --- a/drivers/net/ipa/ipa_resource.c +++ b/drivers/net/ipa/ipa_resource.c @@ -77,10 +77,10 @@ static bool ipa_resource_limits_valid(struct ipa *ipa, u32 j; /* We program at most 6 source or destination resource group limits */ - BUILD_BUG_ON(IPA_RESOURCE_GROUP_SRC_MAX > 6); + BUILD_BUG_ON(IPA_RESOURCE_GROUP_MAX > 6); group_count = ipa_resource_group_src_count(ipa->version); - if (!group_count || group_count > IPA_RESOURCE_GROUP_SRC_MAX) + if (!group_count || group_count > IPA_RESOURCE_GROUP_MAX) return false; /* Return an error if a non-zero resource limit is specified @@ -90,20 +90,20 @@ static bool ipa_resource_limits_valid(struct ipa *ipa, const struct ipa_resource_src *resource; resource = &data->resource_src[i]; - for (j = group_count; j < IPA_RESOURCE_GROUP_SRC_MAX; j++) + for (j = group_count; j < IPA_RESOURCE_GROUP_MAX; j++) if (resource->limits[j].min || resource->limits[j].max) return false; } group_count = ipa_resource_group_dst_count(ipa->version); - if (!group_count || group_count > IPA_RESOURCE_GROUP_DST_MAX) + if (!group_count || group_count > IPA_RESOURCE_GROUP_MAX) return false; for (i = 0; i < data->resource_dst_count; i++) { const struct ipa_resource_dst *resource; resource = &data->resource_dst[i]; - for (j = group_count; j < IPA_RESOURCE_GROUP_DST_MAX; j++) + for (j = group_count; j < IPA_RESOURCE_GROUP_MAX; j++) if (resource->limits[j].min || resource->limits[j].max) return false; }