diff options
author | Andy Shevchenko <andy.shevchenko@gmail.com> | 2017-04-27 16:37:00 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-04-30 22:28:00 -0400 |
commit | b77f016726bded1fe3abb10272343d39df6b50f1 (patch) | |
tree | d17f9a8735d0ce9b2b0216efa40275fb0ed0cf90 | |
parent | 55b218c12c1d03c6f415f6d3ce929741b15b2dd3 (diff) |
bnx2x: Reuse bnx2x_null_format_ver()
Reuse bnx2x_null_format_ver() in functions where it's appropriated
instead of open coded variant.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c index 2acc4f081818..6d11a958200f 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c @@ -6161,14 +6161,20 @@ static void bnx2x_link_int_ack(struct link_params *params, } } +static int bnx2x_null_format_ver(u32 spirom_ver, u8 *str, u16 *len) +{ + str[0] = '\0'; + (*len)--; + return 0; +} + static int bnx2x_format_ver(u32 num, u8 *str, u16 *len) { u16 ret; if (*len < 10) { /* Need more than 10chars for this format */ - *str = '\0'; - (*len)--; + bnx2x_null_format_ver(num, str, len); return -EINVAL; } @@ -6183,8 +6189,7 @@ static int bnx2x_3_seq_format_ver(u32 num, u8 *str, u16 *len) if (*len < 10) { /* Need more than 10chars for this format */ - *str = '\0'; - (*len)--; + bnx2x_null_format_ver(num, str, len); return -EINVAL; } @@ -6193,13 +6198,6 @@ static int bnx2x_3_seq_format_ver(u32 num, u8 *str, u16 *len) return 0; } -static int bnx2x_null_format_ver(u32 spirom_ver, u8 *str, u16 *len) -{ - str[0] = '\0'; - (*len)--; - return 0; -} - int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 *version, u16 len) { |