From patchwork Fri Mar 26 15:11:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 409520 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp1519035jai; Fri, 26 Mar 2021 08:12:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6o7bQv56gD0nHw0Vk3DxlkSHsO1t4lKt75g3uP5yglF0FA3dolEoda6Wxc89l/LN2iv0n X-Received: by 2002:a17:907:76b3:: with SMTP id jw19mr15543862ejc.202.1616771560792; Fri, 26 Mar 2021 08:12:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616771560; cv=none; d=google.com; s=arc-20160816; b=Ej3E4kPm2yIcvIwXeNEjNJo5yrZWpa6P4Zd8yrWk8eyhtus4B4LL3uDQC85TWgH+z+ gLqu/HEorFWps/HwYqdiL272GRhW6BOh0bq4y3i7HWRDKq20HXSNfjOjF1YWhOvq2oM3 yMT/DUj7x2rF1+q2PppdiuSqwE0oZ+B0sgyTYphGl+GD8yDzuRumEagMtkn/6NWn2LVf 6z4WsgqQkDywPtpQ3v0zyQZD1zzUb9HfeEPpAuSdOG6h1pCTze8w3F6Z8POjqx23ub+p YLSkjfDn3V8F6kxJV9nYSzA2nG/K2x3T73IM28XzOCwSv8j03Tfd5qVx07BpZOgInMZP Bybw== 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=1SaFkQw5ra/MhjdSrVDbweSgeBOe0ryrQaUo5/px9lE=; b=HO+r6NdrIaftBmNPmMcCyJN1GbGfEWe/c9pOKD49DWj9pvnTiiYNpXWklLFS6PGZxX 8IdhzlOx7YyodS6TdW7vK56/ZWhhGqcCxbAOx2IImM7gUZA+nu4VrZqe/V1BbIpeAUYf j17p+1zdzELINwxHgueIn2esw1oxbToM3Et9rv/ZGPoj8fZLCSkfZIcPkfKX6gsjjAdM sCFMyn5KpiaoEqqTvqhMZNVqiclwoRnNjFaqnWKN9hK+rkcbUu5bhhuJ+YK37vHTgzs0 uwm8YJZK6mSI6/qAGqNO9ZCtymN1W24vUP5ri3MMBUULxh8oNZYpDbGt2bCzgcUvxKd7 829A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MJuoFsFg; 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.40; Fri, 26 Mar 2021 08:12:40 -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=MJuoFsFg; 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 S231217AbhCZPMV (ORCPT + 8 others); Fri, 26 Mar 2021 11:12:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230335AbhCZPLf (ORCPT ); Fri, 26 Mar 2021 11:11:35 -0400 Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B44D1C0613B2 for ; Fri, 26 Mar 2021 08:11:35 -0700 (PDT) Received: by mail-io1-xd35.google.com with SMTP id x16so5726986iob.1 for ; Fri, 26 Mar 2021 08:11:35 -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=1SaFkQw5ra/MhjdSrVDbweSgeBOe0ryrQaUo5/px9lE=; b=MJuoFsFgZYfRvVWzz9Iy3qrBK7H8pgZYRP+F7uuzXSuD5TZW+1DJByKPEbyTrdB0S2 3YJluQYAsLBa4gkJoXBhsliKYG5PT/9neEHWAU9y8UZK9EL/9RJX05azglE10EaOEZz6 hf5JsGlj2Xi0NCbGgJTYrbIfjGEHklaiAPSD9O15aHSzjEF7qYxQklJoTmXOKc0FzGRh fznq1URTWvzfEoQNdAK6CW1DrqgwRkkVLafCZvnKIswcxRNNKt7Oq4Wl51GDMuBT3IMX K3/uv1DDK5LJ/+hngk05vSaBwmCb/mgbqaJuS5ecarFiBwYAXif4szUDc/vZ4FlKmX5N D99w== 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=1SaFkQw5ra/MhjdSrVDbweSgeBOe0ryrQaUo5/px9lE=; b=HLz7mwMjqfr27XgeA5aZaW2uTr86UMLz6iPiVJQydsIBVdu5idyqznowGWS7kbwjlq rkMy7JLP0EJtooKDF7B5zJITaxIm87SoVk707CgEoSD3YdQT/Tgac/Z4FhhQ6/tNT08o HS/Ko0rdwdipaZ5vg6VhsKbT4h3HCKTeMyq7vWxWiZaKZvuuXv/e1e11FLiOrFWOCs/w Hj322fWOCebsiiJsaW2b3EPWFG9sDx9GF9jr1Mp6AqgdqwSX4npZc1XPsKcb04b8Wb22 PAOb91zsGDNlhl5IKJNS1XXBf3DjfFP4Ofu6aFJxzi4l6Gkkbq/5gGRmdjHpPicFczM9 pcXg== X-Gm-Message-State: AOAM530xGswNqrc+47EGFmXVcrIdMdpMl360iPxhGSOTQb6smKq4DGF/ zonV5b0oRcOkUexhNwn4qeNkKg== X-Received: by 2002:a02:c894:: with SMTP id m20mr12578246jao.80.1616771494926; 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.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Mar 2021 08:11:34 -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 09/12] net: ipa: combine source and destation resource types Date: Fri, 26 Mar 2021 10:11:19 -0500 Message-Id: <20210326151122.3121383-10-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 The ipa_resource_src and ipa_resource_dst structures are identical in form, so just replace them with a single structure. Signed-off-by: Alex Elder --- drivers/net/ipa/ipa_data-sc7180.c | 4 ++-- drivers/net/ipa/ipa_data-sdm845.c | 4 ++-- drivers/net/ipa/ipa_data.h | 18 +++++------------- drivers/net/ipa/ipa_resource.c | 8 ++++---- 4 files changed, 13 insertions(+), 21 deletions(-) -- 2.27.0 diff --git a/drivers/net/ipa/ipa_data-sc7180.c b/drivers/net/ipa/ipa_data-sc7180.c index 24ff315175653..631b50fc8d534 100644 --- a/drivers/net/ipa/ipa_data-sc7180.c +++ b/drivers/net/ipa/ipa_data-sc7180.c @@ -163,7 +163,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { }; /* Source resource configuration data for the SC7180 SoC */ -static const struct ipa_resource_src ipa_resource_src[] = { +static const struct ipa_resource ipa_resource_src[] = { [IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = { .limits[IPA_RSRC_GROUP_SRC_UL_DL] = { .min = 3, .max = 63, @@ -192,7 +192,7 @@ static const struct ipa_resource_src ipa_resource_src[] = { }; /* Destination resource configuration data for the SC7180 SoC */ -static const struct ipa_resource_dst ipa_resource_dst[] = { +static const struct ipa_resource ipa_resource_dst[] = { [IPA_RESOURCE_TYPE_DST_DATA_SECTORS] = { .limits[IPA_RSRC_GROUP_DST_UL_DL_DPL] = { .min = 3, .max = 3, diff --git a/drivers/net/ipa/ipa_data-sdm845.c b/drivers/net/ipa/ipa_data-sdm845.c index 357e8ba43a364..3c9675ce556ce 100644 --- a/drivers/net/ipa/ipa_data-sdm845.c +++ b/drivers/net/ipa/ipa_data-sdm845.c @@ -181,7 +181,7 @@ static const struct ipa_gsi_endpoint_data ipa_gsi_endpoint_data[] = { }; /* Source resource configuration data for the SDM845 SoC */ -static const struct ipa_resource_src ipa_resource_src[] = { +static const struct ipa_resource ipa_resource_src[] = { [IPA_RESOURCE_TYPE_SRC_PKT_CONTEXTS] = { .limits[IPA_RSRC_GROUP_SRC_LWA_DL] = { .min = 1, .max = 255, @@ -243,7 +243,7 @@ static const struct ipa_resource_src ipa_resource_src[] = { }; /* Destination resource configuration data for the SDM845 SoC */ -static const struct ipa_resource_dst ipa_resource_dst[] = { +static const struct ipa_resource ipa_resource_dst[] = { [IPA_RESOURCE_TYPE_DST_DATA_SECTORS] = { .limits[IPA_RSRC_GROUP_DST_LWA_DL] = { .min = 4, .max = 4, diff --git a/drivers/net/ipa/ipa_data.h b/drivers/net/ipa/ipa_data.h index d6d14818a3968..9060586eb7cba 100644 --- a/drivers/net/ipa/ipa_data.h +++ b/drivers/net/ipa/ipa_data.h @@ -204,18 +204,10 @@ struct ipa_resource_limits { }; /** - * struct ipa_resource_src - source endpoint group resource usage - * @limits: array of source resource limits, indexed by group + * struct ipa_resource - resource group source or destination resource usage + * @limits: array of resource limits, indexed by group */ -struct ipa_resource_src { - struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_MAX]; -}; - -/** - * struct ipa_resource_dst - destination endpoint group resource usage - * @limits: array of destination resource limits, indexed by group - */ -struct ipa_resource_dst { +struct ipa_resource { struct ipa_resource_limits limits[IPA_RESOURCE_GROUP_MAX]; }; @@ -233,9 +225,9 @@ struct ipa_resource_dst { */ struct ipa_resource_data { u32 resource_src_count; - const struct ipa_resource_src *resource_src; + const struct ipa_resource *resource_src; u32 resource_dst_count; - const struct ipa_resource_dst *resource_dst; + const struct ipa_resource *resource_dst; }; /** diff --git a/drivers/net/ipa/ipa_resource.c b/drivers/net/ipa/ipa_resource.c index 38b95b6a5193d..c7edacfa7d19d 100644 --- a/drivers/net/ipa/ipa_resource.c +++ b/drivers/net/ipa/ipa_resource.c @@ -87,7 +87,7 @@ static bool ipa_resource_limits_valid(struct ipa *ipa, * for a resource group not supported by hardware. */ for (i = 0; i < data->resource_src_count; i++) { - const struct ipa_resource_src *resource; + const struct ipa_resource *resource; resource = &data->resource_src[i]; for (j = group_count; j < IPA_RESOURCE_GROUP_MAX; j++) @@ -100,7 +100,7 @@ static bool ipa_resource_limits_valid(struct ipa *ipa, return false; for (i = 0; i < data->resource_dst_count; i++) { - const struct ipa_resource_dst *resource; + const struct ipa_resource *resource; resource = &data->resource_dst[i]; for (j = group_count; j < IPA_RESOURCE_GROUP_MAX; j++) @@ -129,7 +129,7 @@ ipa_resource_config_common(struct ipa *ipa, u32 offset, } static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type, - const struct ipa_resource_src *resource) + const struct ipa_resource *resource) { u32 group_count = ipa_resource_group_src_count(ipa->version); const struct ipa_resource_limits *ylimits; @@ -155,7 +155,7 @@ static void ipa_resource_config_src(struct ipa *ipa, u32 resource_type, } static void ipa_resource_config_dst(struct ipa *ipa, u32 resource_type, - const struct ipa_resource_dst *resource) + const struct ipa_resource *resource) { u32 group_count = ipa_resource_group_dst_count(ipa->version); const struct ipa_resource_limits *ylimits;