aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
authorzhouchuangao <zhouchuangao@vivo.com>2021-03-30 05:46:01 -0700
committerMartin K. Petersen <martin.petersen@oracle.com>2021-04-05 23:34:36 -0400
commit4dec8004de296952b4afc66b47f50cbf4f8421a9 (patch)
treeb7a4a01d650377a068bf8fe6ce33a3ac56e222cd /drivers/message/fusion/mptsas.c
parentscsi: mpt3sas: Block PCI config access from userspace during reset (diff)
downloadlinux-dev-4dec8004de296952b4afc66b47f50cbf4f8421a9.tar.xz
linux-dev-4dec8004de296952b4afc66b47f50cbf4f8421a9.zip
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.com Signed-off-by: zhouchuangao <zhouchuangao@vivo.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 85aa5788826b..1857869e7e8d 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -3442,14 +3442,12 @@ mptsas_expander_event_add(MPT_ADAPTER *ioc,
__le64 sas_address;
port_info = kzalloc(sizeof(struct mptsas_portinfo), GFP_KERNEL);
- if (!port_info)
- BUG();
+ BUG_ON(!port_info);
port_info->num_phys = (expander_data->NumPhys) ?
expander_data->NumPhys : 1;
port_info->phy_info = kcalloc(port_info->num_phys,
sizeof(struct mptsas_phyinfo), GFP_KERNEL);
- if (!port_info->phy_info)
- BUG();
+ BUG_ON(!port_info->phy_info);
memcpy(&sas_address, &expander_data->SASAddress, sizeof(__le64));
for (i = 0; i < port_info->num_phys; i++) {
port_info->phy_info[i].portinfo = port_info;