Unverified Commit 7c1664a5 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!12185 mlxsw: spectrum_acl_erp: Fix object nesting warning

parents 71dec73f 839de53d
Loading
Loading
Loading
Loading
+0 −13
Original line number Diff line number Diff line
@@ -1217,18 +1217,6 @@ static bool mlxsw_sp_acl_erp_delta_check(void *priv, const void *parent_obj,
	return err ? false : true;
}

static int mlxsw_sp_acl_erp_hints_obj_cmp(const void *obj1, const void *obj2)
{
	const struct mlxsw_sp_acl_erp_key *key1 = obj1;
	const struct mlxsw_sp_acl_erp_key *key2 = obj2;

	/* For hints purposes, two objects are considered equal
	 * in case the masks are the same. Does not matter what
	 * the "ctcam" value is.
	 */
	return memcmp(key1->mask, key2->mask, sizeof(key1->mask));
}

static void *mlxsw_sp_acl_erp_delta_create(void *priv, void *parent_obj,
					   void *obj)
{
@@ -1308,7 +1296,6 @@ static void mlxsw_sp_acl_erp_root_destroy(void *priv, void *root_priv)
static const struct objagg_ops mlxsw_sp_acl_erp_objagg_ops = {
	.obj_size = sizeof(struct mlxsw_sp_acl_erp_key),
	.delta_check = mlxsw_sp_acl_erp_delta_check,
	.hints_obj_cmp = mlxsw_sp_acl_erp_hints_obj_cmp,
	.delta_create = mlxsw_sp_acl_erp_delta_create,
	.delta_destroy = mlxsw_sp_acl_erp_delta_destroy,
	.root_create = mlxsw_sp_acl_erp_root_create,
+0 −1
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ struct objagg_ops {
	size_t obj_size;
	bool (*delta_check)(void *priv, const void *parent_obj,
			    const void *obj);
	int (*hints_obj_cmp)(const void *obj1, const void *obj2);
	void * (*delta_create)(void *priv, void *parent_obj, void *obj);
	void (*delta_destroy)(void *priv, void *delta_priv);
	void * (*root_create)(void *priv, void *obj, unsigned int root_id);
+0 −15
Original line number Diff line number Diff line
@@ -909,20 +909,6 @@ static const struct objagg_opt_algo *objagg_opt_algos[] = {
	[OBJAGG_OPT_ALGO_SIMPLE_GREEDY] = &objagg_opt_simple_greedy,
};

static int objagg_hints_obj_cmp(struct rhashtable_compare_arg *arg,
				const void *obj)
{
	struct rhashtable *ht = arg->ht;
	struct objagg_hints *objagg_hints =
			container_of(ht, struct objagg_hints, node_ht);
	const struct objagg_ops *ops = objagg_hints->ops;
	const char *ptr = obj;

	ptr += ht->p.key_offset;
	return ops->hints_obj_cmp ? ops->hints_obj_cmp(ptr, arg->key) :
				    memcmp(ptr, arg->key, ht->p.key_len);
}

/**
 * objagg_hints_get - obtains hints instance
 * @objagg:		objagg instance
@@ -961,7 +947,6 @@ struct objagg_hints *objagg_hints_get(struct objagg *objagg,
				offsetof(struct objagg_hints_node, obj);
	objagg_hints->ht_params.head_offset =
				offsetof(struct objagg_hints_node, ht_node);
	objagg_hints->ht_params.obj_cmpfn = objagg_hints_obj_cmp;

	err = rhashtable_init(&objagg_hints->node_ht, &objagg_hints->ht_params);
	if (err)