diff mbox series

[net-next,09/12] net: ipa: combine source and destation resource types

Message ID 20210326151122.3121383-10-elder@linaro.org (mailing list archive)
State Accepted
Commit 7336ce1a7ae70335b895901f4b1893c7f40b6be5
Delegated to: Netdev Maintainers
Headers show
Series net: ipa: rework resource programming | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 4 of 4 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 0 this patch: 0
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 96 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 0 this patch: 0
netdev/header_inline success Link

Commit Message

Alex Elder March 26, 2021, 3:11 p.m. UTC
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 <elder@linaro.org>
---
 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(-)
diff mbox series

Patch

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;