@@ -1092,14 +1092,14 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr,
1092
1092
break ;
1093
1093
}
1094
1094
if (phba -> fc_topology == LPFC_TOPOLOGY_LOOP ) {
1095
- if (vport -> fc_flag & FC_PUBLIC_LOOP )
1095
+ if (test_bit ( FC_PUBLIC_LOOP , & vport -> fc_flag ) )
1096
1096
len += scnprintf (buf + len , PAGE_SIZE - len ,
1097
1097
" Public Loop\n" );
1098
1098
else
1099
1099
len += scnprintf (buf + len , PAGE_SIZE - len ,
1100
1100
" Private Loop\n" );
1101
1101
} else {
1102
- if (vport -> fc_flag & FC_FABRIC ) {
1102
+ if (test_bit ( FC_FABRIC , & vport -> fc_flag ) ) {
1103
1103
if (phba -> sli_rev == LPFC_SLI_REV4 &&
1104
1104
vport -> port_type == LPFC_PHYSICAL_PORT &&
1105
1105
phba -> sli4_hba .fawwpn_flag &
@@ -1291,7 +1291,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
1291
1291
* If the link is offline, disabled or BLOCK_MGMT_IO
1292
1292
* it doesn't make any sense to allow issue_lip
1293
1293
*/
1294
- if (( vport -> fc_flag & FC_OFFLINE_MODE ) ||
1294
+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ||
1295
1295
(phba -> hba_flag & LINK_DISABLED ) ||
1296
1296
(phba -> sli .sli_flag & LPFC_BLOCK_MGMT_IO ))
1297
1297
return - EPERM ;
@@ -1305,8 +1305,8 @@ lpfc_issue_lip(struct Scsi_Host *shost)
1305
1305
pmboxq -> u .mb .mbxCommand = MBX_DOWN_LINK ;
1306
1306
pmboxq -> u .mb .mbxOwner = OWN_HOST ;
1307
1307
1308
- if (( vport -> fc_flag & FC_PT2PT ) && ( vport -> fc_flag & FC_PT2PT_NO_NVME ))
1309
- vport -> fc_flag &= ~ FC_PT2PT_NO_NVME ;
1308
+ if (test_bit ( FC_PT2PT , & vport -> fc_flag ))
1309
+ clear_bit ( FC_PT2PT_NO_NVME , & vport -> fc_flag ) ;
1310
1310
1311
1311
mbxstatus = lpfc_sli_issue_mbox_wait (phba , pmboxq , LPFC_MBOX_TMO * 2 );
1312
1312
@@ -1496,7 +1496,8 @@ lpfc_reset_pci_bus(struct lpfc_hba *phba)
1496
1496
if (shost ) {
1497
1497
phba_other =
1498
1498
((struct lpfc_vport * )shost -> hostdata )-> phba ;
1499
- if (!(phba_other -> pport -> fc_flag & FC_OFFLINE_MODE )) {
1499
+ if (!test_bit (FC_OFFLINE_MODE ,
1500
+ & phba_other -> pport -> fc_flag )) {
1500
1501
lpfc_printf_log (phba_other , KERN_INFO , LOG_INIT ,
1501
1502
"8349 WWPN = 0x%02x%02x%02x%02x"
1502
1503
"%02x%02x%02x%02x is not "
@@ -1551,7 +1552,7 @@ lpfc_selective_reset(struct lpfc_hba *phba)
1551
1552
if (!phba -> cfg_enable_hba_reset )
1552
1553
return - EACCES ;
1553
1554
1554
- if (!( phba -> pport -> fc_flag & FC_OFFLINE_MODE )) {
1555
+ if (!test_bit ( FC_OFFLINE_MODE , & phba -> pport -> fc_flag )) {
1555
1556
status = lpfc_do_offline (phba , LPFC_EVT_OFFLINE );
1556
1557
1557
1558
if (status != 0 )
@@ -1690,7 +1691,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
1690
1691
{
1691
1692
struct completion online_compl ;
1692
1693
struct pci_dev * pdev = phba -> pcidev ;
1693
- uint32_t before_fc_flag ;
1694
+ unsigned long before_fc_flag ;
1694
1695
uint32_t sriov_nr_virtfn ;
1695
1696
uint32_t reg_val ;
1696
1697
int status = 0 , rc = 0 ;
@@ -1761,7 +1762,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
1761
1762
}
1762
1763
1763
1764
/* keep the original port state */
1764
- if (before_fc_flag & FC_OFFLINE_MODE ) {
1765
+ if (test_bit ( FC_OFFLINE_MODE , & before_fc_flag ) ) {
1765
1766
if (phba -> fw_dump_cmpl )
1766
1767
phba -> fw_dump_cmpl = NULL ;
1767
1768
goto out ;
@@ -2099,7 +2100,7 @@ lpfc_board_mode_store(struct device *dev, struct device_attribute *attr,
2099
2100
* board_mode_str = '\0' ;
2100
2101
lpfc_printf_vlog (vport , KERN_ERR , LOG_INIT ,
2101
2102
"3097 Failed \"%s\", status(%d), "
2102
- "fc_flag(x%x )\n" ,
2103
+ "fc_flag(x%lx )\n" ,
2103
2104
buf , status , phba -> pport -> fc_flag );
2104
2105
return status ;
2105
2106
}
@@ -2158,7 +2159,7 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
2158
2159
pmb -> mbxOwner = OWN_HOST ;
2159
2160
pmboxq -> ctx_buf = NULL ;
2160
2161
2161
- if (phba -> pport -> fc_flag & FC_OFFLINE_MODE )
2162
+ if (test_bit ( FC_OFFLINE_MODE , & phba -> pport -> fc_flag ) )
2162
2163
rc = MBX_NOT_FINISHED ;
2163
2164
else
2164
2165
rc = lpfc_sli_issue_mbox_wait (phba , pmboxq , phba -> fc_ratov * 2 );
@@ -6200,7 +6201,7 @@ sysfs_ctlreg_write(struct file *filp, struct kobject *kobj,
6200
6201
if (memcmp (buf , LPFC_REG_WRITE_KEY , LPFC_REG_WRITE_KEY_SIZE ))
6201
6202
return - EINVAL ;
6202
6203
6203
- if (!( vport -> fc_flag & FC_OFFLINE_MODE ))
6204
+ if (!test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ))
6204
6205
return - EPERM ;
6205
6206
6206
6207
spin_lock_irq (& phba -> hbalock );
@@ -6433,12 +6434,12 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
6433
6434
fc_host_port_type (shost ) = FC_PORTTYPE_NPIV ;
6434
6435
} else if (lpfc_is_link_up (phba )) {
6435
6436
if (phba -> fc_topology == LPFC_TOPOLOGY_LOOP ) {
6436
- if (vport -> fc_flag & FC_PUBLIC_LOOP )
6437
+ if (test_bit ( FC_PUBLIC_LOOP , & vport -> fc_flag ) )
6437
6438
fc_host_port_type (shost ) = FC_PORTTYPE_NLPORT ;
6438
6439
else
6439
6440
fc_host_port_type (shost ) = FC_PORTTYPE_LPORT ;
6440
6441
} else {
6441
- if (vport -> fc_flag & FC_FABRIC )
6442
+ if (test_bit ( FC_FABRIC , & vport -> fc_flag ) )
6442
6443
fc_host_port_type (shost ) = FC_PORTTYPE_NPORT ;
6443
6444
else
6444
6445
fc_host_port_type (shost ) = FC_PORTTYPE_PTP ;
@@ -6457,7 +6458,7 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
6457
6458
struct lpfc_vport * vport = (struct lpfc_vport * ) shost -> hostdata ;
6458
6459
struct lpfc_hba * phba = vport -> phba ;
6459
6460
6460
- if (vport -> fc_flag & FC_OFFLINE_MODE )
6461
+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) )
6461
6462
fc_host_port_state (shost ) = FC_PORTSTATE_OFFLINE ;
6462
6463
else {
6463
6464
switch (phba -> link_state ) {
@@ -6571,10 +6572,10 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
6571
6572
struct lpfc_hba * phba = vport -> phba ;
6572
6573
u64 node_name ;
6573
6574
6574
- if (( vport -> port_state > LPFC_FLOGI ) &&
6575
- (( vport -> fc_flag & FC_FABRIC ) ||
6576
- (( phba -> fc_topology == LPFC_TOPOLOGY_LOOP ) &&
6577
- ( vport -> fc_flag & FC_PUBLIC_LOOP ))))
6575
+ if (vport -> port_state > LPFC_FLOGI &&
6576
+ (test_bit ( FC_FABRIC , & vport -> fc_flag ) ||
6577
+ (phba -> fc_topology == LPFC_TOPOLOGY_LOOP &&
6578
+ test_bit ( FC_PUBLIC_LOOP , & vport -> fc_flag ))))
6578
6579
node_name = wwn_to_u64 (phba -> fc_fabparam .nodeName .u .wwn );
6579
6580
else
6580
6581
/* fabric is local port if there is no F/FL_Port */
@@ -6630,7 +6631,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
6630
6631
pmboxq -> ctx_buf = NULL ;
6631
6632
pmboxq -> vport = vport ;
6632
6633
6633
- if (vport -> fc_flag & FC_OFFLINE_MODE ) {
6634
+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ) {
6634
6635
rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
6635
6636
if (rc != MBX_SUCCESS ) {
6636
6637
mempool_free (pmboxq , phba -> mbox_mem_pool );
@@ -6683,7 +6684,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
6683
6684
pmboxq -> ctx_buf = NULL ;
6684
6685
pmboxq -> vport = vport ;
6685
6686
6686
- if (vport -> fc_flag & FC_OFFLINE_MODE ) {
6687
+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ) {
6687
6688
rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
6688
6689
if (rc != MBX_SUCCESS ) {
6689
6690
mempool_free (pmboxq , phba -> mbox_mem_pool );
@@ -6770,8 +6771,8 @@ lpfc_reset_stats(struct Scsi_Host *shost)
6770
6771
pmboxq -> ctx_buf = NULL ;
6771
6772
pmboxq -> vport = vport ;
6772
6773
6773
- if (( vport -> fc_flag & FC_OFFLINE_MODE ) ||
6774
- ( !(psli -> sli_flag & LPFC_SLI_ACTIVE ) )) {
6774
+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ||
6775
+ !(psli -> sli_flag & LPFC_SLI_ACTIVE )) {
6775
6776
rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
6776
6777
if (rc != MBX_SUCCESS ) {
6777
6778
mempool_free (pmboxq , phba -> mbox_mem_pool );
@@ -6792,8 +6793,8 @@ lpfc_reset_stats(struct Scsi_Host *shost)
6792
6793
pmboxq -> ctx_buf = NULL ;
6793
6794
pmboxq -> vport = vport ;
6794
6795
6795
- if (( vport -> fc_flag & FC_OFFLINE_MODE ) ||
6796
- ( !(psli -> sli_flag & LPFC_SLI_ACTIVE ) )) {
6796
+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ||
6797
+ !(psli -> sli_flag & LPFC_SLI_ACTIVE )) {
6797
6798
rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
6798
6799
if (rc != MBX_SUCCESS ) {
6799
6800
mempool_free (pmboxq , phba -> mbox_mem_pool );
0 commit comments