All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, kuba@kernel.org, idosch@mellanox.com,
	mlxsw@mellanox.com
Subject: [patch net-next 10/12] mlxsw: spectrum_acl: Make block arg const where appropriate
Date: Sun, 23 Feb 2020 08:31:42 +0100	[thread overview]
Message-ID: <20200223073144.28529-11-jiri@resnulli.us> (raw)
In-Reply-To: <20200223073144.28529-1-jiri@resnulli.us>

From: Jiri Pirko <jiri@mellanox.com>

There are couple of places where block pointer as a function argument
can be const. So make those const.

Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: Ido Schimmel <idosch@mellanox.com>
---
 drivers/net/ethernet/mellanox/mlxsw/spectrum.h     |  7 ++++---
 drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c | 10 ++++++----
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
index bb02a0361bfd..9335f6a01b87 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.h
@@ -670,10 +670,11 @@ struct mlxsw_sp_acl_block {
 
 struct mlxsw_afk *mlxsw_sp_acl_afk(struct mlxsw_sp_acl *acl);
 struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block);
-unsigned int mlxsw_sp_acl_block_rule_count(struct mlxsw_sp_acl_block *block);
+unsigned int
+mlxsw_sp_acl_block_rule_count(const struct mlxsw_sp_acl_block *block);
 void mlxsw_sp_acl_block_disable_inc(struct mlxsw_sp_acl_block *block);
 void mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block);
-bool mlxsw_sp_acl_block_disabled(struct mlxsw_sp_acl_block *block);
+bool mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block);
 struct mlxsw_sp_acl_block *mlxsw_sp_acl_block_create(struct mlxsw_sp *mlxsw_sp,
 						     struct net *net);
 void mlxsw_sp_acl_block_destroy(struct mlxsw_sp_acl_block *block);
@@ -686,7 +687,7 @@ int mlxsw_sp_acl_block_unbind(struct mlxsw_sp *mlxsw_sp,
 			      struct mlxsw_sp_acl_block *block,
 			      struct mlxsw_sp_port *mlxsw_sp_port,
 			      bool ingress);
-bool mlxsw_sp_acl_block_is_egress_bound(struct mlxsw_sp_acl_block *block);
+bool mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block);
 struct mlxsw_sp_acl_ruleset *
 mlxsw_sp_acl_ruleset_lookup(struct mlxsw_sp *mlxsw_sp,
 			    struct mlxsw_sp_acl_block *block, u32 chain_index,
diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
index 9368b93dab38..7b460c08f779 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_acl.c
@@ -99,7 +99,8 @@ struct mlxsw_sp *mlxsw_sp_acl_block_mlxsw_sp(struct mlxsw_sp_acl_block *block)
 	return block->mlxsw_sp;
 }
 
-unsigned int mlxsw_sp_acl_block_rule_count(struct mlxsw_sp_acl_block *block)
+unsigned int
+mlxsw_sp_acl_block_rule_count(const struct mlxsw_sp_acl_block *block)
 {
 	return block ? block->rule_count : 0;
 }
@@ -116,12 +117,12 @@ void mlxsw_sp_acl_block_disable_dec(struct mlxsw_sp_acl_block *block)
 		block->disable_count--;
 }
 
-bool mlxsw_sp_acl_block_disabled(struct mlxsw_sp_acl_block *block)
+bool mlxsw_sp_acl_block_disabled(const struct mlxsw_sp_acl_block *block)
 {
 	return block->disable_count;
 }
 
-bool mlxsw_sp_acl_block_is_egress_bound(struct mlxsw_sp_acl_block *block)
+bool mlxsw_sp_acl_block_is_egress_bound(const struct mlxsw_sp_acl_block *block)
 {
 	struct mlxsw_sp_acl_block_binding *binding;
 
@@ -163,7 +164,8 @@ mlxsw_sp_acl_ruleset_unbind(struct mlxsw_sp *mlxsw_sp,
 			    binding->mlxsw_sp_port, binding->ingress);
 }
 
-static bool mlxsw_sp_acl_ruleset_block_bound(struct mlxsw_sp_acl_block *block)
+static bool
+mlxsw_sp_acl_ruleset_block_bound(const struct mlxsw_sp_acl_block *block)
 {
 	return block->ruleset_zero;
 }
-- 
2.21.1


  parent reply	other threads:[~2020-02-23  7:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-23  7:31 [patch net-next 00/12] mlxsw: Cosmetic fixes Jiri Pirko
2020-02-23  7:31 ` [patch net-next 01/12] mlxsw: spectrum_trap: Use err variable instead of directly checking func return value Jiri Pirko
2020-02-23  7:31 ` [patch net-next 02/12] mlxsw: spectrum_trap: Move functions to avoid their forward declarations Jiri Pirko
2020-02-23  7:31 ` [patch net-next 03/12] mlxsw: core_acl_flex_actions: Rename Trap / Discard Action to Trap Action Jiri Pirko
2020-02-23  7:31 ` [patch net-next 04/12] mlxsw: spectrum_trap: Move policer initialization to mlxsw_sp_trap_init() Jiri Pirko
2020-02-23  7:31 ` [patch net-next 05/12] mlxsw: core: Remove unused action field from mlxsw_rx_listener struct Jiri Pirko
2020-02-23  7:31 ` [patch net-next 06/12] mlxsw: core: Remove dummy union name from struct mlxsw_listener Jiri Pirko
2020-02-23  7:31 ` [patch net-next 07/12] mlxsw: core: Convert is_event and is_ctrl bools to be single bits Jiri Pirko
2020-02-23  7:31 ` [patch net-next 08/12] mlxsw: core: Remove initialization to false of mlxsw_listener struct Jiri Pirko
2020-02-23  7:31 ` [patch net-next 09/12] mlxsw: spectrum_trap: Make global arrays const as they should be Jiri Pirko
2020-02-23  7:31 ` Jiri Pirko [this message]
2020-02-23  7:31 ` [patch net-next 11/12] mlxsw: core: Remove priv from listener equality comparison Jiri Pirko
2020-02-23  7:31 ` [patch net-next 12/12] mlxsw: pci: Remove unused values Jiri Pirko
2020-02-24  0:13 ` [patch net-next 00/12] mlxsw: Cosmetic fixes David Miller
2020-02-24  7:02   ` Jiri Pirko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200223073144.28529-11-jiri@resnulli.us \
    --to=jiri@resnulli.us \
    --cc=davem@davemloft.net \
    --cc=idosch@mellanox.com \
    --cc=kuba@kernel.org \
    --cc=mlxsw@mellanox.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.