staging: qlge: Remove gotos from ql_set_mac_addr_reg
As suggested by Joe Perches, this patch removes the 'exit' label from the ql_set_mac_addr_reg function and replaces the goto statements with break statements. Signed-off-by: Rylan Dmello <mail@rylan.coffee> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/a6f485e43eb55e8fdc64a7a346cb0419b55c3cb6.1588209862.git.mail@rylan.coffee Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Родитель
7d9a39e01d
Коммит
7c40ba652c
|
@ -336,22 +336,20 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
|
|||
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
ql_write32(qdev, MAC_ADDR_IDX,
|
||||
(offset++) | (index << MAC_ADDR_IDX_SHIFT) | type |
|
||||
MAC_ADDR_E);
|
||||
ql_write32(qdev, MAC_ADDR_DATA, lower);
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
ql_write32(qdev, MAC_ADDR_IDX,
|
||||
(offset++) | (index << MAC_ADDR_IDX_SHIFT) | type |
|
||||
MAC_ADDR_E);
|
||||
|
||||
ql_write32(qdev, MAC_ADDR_DATA, upper);
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
}
|
||||
case MAC_ADDR_TYPE_CAM_MAC: {
|
||||
|
@ -361,7 +359,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
|
|||
(addr[5]);
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
ql_write32(qdev, MAC_ADDR_IDX,
|
||||
(offset++) | /* offset */
|
||||
(index << MAC_ADDR_IDX_SHIFT) | /* index */
|
||||
|
@ -369,7 +367,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
|
|||
ql_write32(qdev, MAC_ADDR_DATA, lower);
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
ql_write32(qdev, MAC_ADDR_IDX,
|
||||
(offset++) | /* offset */
|
||||
(index << MAC_ADDR_IDX_SHIFT) | /* index */
|
||||
|
@ -377,7 +375,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
|
|||
ql_write32(qdev, MAC_ADDR_DATA, upper);
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
ql_write32(qdev, MAC_ADDR_IDX,
|
||||
(offset) | /* offset */
|
||||
(index << MAC_ADDR_IDX_SHIFT) | /* index */
|
||||
|
@ -404,7 +402,7 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
|
|||
*/
|
||||
status = ql_wait_reg_rdy(qdev, MAC_ADDR_IDX, MAC_ADDR_MW, 0);
|
||||
if (status)
|
||||
goto exit;
|
||||
break;
|
||||
ql_write32(qdev, MAC_ADDR_IDX,
|
||||
offset | /* offset */
|
||||
(index << MAC_ADDR_IDX_SHIFT) | /* index */
|
||||
|
@ -418,7 +416,6 @@ static int ql_set_mac_addr_reg(struct ql_adapter *qdev, u8 *addr, u32 type,
|
|||
"Address type %d not yet supported.\n", type);
|
||||
status = -EPERM;
|
||||
}
|
||||
exit:
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче