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>
This commit is contained in:
committed by
David S. Miller
parent
55b218c12c
commit
b77f016726
@@ -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)
|
static int bnx2x_format_ver(u32 num, u8 *str, u16 *len)
|
||||||
{
|
{
|
||||||
u16 ret;
|
u16 ret;
|
||||||
|
|
||||||
if (*len < 10) {
|
if (*len < 10) {
|
||||||
/* Need more than 10chars for this format */
|
/* Need more than 10chars for this format */
|
||||||
*str = '\0';
|
bnx2x_null_format_ver(num, str, len);
|
||||||
(*len)--;
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6183,8 +6189,7 @@ static int bnx2x_3_seq_format_ver(u32 num, u8 *str, u16 *len)
|
|||||||
|
|
||||||
if (*len < 10) {
|
if (*len < 10) {
|
||||||
/* Need more than 10chars for this format */
|
/* Need more than 10chars for this format */
|
||||||
*str = '\0';
|
bnx2x_null_format_ver(num, str, len);
|
||||||
(*len)--;
|
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6193,13 +6198,6 @@ static int bnx2x_3_seq_format_ver(u32 num, u8 *str, u16 *len)
|
|||||||
return 0;
|
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,
|
int bnx2x_get_ext_phy_fw_version(struct link_params *params, u8 *version,
|
||||||
u16 len)
|
u16 len)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user