Skip to content

Commit

Permalink
bnx2x: Drop redundant callback function casts
Browse files Browse the repository at this point in the history
NULL is already "void *" so it will auto-cast in assignments and
initializers. Additionally, all the callbacks for .link_reset,
.config_loopback, .set_link_led, and .phy_specific_func are already
correct. No casting is needed for these, so remove them.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Kees Cook authored and David S. Miller committed Nov 16, 2019
1 parent 2e47cb4 commit 86c1fe8
Showing 1 changed file with 80 additions and 80 deletions.
160 changes: 80 additions & 80 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -11636,14 +11636,14 @@ static const struct bnx2x_phy phy_null = {
.speed_cap_mask = 0,
.req_duplex = 0,
.rsrv = 0,
.config_init = (config_init_t)NULL,
.read_status = (read_status_t)NULL,
.link_reset = (link_reset_t)NULL,
.config_loopback = (config_loopback_t)NULL,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
.config_init = NULL,
.read_status = NULL,
.link_reset = NULL,
.config_loopback = NULL,
.format_fw_ver = NULL,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
};

static const struct bnx2x_phy phy_serdes = {
Expand Down Expand Up @@ -11673,12 +11673,12 @@ static const struct bnx2x_phy phy_serdes = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_xgxs_config_init,
.read_status = (read_status_t)bnx2x_link_settings_status,
.link_reset = (link_reset_t)bnx2x_int_link_reset,
.config_loopback = (config_loopback_t)NULL,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
.link_reset = bnx2x_int_link_reset,
.config_loopback = NULL,
.format_fw_ver = NULL,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
};

static const struct bnx2x_phy phy_xgxs = {
Expand Down Expand Up @@ -11709,12 +11709,12 @@ static const struct bnx2x_phy phy_xgxs = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_xgxs_config_init,
.read_status = (read_status_t)bnx2x_link_settings_status,
.link_reset = (link_reset_t)bnx2x_int_link_reset,
.config_loopback = (config_loopback_t)bnx2x_set_xgxs_loopback,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)bnx2x_xgxs_specific_func
.link_reset = bnx2x_int_link_reset,
.config_loopback = bnx2x_set_xgxs_loopback,
.format_fw_ver = NULL,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = bnx2x_xgxs_specific_func
};
static const struct bnx2x_phy phy_warpcore = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_DIRECT,
Expand Down Expand Up @@ -11747,12 +11747,12 @@ static const struct bnx2x_phy phy_warpcore = {
/* rsrv = */0,
.config_init = (config_init_t)bnx2x_warpcore_config_init,
.read_status = (read_status_t)bnx2x_warpcore_read_status,
.link_reset = (link_reset_t)bnx2x_warpcore_link_reset,
.config_loopback = (config_loopback_t)bnx2x_set_warpcore_loopback,
.format_fw_ver = (format_fw_ver_t)NULL,
.link_reset = bnx2x_warpcore_link_reset,
.config_loopback = bnx2x_set_warpcore_loopback,
.format_fw_ver = NULL,
.hw_reset = (hw_reset_t)bnx2x_warpcore_hw_reset,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
.set_link_led = NULL,
.phy_specific_func = NULL
};


Expand All @@ -11778,12 +11778,12 @@ static const struct bnx2x_phy phy_7101 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_7101_config_init,
.read_status = (read_status_t)bnx2x_7101_read_status,
.link_reset = (link_reset_t)bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)bnx2x_7101_config_loopback,
.link_reset = bnx2x_common_ext_link_reset,
.config_loopback = bnx2x_7101_config_loopback,
.format_fw_ver = (format_fw_ver_t)bnx2x_7101_format_ver,
.hw_reset = (hw_reset_t)bnx2x_7101_hw_reset,
.set_link_led = (set_link_led_t)bnx2x_7101_set_link_led,
.phy_specific_func = (phy_specific_func_t)NULL
.set_link_led = bnx2x_7101_set_link_led,
.phy_specific_func = NULL
};
static const struct bnx2x_phy phy_8073 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8073,
Expand All @@ -11809,12 +11809,12 @@ static const struct bnx2x_phy phy_8073 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_8073_config_init,
.read_status = (read_status_t)bnx2x_8073_read_status,
.link_reset = (link_reset_t)bnx2x_8073_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_8073_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)bnx2x_8073_specific_func
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = bnx2x_8073_specific_func
};
static const struct bnx2x_phy phy_8705 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8705,
Expand All @@ -11837,12 +11837,12 @@ static const struct bnx2x_phy phy_8705 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_8705_config_init,
.read_status = (read_status_t)bnx2x_8705_read_status,
.link_reset = (link_reset_t)bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_common_ext_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_null_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
};
static const struct bnx2x_phy phy_8706 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8706,
Expand All @@ -11866,12 +11866,12 @@ static const struct bnx2x_phy phy_8706 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_8706_config_init,
.read_status = (read_status_t)bnx2x_8706_read_status,
.link_reset = (link_reset_t)bnx2x_common_ext_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_common_ext_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
};

static const struct bnx2x_phy phy_8726 = {
Expand All @@ -11898,12 +11898,12 @@ static const struct bnx2x_phy phy_8726 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_8726_config_init,
.read_status = (read_status_t)bnx2x_8726_read_status,
.link_reset = (link_reset_t)bnx2x_8726_link_reset,
.config_loopback = (config_loopback_t)bnx2x_8726_config_loopback,
.link_reset = bnx2x_8726_link_reset,
.config_loopback = bnx2x_8726_config_loopback,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)NULL,
.phy_specific_func = (phy_specific_func_t)NULL
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
};

static const struct bnx2x_phy phy_8727 = {
Expand All @@ -11929,12 +11929,12 @@ static const struct bnx2x_phy phy_8727 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_8727_config_init,
.read_status = (read_status_t)bnx2x_8727_read_status,
.link_reset = (link_reset_t)bnx2x_8727_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_8727_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.hw_reset = (hw_reset_t)bnx2x_8727_hw_reset,
.set_link_led = (set_link_led_t)bnx2x_8727_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_8727_specific_func
.set_link_led = bnx2x_8727_set_link_led,
.phy_specific_func = bnx2x_8727_specific_func
};
static const struct bnx2x_phy phy_8481 = {
.type = PORT_HW_CFG_XGXS_EXT_PHY_TYPE_BCM8481,
Expand Down Expand Up @@ -11964,12 +11964,12 @@ static const struct bnx2x_phy phy_8481 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_8481_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_8481_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_8481_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_8481_hw_reset,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)NULL
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = NULL
};

static const struct bnx2x_phy phy_84823 = {
Expand Down Expand Up @@ -12001,12 +12001,12 @@ static const struct bnx2x_phy phy_84823 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
.hw_reset = NULL,
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
};

static const struct bnx2x_phy phy_84833 = {
Expand Down Expand Up @@ -12036,12 +12036,12 @@ static const struct bnx2x_phy phy_84833 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
};

static const struct bnx2x_phy phy_84834 = {
Expand Down Expand Up @@ -12070,12 +12070,12 @@ static const struct bnx2x_phy phy_84834 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
};

static const struct bnx2x_phy phy_84858 = {
Expand Down Expand Up @@ -12104,12 +12104,12 @@ static const struct bnx2x_phy phy_84858 = {
.rsrv = 0,
.config_init = (config_init_t)bnx2x_848x3_config_init,
.read_status = (read_status_t)bnx2x_848xx_read_status,
.link_reset = (link_reset_t)bnx2x_848x3_link_reset,
.config_loopback = (config_loopback_t)NULL,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_8485x_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
.set_link_led = (set_link_led_t)bnx2x_848xx_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_848xx_specific_func
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
};

static const struct bnx2x_phy phy_54618se = {
Expand Down Expand Up @@ -12138,12 +12138,12 @@ static const struct bnx2x_phy phy_54618se = {
/* rsrv = */0,
.config_init = (config_init_t)bnx2x_54618se_config_init,
.read_status = (read_status_t)bnx2x_54618se_read_status,
.link_reset = (link_reset_t)bnx2x_54618se_link_reset,
.config_loopback = (config_loopback_t)bnx2x_54618se_config_loopback,
.format_fw_ver = (format_fw_ver_t)NULL,
.hw_reset = (hw_reset_t)NULL,
.set_link_led = (set_link_led_t)bnx2x_5461x_set_link_led,
.phy_specific_func = (phy_specific_func_t)bnx2x_54618se_specific_func
.link_reset = bnx2x_54618se_link_reset,
.config_loopback = bnx2x_54618se_config_loopback,
.format_fw_ver = NULL,
.hw_reset = NULL,
.set_link_led = bnx2x_5461x_set_link_led,
.phy_specific_func = bnx2x_54618se_specific_func
};
/*****************************************************************/
/* */
Expand Down

0 comments on commit 86c1fe8

Please sign in to comment.