]> Pileus Git - ~andy/linux/commitdiff
net/mlx4: Address build warnings on set but not used variables
authorOr Gerlitz <ogerlitz@mellanox.com>
Tue, 15 May 2012 10:34:57 +0000 (10:34 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 16 May 2012 04:56:58 +0000 (00:56 -0400)
Handle the compiler warnings on variables which are set but not used
by removing the relevant variable or casting a return value which is
ignored on purpose to void.

Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlx4/cmd.c
drivers/net/ethernet/mellanox/mlx4/mcg.c
drivers/net/ethernet/mellanox/mlx4/mr.c
drivers/net/ethernet/mellanox/mlx4/port.c
drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

index 773c70ea3f62ba005ad835a82e20699e88ecbb11..53b738b8a0041097ce732514470acf93476e920a 100644 (file)
@@ -1254,7 +1254,6 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd,
        struct mlx4_priv *priv = mlx4_priv(dev);
        struct mlx4_slave_state *slave_state = priv->mfunc.master.slave_state;
        u32 reply;
-       u32 slave_status = 0;
        u8 is_going_down = 0;
        int i;
 
@@ -1274,10 +1273,8 @@ static void mlx4_master_do_cmd(struct mlx4_dev *dev, int slave, u8 cmd,
                }
                /*check if we are in the middle of FLR process,
                if so return "retry" status to the slave*/
-               if (MLX4_COMM_CMD_FLR == slave_state[slave].last_cmd) {
-                       slave_status = MLX4_DELAY_RESET_SLAVE;
+               if (MLX4_COMM_CMD_FLR == slave_state[slave].last_cmd)
                        goto inform_slave_state;
-               }
 
                /* write the version in the event field */
                reply |= mlx4_comm_get_version();
index 4799e824052f2a3e88a32ce4812c87ef5e6eed3b..f4a8f98e402a0027182608455cc5ce7a62f7db2f 100644 (file)
@@ -357,7 +357,6 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
        u32 prot;
        int i;
        bool found;
-       int last_index;
        int err;
        struct mlx4_priv *priv = mlx4_priv(dev);
 
@@ -419,7 +418,6 @@ static int add_promisc_qp(struct mlx4_dev *dev, u8 port,
                        if (err)
                                goto out_mailbox;
                }
-               last_index = entry->index;
        }
 
        /* add the new qpn to list of promisc qps */
index fe2ac8449c1953d35b491c4d5b9e009620b58d82..cefa76f509c1de372b1989bce407ed8bc9020cb0 100644 (file)
@@ -788,7 +788,6 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
                   int max_maps, u8 page_shift, struct mlx4_fmr *fmr)
 {
        struct mlx4_priv *priv = mlx4_priv(dev);
-       u64 mtt_offset;
        int err = -ENOMEM;
 
        if (max_maps > dev->caps.max_fmr_maps)
@@ -811,8 +810,6 @@ int mlx4_fmr_alloc(struct mlx4_dev *dev, u32 pd, u32 access, int max_pages,
        if (err)
                return err;
 
-       mtt_offset = fmr->mr.mtt.offset * dev->caps.mtt_entry_sz;
-
        fmr->mtts = mlx4_table_find(&priv->mr_table.mtt_table,
                                    fmr->mr.mtt.offset,
                                    &fmr->dma_handle);
index 55b12e6bed876df8187b80fc210da9ad5879a13a..1fe2c7a8b40c44883fe3eb4d8def444686e64c06 100644 (file)
@@ -338,13 +338,12 @@ EXPORT_SYMBOL_GPL(__mlx4_unregister_mac);
 void mlx4_unregister_mac(struct mlx4_dev *dev, u8 port, u64 mac)
 {
        u64 out_param;
-       int err;
 
        if (mlx4_is_mfunc(dev)) {
                set_param_l(&out_param, port);
-               err = mlx4_cmd_imm(dev, mac, &out_param, RES_MAC,
-                                  RES_OP_RESERVE_AND_MAP, MLX4_CMD_FREE_RES,
-                                  MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
+               (void) mlx4_cmd_imm(dev, mac, &out_param, RES_MAC,
+                                   RES_OP_RESERVE_AND_MAP, MLX4_CMD_FREE_RES,
+                                   MLX4_CMD_TIME_CLASS_A, MLX4_CMD_WRAPPED);
                return;
        }
        __mlx4_unregister_mac(dev, port, mac);
index 8752e6e0816922f5ecd4b441fc478b02a27fd5d2..4b045b8cfddea614ca90e0198e172b7bd5c4b9b8 100644 (file)
@@ -2536,7 +2536,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
        struct mlx4_qp qp; /* dummy for calling attach/detach */
        u8 *gid = inbox->buf;
        enum mlx4_protocol prot = (vhcr->in_modifier >> 28) & 0x7;
-       int err, err1;
+       int err;
        int qpn;
        struct res_qp *rqp;
        int attach = vhcr->op_modifier;
@@ -2571,7 +2571,7 @@ int mlx4_QP_ATTACH_wrapper(struct mlx4_dev *dev, int slave,
 
 ex_rem:
        /* ignore error return below, already in error */
-       err1 = rem_mcg_res(dev, slave, rqp, gid, prot, type);
+       (void) rem_mcg_res(dev, slave, rqp, gid, prot, type);
 ex_put:
        put_res(dev, slave, qpn, RES_QP);
 
@@ -2604,13 +2604,12 @@ static void detach_qp(struct mlx4_dev *dev, int slave, struct res_qp *rqp)
 {
        struct res_gid *rgid;
        struct res_gid *tmp;
-       int err;
        struct mlx4_qp qp; /* dummy for calling attach/detach */
 
        list_for_each_entry_safe(rgid, tmp, &rqp->mcg_list, list) {
                qp.qpn = rqp->local_qpn;
-               err = mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
-                                           rgid->steer);
+               (void) mlx4_qp_detach_common(dev, &qp, rgid->gid, rgid->prot,
+                                            rgid->steer);
                list_del(&rgid->list);
                kfree(rgid);
        }