Commit b883582d authored by Jules Irenge's avatar Jules Irenge Committed by Greg Kroah-Hartman

staging: qlge: Fix multiple assignments warning by replacing integer variables to bool

Fix multiple assignments warning " check
 issue detected by checkpatch tool:
"CHECK: multiple assignments should be avoided".
Signed-off-by: default avatarJules Irenge <jbi.octave@gmail.com>
Link: https://lore.kernel.org/r/20191010214006.23677-2-jbi.octave@gmail.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a8bfbd7c
...@@ -112,7 +112,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data) ...@@ -112,7 +112,7 @@ static int ql_read_serdes_reg(struct ql_adapter *qdev, u32 reg, u32 *data)
static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr, static void ql_get_both_serdes(struct ql_adapter *qdev, u32 addr,
u32 *direct_ptr, u32 *indirect_ptr, u32 *direct_ptr, u32 *indirect_ptr,
unsigned int direct_valid, unsigned int indirect_valid) bool direct_valid, bool indirect_valid)
{ {
unsigned int status; unsigned int status;
...@@ -136,13 +136,12 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, ...@@ -136,13 +136,12 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
struct ql_mpi_coredump *mpi_coredump) struct ql_mpi_coredump *mpi_coredump)
{ {
int status; int status;
unsigned int xfi_direct_valid, xfi_indirect_valid, xaui_direct_valid; bool xfi_direct_valid = false, xfi_indirect_valid = false;
unsigned int xaui_indirect_valid, i; bool xaui_direct_valid = true, xaui_indirect_valid = true;
unsigned int i;
u32 *direct_ptr, temp; u32 *direct_ptr, temp;
u32 *indirect_ptr; u32 *indirect_ptr;
xfi_direct_valid = xfi_indirect_valid = 0;
xaui_direct_valid = xaui_indirect_valid = 1;
/* The XAUI needs to be read out per port */ /* The XAUI needs to be read out per port */
status = ql_read_other_func_serdes_reg(qdev, status = ql_read_other_func_serdes_reg(qdev,
...@@ -152,7 +151,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, ...@@ -152,7 +151,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
XG_SERDES_ADDR_XAUI_PWR_DOWN) XG_SERDES_ADDR_XAUI_PWR_DOWN)
xaui_indirect_valid = 0; xaui_indirect_valid = false;
status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp); status = ql_read_serdes_reg(qdev, XG_SERDES_XAUI_HSS_PCS_START, &temp);
...@@ -161,7 +160,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, ...@@ -161,7 +160,7 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) == if ((temp & XG_SERDES_ADDR_XAUI_PWR_DOWN) ==
XG_SERDES_ADDR_XAUI_PWR_DOWN) XG_SERDES_ADDR_XAUI_PWR_DOWN)
xaui_direct_valid = 0; xaui_direct_valid = false;
/* /*
* XFI register is shared so only need to read one * XFI register is shared so only need to read one
...@@ -176,18 +175,18 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev, ...@@ -176,18 +175,18 @@ static int ql_get_serdes_regs(struct ql_adapter *qdev,
/* now see if i'm NIC 1 or NIC 2 */ /* now see if i'm NIC 1 or NIC 2 */
if (qdev->func & 1) if (qdev->func & 1)
/* I'm NIC 2, so the indirect (NIC1) xfi is up. */ /* I'm NIC 2, so the indirect (NIC1) xfi is up. */
xfi_indirect_valid = 1; xfi_indirect_valid = true;
else else
xfi_direct_valid = 1; xfi_direct_valid = true;
} }
if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) == if ((temp & XG_SERDES_ADDR_XFI2_PWR_UP) ==
XG_SERDES_ADDR_XFI2_PWR_UP) { XG_SERDES_ADDR_XFI2_PWR_UP) {
/* now see if i'm NIC 1 or NIC 2 */ /* now see if i'm NIC 1 or NIC 2 */
if (qdev->func & 1) if (qdev->func & 1)
/* I'm NIC 2, so the indirect (NIC1) xfi is up. */ /* I'm NIC 2, so the indirect (NIC1) xfi is up. */
xfi_direct_valid = 1; xfi_direct_valid = true;
else else
xfi_indirect_valid = 1; xfi_indirect_valid = true;
} }
/* Get XAUI_AN register block. */ /* Get XAUI_AN register block. */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment