bnx2x: Semantic removal and beautification
This patch introduces several small changes to the driver, none which actually change any flow: 1. Removes prototypes of unexisting functions and unused defines. 2. Fixes alignment and spacing issues. 3. Changes numeric usage into constants. 4. Remove unnecessary parenthesis. Signed-off-by: Yuval Mintz <yuvalmin@broadcom.com> Signed-off-by: Ariel Elior <ariele@broadcom.com> Signed-off-by: Eilon Greenstein <eilong@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
16a5fd9265
commit
3cdeec22e4
@@ -493,9 +493,6 @@ void bnx2x_update_max_mf_config(struct bnx2x *bp, u32 value);
|
|||||||
/* Error handling */
|
/* Error handling */
|
||||||
void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl);
|
void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl);
|
||||||
|
|
||||||
/* validate currect fw is loaded */
|
|
||||||
bool bnx2x_test_firmware_version(struct bnx2x *bp, bool is_err);
|
|
||||||
|
|
||||||
/* dev_close main block */
|
/* dev_close main block */
|
||||||
int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link);
|
int bnx2x_nic_unload(struct bnx2x *bp, int unload_mode, bool keep_link);
|
||||||
|
|
||||||
|
|||||||
@@ -102,8 +102,6 @@ static int disable_tpa;
|
|||||||
module_param(disable_tpa, int, 0);
|
module_param(disable_tpa, int, 0);
|
||||||
MODULE_PARM_DESC(disable_tpa, " Disable the TPA (LRO) feature");
|
MODULE_PARM_DESC(disable_tpa, " Disable the TPA (LRO) feature");
|
||||||
|
|
||||||
#define INT_MODE_INTx 1
|
|
||||||
#define INT_MODE_MSI 2
|
|
||||||
int int_mode;
|
int int_mode;
|
||||||
module_param(int_mode, int, 0);
|
module_param(int_mode, int, 0);
|
||||||
MODULE_PARM_DESC(int_mode, " Force interrupt mode other than MSI-X "
|
MODULE_PARM_DESC(int_mode, " Force interrupt mode other than MSI-X "
|
||||||
@@ -3619,15 +3617,14 @@ static int bnx2x_acquire_alr(struct bnx2x *bp)
|
|||||||
|
|
||||||
might_sleep();
|
might_sleep();
|
||||||
for (j = 0; j < 1000; j++) {
|
for (j = 0; j < 1000; j++) {
|
||||||
val = (1UL << 31);
|
REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, MCPR_ACCESS_LOCK_LOCK);
|
||||||
REG_WR(bp, GRCBASE_MCP + 0x9c, val);
|
val = REG_RD(bp, MCP_REG_MCPR_ACCESS_LOCK);
|
||||||
val = REG_RD(bp, GRCBASE_MCP + 0x9c);
|
if (val & MCPR_ACCESS_LOCK_LOCK)
|
||||||
if (val & (1L << 31))
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
msleep(5);
|
msleep(5);
|
||||||
}
|
}
|
||||||
if (!(val & (1L << 31))) {
|
if (!(val & MCPR_ACCESS_LOCK_LOCK)) {
|
||||||
BNX2X_ERR("Cannot acquire MCP access lock register\n");
|
BNX2X_ERR("Cannot acquire MCP access lock register\n");
|
||||||
rc = -EBUSY;
|
rc = -EBUSY;
|
||||||
}
|
}
|
||||||
@@ -3638,7 +3635,7 @@ static int bnx2x_acquire_alr(struct bnx2x *bp)
|
|||||||
/* release split MCP access lock register */
|
/* release split MCP access lock register */
|
||||||
static void bnx2x_release_alr(struct bnx2x *bp)
|
static void bnx2x_release_alr(struct bnx2x *bp)
|
||||||
{
|
{
|
||||||
REG_WR(bp, GRCBASE_MCP + 0x9c, 0);
|
REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define BNX2X_DEF_SB_ATT_IDX 0x0001
|
#define BNX2X_DEF_SB_ATT_IDX 0x0001
|
||||||
@@ -6013,11 +6010,6 @@ void bnx2x_pre_irq_nic_init(struct bnx2x *bp)
|
|||||||
bnx2x_init_rx_rings(bp);
|
bnx2x_init_rx_rings(bp);
|
||||||
bnx2x_init_tx_rings(bp);
|
bnx2x_init_tx_rings(bp);
|
||||||
|
|
||||||
if (IS_VF(bp)) {
|
|
||||||
bnx2x_memset_stats(bp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (IS_PF(bp)) {
|
if (IS_PF(bp)) {
|
||||||
/* Initialize MOD_ABS interrupts */
|
/* Initialize MOD_ABS interrupts */
|
||||||
bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
|
bnx2x_init_mod_abs_int(bp, &bp->link_vars, bp->common.chip_id,
|
||||||
@@ -6028,6 +6020,8 @@ void bnx2x_pre_irq_nic_init(struct bnx2x *bp)
|
|||||||
bnx2x_init_def_sb(bp);
|
bnx2x_init_def_sb(bp);
|
||||||
bnx2x_update_dsb_idx(bp);
|
bnx2x_update_dsb_idx(bp);
|
||||||
bnx2x_init_sp_ring(bp);
|
bnx2x_init_sp_ring(bp);
|
||||||
|
} else {
|
||||||
|
bnx2x_memset_stats(bp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -10011,7 +10005,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
|
|||||||
(MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
|
(MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
|
||||||
(MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);
|
(MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);
|
||||||
|
|
||||||
hw_lock_val = (REG_RD(bp, hw_lock_reg));
|
hw_lock_val = REG_RD(bp, hw_lock_reg);
|
||||||
if (hw_lock_val) {
|
if (hw_lock_val) {
|
||||||
if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) {
|
if (hw_lock_val & HW_LOCK_RESOURCE_NVRAM) {
|
||||||
BNX2X_DEV_INFO("Release Previously held NVRAM lock\n");
|
BNX2X_DEV_INFO("Release Previously held NVRAM lock\n");
|
||||||
@@ -10026,7 +10020,7 @@ static int bnx2x_prev_unload(struct bnx2x *bp)
|
|||||||
|
|
||||||
if (MCPR_ACCESS_LOCK_LOCK & REG_RD(bp, MCP_REG_MCPR_ACCESS_LOCK)) {
|
if (MCPR_ACCESS_LOCK_LOCK & REG_RD(bp, MCP_REG_MCPR_ACCESS_LOCK)) {
|
||||||
BNX2X_DEV_INFO("Release previously held alr\n");
|
BNX2X_DEV_INFO("Release previously held alr\n");
|
||||||
REG_WR(bp, MCP_REG_MCPR_ACCESS_LOCK, 0);
|
bnx2x_release_alr(bp);
|
||||||
}
|
}
|
||||||
|
|
||||||
do {
|
do {
|
||||||
|
|||||||
Reference in New Issue
Block a user