Skip to content

Commit

Permalink
bnx2x: Remove format_fw_ver_t function casts
Browse files Browse the repository at this point in the history
The return values for format_fw_ver_t callbacks are supposed to be
"int", not "u8". Ultimately, the top-level caller doesn't actually check
the return value at all, but just clean this all up anyway and fix the
prototypes so that casts are no longer needed.

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 3e19d1f commit 26658f6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
Original file line number Diff line number Diff line change
Expand Up @@ -11767,7 +11767,7 @@ static const struct bnx2x_phy phy_7101 = {
.read_status = bnx2x_7101_read_status,
.link_reset = bnx2x_common_ext_link_reset,
.config_loopback = bnx2x_7101_config_loopback,
.format_fw_ver = (format_fw_ver_t)bnx2x_7101_format_ver,
.format_fw_ver = bnx2x_7101_format_ver,
.hw_reset = (hw_reset_t)bnx2x_7101_hw_reset,
.set_link_led = bnx2x_7101_set_link_led,
.phy_specific_func = NULL
Expand Down Expand Up @@ -11798,7 +11798,7 @@ static const struct bnx2x_phy phy_8073 = {
.read_status = bnx2x_8073_read_status,
.link_reset = bnx2x_8073_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.format_fw_ver = bnx2x_format_ver,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = bnx2x_8073_specific_func
Expand Down Expand Up @@ -11826,7 +11826,7 @@ static const struct bnx2x_phy phy_8705 = {
.read_status = bnx2x_8705_read_status,
.link_reset = bnx2x_common_ext_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_null_format_ver,
.format_fw_ver = bnx2x_null_format_ver,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
Expand Down Expand Up @@ -11855,7 +11855,7 @@ static const struct bnx2x_phy phy_8706 = {
.read_status = bnx2x_8706_read_status,
.link_reset = bnx2x_common_ext_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.format_fw_ver = bnx2x_format_ver,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
Expand Down Expand Up @@ -11887,7 +11887,7 @@ static const struct bnx2x_phy phy_8726 = {
.read_status = bnx2x_8726_read_status,
.link_reset = bnx2x_8726_link_reset,
.config_loopback = bnx2x_8726_config_loopback,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.format_fw_ver = bnx2x_format_ver,
.hw_reset = NULL,
.set_link_led = NULL,
.phy_specific_func = NULL
Expand Down Expand Up @@ -11918,7 +11918,7 @@ static const struct bnx2x_phy phy_8727 = {
.read_status = bnx2x_8727_read_status,
.link_reset = bnx2x_8727_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_format_ver,
.format_fw_ver = bnx2x_format_ver,
.hw_reset = (hw_reset_t)bnx2x_8727_hw_reset,
.set_link_led = bnx2x_8727_set_link_led,
.phy_specific_func = bnx2x_8727_specific_func
Expand Down Expand Up @@ -11953,7 +11953,7 @@ static const struct bnx2x_phy phy_8481 = {
.read_status = bnx2x_848xx_read_status,
.link_reset = bnx2x_8481_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_8481_hw_reset,
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = NULL
Expand Down Expand Up @@ -11990,7 +11990,7 @@ static const struct bnx2x_phy phy_84823 = {
.read_status = bnx2x_848xx_read_status,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = NULL,
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
Expand Down Expand Up @@ -12025,7 +12025,7 @@ static const struct bnx2x_phy phy_84833 = {
.read_status = bnx2x_848xx_read_status,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
Expand Down Expand Up @@ -12059,7 +12059,7 @@ static const struct bnx2x_phy phy_84834 = {
.read_status = bnx2x_848xx_read_status,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_848xx_format_ver,
.format_fw_ver = bnx2x_848xx_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
Expand Down Expand Up @@ -12093,7 +12093,7 @@ static const struct bnx2x_phy phy_84858 = {
.read_status = bnx2x_848xx_read_status,
.link_reset = bnx2x_848x3_link_reset,
.config_loopback = NULL,
.format_fw_ver = (format_fw_ver_t)bnx2x_8485x_format_ver,
.format_fw_ver = bnx2x_8485x_format_ver,
.hw_reset = (hw_reset_t)bnx2x_84833_hw_reset_phy,
.set_link_led = bnx2x_848xx_set_link_led,
.phy_specific_func = bnx2x_848xx_specific_func
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ typedef void (*link_reset_t)(struct bnx2x_phy *phy,
struct link_params *params);
typedef void (*config_loopback_t)(struct bnx2x_phy *phy,
struct link_params *params);
typedef u8 (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len);
typedef int (*format_fw_ver_t)(u32 raw, u8 *str, u16 *len);
typedef void (*hw_reset_t)(struct bnx2x_phy *phy, struct link_params *params);
typedef void (*set_link_led_t)(struct bnx2x_phy *phy,
struct link_params *params, u8 mode);
Expand Down

0 comments on commit 26658f6

Please sign in to comment.