diff options
author | Eugenia Emantayev <eugenia@mellanox.co.il> | 2012-02-14 01:37:46 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-14 14:11:58 -0500 |
commit | deb8b3e8494f63b05ce144a52e8c0b3f80789fed (patch) | |
tree | 715875b0a4fc5e4beaafdbe4fd31405097abd7ce | |
parent | 45b5136551e42a1c2bca8edad8e6f3247ca5a729 (diff) |
mlx4: remove unnecessary variables and arguments
mlx4_qp_attach/detach_common() don't use hash variable, move it to find_entry()
static find_entry() in mcg.c doesn't use steer argument
Signed-off-by: Eugenia Emantayev <eugenia@mellanox.co.il>
Reviewed-by: Yevgeny Petrilin <yevgenyp@mellanox.co.il>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/mcg.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/mcg.c b/drivers/net/ethernet/mellanox/mlx4/mcg.c index ca574d850b39..da63874a5005 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mcg.c +++ b/drivers/net/ethernet/mellanox/mlx4/mcg.c | |||
@@ -562,14 +562,14 @@ out_mutex: | |||
562 | */ | 562 | */ |
563 | static int find_entry(struct mlx4_dev *dev, u8 port, | 563 | static int find_entry(struct mlx4_dev *dev, u8 port, |
564 | u8 *gid, enum mlx4_protocol prot, | 564 | u8 *gid, enum mlx4_protocol prot, |
565 | enum mlx4_steer_type steer, | ||
566 | struct mlx4_cmd_mailbox *mgm_mailbox, | 565 | struct mlx4_cmd_mailbox *mgm_mailbox, |
567 | u16 *hash, int *prev, int *index) | 566 | int *prev, int *index) |
568 | { | 567 | { |
569 | struct mlx4_cmd_mailbox *mailbox; | 568 | struct mlx4_cmd_mailbox *mailbox; |
570 | struct mlx4_mgm *mgm = mgm_mailbox->buf; | 569 | struct mlx4_mgm *mgm = mgm_mailbox->buf; |
571 | u8 *mgid; | 570 | u8 *mgid; |
572 | int err; | 571 | int err; |
572 | u16 hash; | ||
573 | u8 op_mod = (prot == MLX4_PROT_ETH) ? | 573 | u8 op_mod = (prot == MLX4_PROT_ETH) ? |
574 | !!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) : 0; | 574 | !!(dev->caps.flags & MLX4_DEV_CAP_FLAG_VEP_MC_STEER) : 0; |
575 | 575 | ||
@@ -580,15 +580,15 @@ static int find_entry(struct mlx4_dev *dev, u8 port, | |||
580 | 580 | ||
581 | memcpy(mgid, gid, 16); | 581 | memcpy(mgid, gid, 16); |
582 | 582 | ||
583 | err = mlx4_GID_HASH(dev, mailbox, hash, op_mod); | 583 | err = mlx4_GID_HASH(dev, mailbox, &hash, op_mod); |
584 | mlx4_free_cmd_mailbox(dev, mailbox); | 584 | mlx4_free_cmd_mailbox(dev, mailbox); |
585 | if (err) | 585 | if (err) |
586 | return err; | 586 | return err; |
587 | 587 | ||
588 | if (0) | 588 | if (0) |
589 | mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash); | 589 | mlx4_dbg(dev, "Hash for %pI6 is %04x\n", gid, hash); |
590 | 590 | ||
591 | *index = *hash; | 591 | *index = hash; |
592 | *prev = -1; | 592 | *prev = -1; |
593 | 593 | ||
594 | do { | 594 | do { |
@@ -597,7 +597,7 @@ static int find_entry(struct mlx4_dev *dev, u8 port, | |||
597 | return err; | 597 | return err; |
598 | 598 | ||
599 | if (!(be32_to_cpu(mgm->members_count) & 0xffffff)) { | 599 | if (!(be32_to_cpu(mgm->members_count) & 0xffffff)) { |
600 | if (*index != *hash) { | 600 | if (*index != hash) { |
601 | mlx4_err(dev, "Found zero MGID in AMGM.\n"); | 601 | mlx4_err(dev, "Found zero MGID in AMGM.\n"); |
602 | err = -EINVAL; | 602 | err = -EINVAL; |
603 | } | 603 | } |
@@ -624,7 +624,6 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
624 | struct mlx4_cmd_mailbox *mailbox; | 624 | struct mlx4_cmd_mailbox *mailbox; |
625 | struct mlx4_mgm *mgm; | 625 | struct mlx4_mgm *mgm; |
626 | u32 members_count; | 626 | u32 members_count; |
627 | u16 hash; | ||
628 | int index, prev; | 627 | int index, prev; |
629 | int link = 0; | 628 | int link = 0; |
630 | int i; | 629 | int i; |
@@ -638,8 +637,8 @@ int mlx4_qp_attach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
638 | mgm = mailbox->buf; | 637 | mgm = mailbox->buf; |
639 | 638 | ||
640 | mutex_lock(&priv->mcg_table.mutex); | 639 | mutex_lock(&priv->mcg_table.mutex); |
641 | err = find_entry(dev, port, gid, prot, steer, | 640 | err = find_entry(dev, port, gid, prot, |
642 | mailbox, &hash, &prev, &index); | 641 | mailbox, &prev, &index); |
643 | if (err) | 642 | if (err) |
644 | goto out; | 643 | goto out; |
645 | 644 | ||
@@ -733,7 +732,6 @@ int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
733 | struct mlx4_cmd_mailbox *mailbox; | 732 | struct mlx4_cmd_mailbox *mailbox; |
734 | struct mlx4_mgm *mgm; | 733 | struct mlx4_mgm *mgm; |
735 | u32 members_count; | 734 | u32 members_count; |
736 | u16 hash; | ||
737 | int prev, index; | 735 | int prev, index; |
738 | int i, loc; | 736 | int i, loc; |
739 | int err; | 737 | int err; |
@@ -747,8 +745,8 @@ int mlx4_qp_detach_common(struct mlx4_dev *dev, struct mlx4_qp *qp, u8 gid[16], | |||
747 | 745 | ||
748 | mutex_lock(&priv->mcg_table.mutex); | 746 | mutex_lock(&priv->mcg_table.mutex); |
749 | 747 | ||
750 | err = find_entry(dev, port, gid, prot, steer, | 748 | err = find_entry(dev, port, gid, prot, |
751 | mailbox, &hash, &prev, &index); | 749 | mailbox, &prev, &index); |
752 | if (err) | 750 | if (err) |
753 | goto out; | 751 | goto out; |
754 | 752 | ||