@@ -1092,14 +1092,14 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr,
10921092 break ;
10931093 }
10941094 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 ) )
10961096 len += scnprintf (buf + len , PAGE_SIZE - len ,
10971097 " Public Loop\n" );
10981098 else
10991099 len += scnprintf (buf + len , PAGE_SIZE - len ,
11001100 " Private Loop\n" );
11011101 } else {
1102- if (vport -> fc_flag & FC_FABRIC ) {
1102+ if (test_bit ( FC_FABRIC , & vport -> fc_flag ) ) {
11031103 if (phba -> sli_rev == LPFC_SLI_REV4 &&
11041104 vport -> port_type == LPFC_PHYSICAL_PORT &&
11051105 phba -> sli4_hba .fawwpn_flag &
@@ -1291,7 +1291,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
12911291 * If the link is offline, disabled or BLOCK_MGMT_IO
12921292 * it doesn't make any sense to allow issue_lip
12931293 */
1294- if (( vport -> fc_flag & FC_OFFLINE_MODE ) ||
1294+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ||
12951295 (phba -> hba_flag & LINK_DISABLED ) ||
12961296 (phba -> sli .sli_flag & LPFC_BLOCK_MGMT_IO ))
12971297 return - EPERM ;
@@ -1305,8 +1305,8 @@ lpfc_issue_lip(struct Scsi_Host *shost)
13051305 pmboxq -> u .mb .mbxCommand = MBX_DOWN_LINK ;
13061306 pmboxq -> u .mb .mbxOwner = OWN_HOST ;
13071307
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 ) ;
13101310
13111311 mbxstatus = lpfc_sli_issue_mbox_wait (phba , pmboxq , LPFC_MBOX_TMO * 2 );
13121312
@@ -1496,7 +1496,8 @@ lpfc_reset_pci_bus(struct lpfc_hba *phba)
14961496 if (shost ) {
14971497 phba_other =
14981498 ((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 )) {
15001501 lpfc_printf_log (phba_other , KERN_INFO , LOG_INIT ,
15011502 "8349 WWPN = 0x%02x%02x%02x%02x"
15021503 "%02x%02x%02x%02x is not "
@@ -1551,7 +1552,7 @@ lpfc_selective_reset(struct lpfc_hba *phba)
15511552 if (!phba -> cfg_enable_hba_reset )
15521553 return - EACCES ;
15531554
1554- if (!( phba -> pport -> fc_flag & FC_OFFLINE_MODE )) {
1555+ if (!test_bit ( FC_OFFLINE_MODE , & phba -> pport -> fc_flag )) {
15551556 status = lpfc_do_offline (phba , LPFC_EVT_OFFLINE );
15561557
15571558 if (status != 0 )
@@ -1690,7 +1691,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
16901691{
16911692 struct completion online_compl ;
16921693 struct pci_dev * pdev = phba -> pcidev ;
1693- uint32_t before_fc_flag ;
1694+ unsigned long before_fc_flag ;
16941695 uint32_t sriov_nr_virtfn ;
16951696 uint32_t reg_val ;
16961697 int status = 0 , rc = 0 ;
@@ -1761,7 +1762,7 @@ lpfc_sli4_pdev_reg_request(struct lpfc_hba *phba, uint32_t opcode)
17611762 }
17621763
17631764 /* keep the original port state */
1764- if (before_fc_flag & FC_OFFLINE_MODE ) {
1765+ if (test_bit ( FC_OFFLINE_MODE , & before_fc_flag ) ) {
17651766 if (phba -> fw_dump_cmpl )
17661767 phba -> fw_dump_cmpl = NULL ;
17671768 goto out ;
@@ -2099,7 +2100,7 @@ lpfc_board_mode_store(struct device *dev, struct device_attribute *attr,
20992100 * board_mode_str = '\0' ;
21002101 lpfc_printf_vlog (vport , KERN_ERR , LOG_INIT ,
21012102 "3097 Failed \"%s\", status(%d), "
2102- "fc_flag(x%x )\n" ,
2103+ "fc_flag(x%lx )\n" ,
21032104 buf , status , phba -> pport -> fc_flag );
21042105 return status ;
21052106 }
@@ -2158,7 +2159,7 @@ lpfc_get_hba_info(struct lpfc_hba *phba,
21582159 pmb -> mbxOwner = OWN_HOST ;
21592160 pmboxq -> ctx_buf = NULL ;
21602161
2161- if (phba -> pport -> fc_flag & FC_OFFLINE_MODE )
2162+ if (test_bit ( FC_OFFLINE_MODE , & phba -> pport -> fc_flag ) )
21622163 rc = MBX_NOT_FINISHED ;
21632164 else
21642165 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,
62006201 if (memcmp (buf , LPFC_REG_WRITE_KEY , LPFC_REG_WRITE_KEY_SIZE ))
62016202 return - EINVAL ;
62026203
6203- if (!( vport -> fc_flag & FC_OFFLINE_MODE ))
6204+ if (!test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ))
62046205 return - EPERM ;
62056206
62066207 spin_lock_irq (& phba -> hbalock );
@@ -6433,12 +6434,12 @@ lpfc_get_host_port_type(struct Scsi_Host *shost)
64336434 fc_host_port_type (shost ) = FC_PORTTYPE_NPIV ;
64346435 } else if (lpfc_is_link_up (phba )) {
64356436 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 ) )
64376438 fc_host_port_type (shost ) = FC_PORTTYPE_NLPORT ;
64386439 else
64396440 fc_host_port_type (shost ) = FC_PORTTYPE_LPORT ;
64406441 } else {
6441- if (vport -> fc_flag & FC_FABRIC )
6442+ if (test_bit ( FC_FABRIC , & vport -> fc_flag ) )
64426443 fc_host_port_type (shost ) = FC_PORTTYPE_NPORT ;
64436444 else
64446445 fc_host_port_type (shost ) = FC_PORTTYPE_PTP ;
@@ -6457,7 +6458,7 @@ lpfc_get_host_port_state(struct Scsi_Host *shost)
64576458 struct lpfc_vport * vport = (struct lpfc_vport * ) shost -> hostdata ;
64586459 struct lpfc_hba * phba = vport -> phba ;
64596460
6460- if (vport -> fc_flag & FC_OFFLINE_MODE )
6461+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) )
64616462 fc_host_port_state (shost ) = FC_PORTSTATE_OFFLINE ;
64626463 else {
64636464 switch (phba -> link_state ) {
@@ -6571,10 +6572,10 @@ lpfc_get_host_fabric_name (struct Scsi_Host *shost)
65716572 struct lpfc_hba * phba = vport -> phba ;
65726573 u64 node_name ;
65736574
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 ))))
65786579 node_name = wwn_to_u64 (phba -> fc_fabparam .nodeName .u .wwn );
65796580 else
65806581 /* fabric is local port if there is no F/FL_Port */
@@ -6630,7 +6631,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
66306631 pmboxq -> ctx_buf = NULL ;
66316632 pmboxq -> vport = vport ;
66326633
6633- if (vport -> fc_flag & FC_OFFLINE_MODE ) {
6634+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ) {
66346635 rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
66356636 if (rc != MBX_SUCCESS ) {
66366637 mempool_free (pmboxq , phba -> mbox_mem_pool );
@@ -6683,7 +6684,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
66836684 pmboxq -> ctx_buf = NULL ;
66846685 pmboxq -> vport = vport ;
66856686
6686- if (vport -> fc_flag & FC_OFFLINE_MODE ) {
6687+ if (test_bit ( FC_OFFLINE_MODE , & vport -> fc_flag ) ) {
66876688 rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
66886689 if (rc != MBX_SUCCESS ) {
66896690 mempool_free (pmboxq , phba -> mbox_mem_pool );
@@ -6770,8 +6771,8 @@ lpfc_reset_stats(struct Scsi_Host *shost)
67706771 pmboxq -> ctx_buf = NULL ;
67716772 pmboxq -> vport = vport ;
67726773
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 )) {
67756776 rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
67766777 if (rc != MBX_SUCCESS ) {
67776778 mempool_free (pmboxq , phba -> mbox_mem_pool );
@@ -6792,8 +6793,8 @@ lpfc_reset_stats(struct Scsi_Host *shost)
67926793 pmboxq -> ctx_buf = NULL ;
67936794 pmboxq -> vport = vport ;
67946795
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 )) {
67976798 rc = lpfc_sli_issue_mbox (phba , pmboxq , MBX_POLL );
67986799 if (rc != MBX_SUCCESS ) {
67996800 mempool_free (pmboxq , phba -> mbox_mem_pool );
0 commit comments