Commit 0985df73 authored by Simon Horman's avatar Simon Horman Committed by David S. Miller

rocker: remove unused rocker_port parameter from rocker_port_kfree

Remove unused rocker_port parameter from rocker_port_kfree.
Also remove the rocker_port parameter from callers of rocker_port_kfree
where the parameter it is now unused.
Signed-off-by: default avatarSimon Horman <simon.horman@netronome.com>
Acked-by: default avatarScott Feldman <sfeldma@gmail.com>
Acked-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 005e8709
...@@ -377,8 +377,7 @@ static void *rocker_port_kcalloc(struct rocker_port *rocker_port, ...@@ -377,8 +377,7 @@ static void *rocker_port_kcalloc(struct rocker_port *rocker_port,
return __rocker_port_mem_alloc(rocker_port, trans, n * size); return __rocker_port_mem_alloc(rocker_port, trans, n * size);
} }
static void rocker_port_kfree(struct rocker_port *rocker_port, static void rocker_port_kfree(enum switchdev_trans trans, const void *mem)
enum switchdev_trans trans, const void *mem)
{ {
struct list_head *elem; struct list_head *elem;
...@@ -423,11 +422,10 @@ static struct rocker_wait *rocker_wait_create(struct rocker_port *rocker_port, ...@@ -423,11 +422,10 @@ static struct rocker_wait *rocker_wait_create(struct rocker_port *rocker_port,
return wait; return wait;
} }
static void rocker_wait_destroy(struct rocker_port *rocker_port, static void rocker_wait_destroy(enum switchdev_trans trans,
enum switchdev_trans trans,
struct rocker_wait *wait) struct rocker_wait *wait)
{ {
rocker_port_kfree(rocker_port, trans, wait); rocker_port_kfree(trans, wait);
} }
static bool rocker_wait_event_timeout(struct rocker_wait *wait, static bool rocker_wait_event_timeout(struct rocker_wait *wait,
...@@ -1643,7 +1641,7 @@ static int rocker_cmd_exec(struct rocker *rocker, ...@@ -1643,7 +1641,7 @@ static int rocker_cmd_exec(struct rocker *rocker,
rocker_desc_gen_clear(desc_info); rocker_desc_gen_clear(desc_info);
out: out:
rocker_wait_destroy(rocker_port, trans, wait); rocker_wait_destroy(trans, wait);
return err; return err;
} }
...@@ -2435,7 +2433,7 @@ static int rocker_flow_tbl_add(struct rocker_port *rocker_port, ...@@ -2435,7 +2433,7 @@ static int rocker_flow_tbl_add(struct rocker_port *rocker_port,
match->cookie = found->cookie; match->cookie = found->cookie;
if (trans != SWITCHDEV_TRANS_PREPARE) if (trans != SWITCHDEV_TRANS_PREPARE)
hash_del(&found->entry); hash_del(&found->entry);
rocker_port_kfree(rocker_port, trans, found); rocker_port_kfree(trans, found);
found = match; found = match;
found->cmd = ROCKER_TLV_CMD_TYPE_OF_DPA_FLOW_MOD; found->cmd = ROCKER_TLV_CMD_TYPE_OF_DPA_FLOW_MOD;
} else { } else {
...@@ -2478,13 +2476,13 @@ static int rocker_flow_tbl_del(struct rocker_port *rocker_port, ...@@ -2478,13 +2476,13 @@ static int rocker_flow_tbl_del(struct rocker_port *rocker_port,
spin_unlock_irqrestore(&rocker->flow_tbl_lock, flags); spin_unlock_irqrestore(&rocker->flow_tbl_lock, flags);
rocker_port_kfree(rocker_port, trans, match); rocker_port_kfree(trans, match);
if (found) { if (found) {
err = rocker_cmd_exec(rocker, rocker_port, trans, err = rocker_cmd_exec(rocker, rocker_port, trans,
rocker_cmd_flow_tbl_del, rocker_cmd_flow_tbl_del,
found, NULL, NULL); found, NULL, NULL);
rocker_port_kfree(rocker_port, trans, found); rocker_port_kfree(trans, found);
} }
return err; return err;
...@@ -2729,19 +2727,18 @@ rocker_group_tbl_find(struct rocker *rocker, ...@@ -2729,19 +2727,18 @@ rocker_group_tbl_find(struct rocker *rocker,
return NULL; return NULL;
} }
static void rocker_group_tbl_entry_free(struct rocker_port *rocker_port, static void rocker_group_tbl_entry_free(enum switchdev_trans trans,
enum switchdev_trans trans,
struct rocker_group_tbl_entry *entry) struct rocker_group_tbl_entry *entry)
{ {
switch (ROCKER_GROUP_TYPE_GET(entry->group_id)) { switch (ROCKER_GROUP_TYPE_GET(entry->group_id)) {
case ROCKER_OF_DPA_GROUP_TYPE_L2_FLOOD: case ROCKER_OF_DPA_GROUP_TYPE_L2_FLOOD:
case ROCKER_OF_DPA_GROUP_TYPE_L2_MCAST: case ROCKER_OF_DPA_GROUP_TYPE_L2_MCAST:
rocker_port_kfree(rocker_port, trans, entry->group_ids); rocker_port_kfree(trans, entry->group_ids);
break; break;
default: default:
break; break;
} }
rocker_port_kfree(rocker_port, trans, entry); rocker_port_kfree(trans, entry);
} }
static int rocker_group_tbl_add(struct rocker_port *rocker_port, static int rocker_group_tbl_add(struct rocker_port *rocker_port,
...@@ -2759,7 +2756,7 @@ static int rocker_group_tbl_add(struct rocker_port *rocker_port, ...@@ -2759,7 +2756,7 @@ static int rocker_group_tbl_add(struct rocker_port *rocker_port,
if (found) { if (found) {
if (trans != SWITCHDEV_TRANS_PREPARE) if (trans != SWITCHDEV_TRANS_PREPARE)
hash_del(&found->entry); hash_del(&found->entry);
rocker_group_tbl_entry_free(rocker_port, trans, found); rocker_group_tbl_entry_free(trans, found);
found = match; found = match;
found->cmd = ROCKER_TLV_CMD_TYPE_OF_DPA_GROUP_MOD; found->cmd = ROCKER_TLV_CMD_TYPE_OF_DPA_GROUP_MOD;
} else { } else {
...@@ -2798,13 +2795,13 @@ static int rocker_group_tbl_del(struct rocker_port *rocker_port, ...@@ -2798,13 +2795,13 @@ static int rocker_group_tbl_del(struct rocker_port *rocker_port,
spin_unlock_irqrestore(&rocker->group_tbl_lock, flags); spin_unlock_irqrestore(&rocker->group_tbl_lock, flags);
rocker_group_tbl_entry_free(rocker_port, trans, match); rocker_group_tbl_entry_free(trans, match);
if (found) { if (found) {
err = rocker_cmd_exec(rocker, rocker_port, trans, err = rocker_cmd_exec(rocker, rocker_port, trans,
rocker_cmd_group_tbl_del, rocker_cmd_group_tbl_del,
found, NULL, NULL); found, NULL, NULL);
rocker_group_tbl_entry_free(rocker_port, trans, found); rocker_group_tbl_entry_free(trans, found);
} }
return err; return err;
...@@ -2854,7 +2851,7 @@ static int rocker_group_l2_fan_out(struct rocker_port *rocker_port, ...@@ -2854,7 +2851,7 @@ static int rocker_group_l2_fan_out(struct rocker_port *rocker_port,
entry->group_ids = rocker_port_kcalloc(rocker_port, trans, group_count, entry->group_ids = rocker_port_kcalloc(rocker_port, trans, group_count,
sizeof(u32)); sizeof(u32));
if (!entry->group_ids) { if (!entry->group_ids) {
rocker_port_kfree(rocker_port, trans, entry); rocker_port_kfree(trans, entry);
return -ENOMEM; return -ENOMEM;
} }
memcpy(entry->group_ids, group_ids, group_count * sizeof(u32)); memcpy(entry->group_ids, group_ids, group_count * sizeof(u32));
...@@ -2921,15 +2918,14 @@ static void _rocker_neigh_add(struct rocker *rocker, ...@@ -2921,15 +2918,14 @@ static void _rocker_neigh_add(struct rocker *rocker,
be32_to_cpu(entry->ip_addr)); be32_to_cpu(entry->ip_addr));
} }
static void _rocker_neigh_del(struct rocker_port *rocker_port, static void _rocker_neigh_del(enum switchdev_trans trans,
enum switchdev_trans trans,
struct rocker_neigh_tbl_entry *entry) struct rocker_neigh_tbl_entry *entry)
{ {
if (trans == SWITCHDEV_TRANS_PREPARE) if (trans == SWITCHDEV_TRANS_PREPARE)
return; return;
if (--entry->ref_count == 0) { if (--entry->ref_count == 0) {
hash_del(&entry->entry); hash_del(&entry->entry);
rocker_port_kfree(rocker_port, trans, entry); rocker_port_kfree(trans, entry);
} }
} }
...@@ -2983,7 +2979,7 @@ static int rocker_port_ipv4_neigh(struct rocker_port *rocker_port, ...@@ -2983,7 +2979,7 @@ static int rocker_port_ipv4_neigh(struct rocker_port *rocker_port,
_rocker_neigh_add(rocker, trans, entry); _rocker_neigh_add(rocker, trans, entry);
} else if (removing) { } else if (removing) {
memcpy(entry, found, sizeof(*entry)); memcpy(entry, found, sizeof(*entry));
_rocker_neigh_del(rocker_port, trans, found); _rocker_neigh_del(trans, found);
} else if (updating) { } else if (updating) {
_rocker_neigh_update(found, trans, eth_dst, true); _rocker_neigh_update(found, trans, eth_dst, true);
memcpy(entry, found, sizeof(*entry)); memcpy(entry, found, sizeof(*entry));
...@@ -3032,7 +3028,7 @@ static int rocker_port_ipv4_neigh(struct rocker_port *rocker_port, ...@@ -3032,7 +3028,7 @@ static int rocker_port_ipv4_neigh(struct rocker_port *rocker_port,
err_out: err_out:
if (!adding) if (!adding)
rocker_port_kfree(rocker_port, trans, entry); rocker_port_kfree(trans, entry);
return err; return err;
} }
...@@ -3100,7 +3096,7 @@ static int rocker_port_ipv4_nh(struct rocker_port *rocker_port, ...@@ -3100,7 +3096,7 @@ static int rocker_port_ipv4_nh(struct rocker_port *rocker_port,
*index = entry->index; *index = entry->index;
resolved = false; resolved = false;
} else if (removing) { } else if (removing) {
_rocker_neigh_del(rocker_port, trans, found); _rocker_neigh_del(trans, found);
} else if (updating) { } else if (updating) {
_rocker_neigh_update(found, trans, NULL, false); _rocker_neigh_update(found, trans, NULL, false);
resolved = !is_zero_ether_addr(found->eth_dst); resolved = !is_zero_ether_addr(found->eth_dst);
...@@ -3111,7 +3107,7 @@ static int rocker_port_ipv4_nh(struct rocker_port *rocker_port, ...@@ -3111,7 +3107,7 @@ static int rocker_port_ipv4_nh(struct rocker_port *rocker_port,
spin_unlock_irqrestore(&rocker->neigh_tbl_lock, lock_flags); spin_unlock_irqrestore(&rocker->neigh_tbl_lock, lock_flags);
if (!adding) if (!adding)
rocker_port_kfree(rocker_port, trans, entry); rocker_port_kfree(trans, entry);
if (err) if (err)
return err; return err;
...@@ -3167,7 +3163,7 @@ static int rocker_port_vlan_flood_group(struct rocker_port *rocker_port, ...@@ -3167,7 +3163,7 @@ static int rocker_port_vlan_flood_group(struct rocker_port *rocker_port,
"Error (%d) port VLAN l2 flood group\n", err); "Error (%d) port VLAN l2 flood group\n", err);
no_ports_in_vlan: no_ports_in_vlan:
rocker_port_kfree(rocker_port, trans, group_ids); rocker_port_kfree(trans, group_ids);
return err; return err;
} }
...@@ -3526,7 +3522,7 @@ static void rocker_port_fdb_learn_work(struct work_struct *work) ...@@ -3526,7 +3522,7 @@ static void rocker_port_fdb_learn_work(struct work_struct *work)
call_switchdev_notifiers(SWITCHDEV_FDB_ADD, call_switchdev_notifiers(SWITCHDEV_FDB_ADD,
lw->rocker_port->dev, &info.info); lw->rocker_port->dev, &info.info);
rocker_port_kfree(lw->rocker_port, lw->trans, work); rocker_port_kfree(lw->trans, work);
} }
static int rocker_port_fdb_learn(struct rocker_port *rocker_port, static int rocker_port_fdb_learn(struct rocker_port *rocker_port,
...@@ -3573,7 +3569,7 @@ static int rocker_port_fdb_learn(struct rocker_port *rocker_port, ...@@ -3573,7 +3569,7 @@ static int rocker_port_fdb_learn(struct rocker_port *rocker_port,
lw->vid = rocker_port_vlan_to_vid(rocker_port, vlan_id); lw->vid = rocker_port_vlan_to_vid(rocker_port, vlan_id);
if (trans == SWITCHDEV_TRANS_PREPARE) if (trans == SWITCHDEV_TRANS_PREPARE)
rocker_port_kfree(rocker_port, trans, lw); rocker_port_kfree(trans, lw);
else else
schedule_work(&lw->work); schedule_work(&lw->work);
...@@ -3618,7 +3614,7 @@ static int rocker_port_fdb(struct rocker_port *rocker_port, ...@@ -3618,7 +3614,7 @@ static int rocker_port_fdb(struct rocker_port *rocker_port,
found = rocker_fdb_tbl_find(rocker, fdb); found = rocker_fdb_tbl_find(rocker, fdb);
if (removing && found) { if (removing && found) {
rocker_port_kfree(rocker_port, trans, fdb); rocker_port_kfree(trans, fdb);
if (trans != SWITCHDEV_TRANS_PREPARE) if (trans != SWITCHDEV_TRANS_PREPARE)
hash_del(&found->entry); hash_del(&found->entry);
} else if (!removing && !found) { } else if (!removing && !found) {
...@@ -3630,7 +3626,7 @@ static int rocker_port_fdb(struct rocker_port *rocker_port, ...@@ -3630,7 +3626,7 @@ static int rocker_port_fdb(struct rocker_port *rocker_port,
/* Check if adding and already exists, or removing and can't find */ /* Check if adding and already exists, or removing and can't find */
if (!found != !removing) { if (!found != !removing) {
rocker_port_kfree(rocker_port, trans, fdb); rocker_port_kfree(trans, fdb);
if (!found && removing) if (!found && removing)
return 0; return 0;
/* Refreshing existing to update aging timers */ /* Refreshing existing to update aging timers */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment