Commit 4dec8004 authored by zhouchuangao's avatar zhouchuangao Committed by Martin K. Petersen

scsi: message: fusion: Use BUG_ON instead of if condition followed by BUG

BUG_ON() uses unlikely in if() which can be optimized at compile time.

Link: https://lore.kernel.org/r/1617108361-6870-1-git-send-email-zhouchuangao@vivo.comSigned-off-by: default avatarzhouchuangao <zhouchuangao@vivo.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 3c860469
...@@ -3442,14 +3442,12 @@ mptsas_expander_event_add(MPT_ADAPTER *ioc, ...@@ -3442,14 +3442,12 @@ mptsas_expander_event_add(MPT_ADAPTER *ioc,
__le64 sas_address; __le64 sas_address;
port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL); port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
if (!port_info) BUG_ON(!port_info);
BUG();
port_info->num_phys = (expander_data->NumPhys) ? port_info->num_phys = (expander_data->NumPhys) ?
expander_data->NumPhys : 1; expander_data->NumPhys : 1;
port_info->phy_info = kcalloc(port_info->num_phys, port_info->phy_info = kcalloc(port_info->num_phys,
sizeof(struct mptsas_phyinfo), GFP_KERNEL); sizeof(struct mptsas_phyinfo), GFP_KERNEL);
if (!port_info->phy_info) BUG_ON(!port_info->phy_info);
BUG();
memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64)); memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64));
for (i = 0; i < port_info->num_phys; i++) { for (i = 0; i < port_info->num_phys; i++) {
port_info->phy_info[i].portinfo = port_info; port_info->phy_info[i].portinfo = port_info;
......
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