bnx2x: Remove format_fw_ver_t function casts
authorKees Cook <keescook@chromium.org>
Fri, 15 Nov 2019 05:07:14 +0000 (21:07 -0800)
committerDavid S. Miller <davem@davemloft.net>
Sat, 16 Nov 2019 20:50:57 +0000 (12:50 -0800)
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>
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h

index 2bc6408ce00da7aaf8a5e774abfa47a6964d15ba..7dd35aa759259e934b1febd6dacc9b72783cdbbe 100644 (file)
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
index d31d15c78a17593f607f6332f46f4b8b62035662..cae03c89dc73a08cc25736b3df6f01ea1c3bc844 100644 (file)
@@ -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);