@@ -322,7 +322,7 @@ lpfc_enable_fip_show(struct device *dev, struct device_attribute *attr,
322322 struct lpfc_vport * vport = (struct lpfc_vport * ) shost -> hostdata ;
323323 struct lpfc_hba * phba = vport -> phba ;
324324
325- if (phba -> hba_flag & HBA_FIP_SUPPORT )
325+ if (test_bit ( HBA_FIP_SUPPORT , & phba -> hba_flag ) )
326326 return scnprintf (buf , PAGE_SIZE , "1\n" );
327327 else
328328 return scnprintf (buf , PAGE_SIZE , "0\n" );
@@ -1049,7 +1049,7 @@ lpfc_link_state_show(struct device *dev, struct device_attribute *attr,
10491049 case LPFC_INIT_MBX_CMDS :
10501050 case LPFC_LINK_DOWN :
10511051 case LPFC_HBA_ERROR :
1052- if (phba -> hba_flag & LINK_DISABLED )
1052+ if (test_bit ( LINK_DISABLED , & phba -> hba_flag ) )
10531053 len += scnprintf (buf + len , PAGE_SIZE - len ,
10541054 "Link Down - User disabled\n" );
10551055 else
@@ -1292,7 +1292,7 @@ lpfc_issue_lip(struct Scsi_Host *shost)
12921292 * it doesn't make any sense to allow issue_lip
12931293 */
12941294 if (test_bit (FC_OFFLINE_MODE , & vport -> fc_flag ) ||
1295- ( phba -> hba_flag & LINK_DISABLED ) ||
1295+ test_bit ( LINK_DISABLED , & phba -> hba_flag ) ||
12961296 (phba -> sli .sli_flag & LPFC_BLOCK_MGMT_IO ))
12971297 return - EPERM ;
12981298
@@ -3635,7 +3635,8 @@ lpfc_pt_show(struct device *dev, struct device_attribute *attr, char *buf)
36353635 struct lpfc_hba * phba = ((struct lpfc_vport * )shost -> hostdata )-> phba ;
36363636
36373637 return scnprintf (buf , PAGE_SIZE , "%d\n" ,
3638- (phba -> hba_flag & HBA_PERSISTENT_TOPO ) ? 1 : 0 );
3638+ test_bit (HBA_PERSISTENT_TOPO ,
3639+ & phba -> hba_flag ) ? 1 : 0 );
36393640}
36403641static DEVICE_ATTR (pt , 0444 ,
36413642 lpfc_pt_show , NULL) ;
@@ -4205,8 +4206,8 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
42054206 & phba -> sli4_hba .sli_intf );
42064207 if_type = bf_get (lpfc_sli_intf_if_type ,
42074208 & phba -> sli4_hba .sli_intf );
4208- if ((phba -> hba_flag & HBA_PERSISTENT_TOPO ||
4209- (!phba -> sli4_hba .pc_sli4_params .pls &&
4209+ if ((test_bit ( HBA_PERSISTENT_TOPO , & phba -> hba_flag ) ||
4210+ (!phba -> sli4_hba .pc_sli4_params .pls &&
42104211 (sli_family == LPFC_SLI_INTF_FAMILY_G6 ||
42114212 if_type == LPFC_SLI_INTF_IF_TYPE_6 ))) &&
42124213 val == 4 ) {
@@ -4309,7 +4310,7 @@ lpfc_link_speed_store(struct device *dev, struct device_attribute *attr,
43094310
43104311 if_type = bf_get (lpfc_sli_intf_if_type , & phba -> sli4_hba .sli_intf );
43114312 if (if_type >= LPFC_SLI_INTF_IF_TYPE_2 &&
4312- phba -> hba_flag & HBA_FORCED_LINK_SPEED )
4313+ test_bit ( HBA_FORCED_LINK_SPEED , & phba -> hba_flag ) )
43134314 return - EPERM ;
43144315
43154316 if (!strncmp (buf , "nolip " , strlen ("nolip " ))) {
@@ -6497,7 +6498,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
64976498 struct lpfc_vport * vport = (struct lpfc_vport * ) shost -> hostdata ;
64986499 struct lpfc_hba * phba = vport -> phba ;
64996500
6500- if ((lpfc_is_link_up (phba )) && (!(phba -> hba_flag & HBA_FCOE_MODE ))) {
6501+ if ((lpfc_is_link_up (phba )) &&
6502+ !test_bit (HBA_FCOE_MODE , & phba -> hba_flag )) {
65016503 switch (phba -> fc_linkspeed ) {
65026504 case LPFC_LINK_SPEED_1GHZ :
65036505 fc_host_speed (shost ) = FC_PORTSPEED_1GBIT ;
@@ -6533,7 +6535,8 @@ lpfc_get_host_speed(struct Scsi_Host *shost)
65336535 fc_host_speed (shost ) = FC_PORTSPEED_UNKNOWN ;
65346536 break ;
65356537 }
6536- } else if (lpfc_is_link_up (phba ) && (phba -> hba_flag & HBA_FCOE_MODE )) {
6538+ } else if (lpfc_is_link_up (phba ) &&
6539+ test_bit (HBA_FCOE_MODE , & phba -> hba_flag )) {
65376540 switch (phba -> fc_linkspeed ) {
65386541 case LPFC_ASYNC_LINK_SPEED_1GBPS :
65396542 fc_host_speed (shost ) = FC_PORTSPEED_1GBIT ;
@@ -6718,7 +6721,7 @@ lpfc_get_stats(struct Scsi_Host *shost)
67186721 hs -> invalid_crc_count -= lso -> invalid_crc_count ;
67196722 hs -> error_frames -= lso -> error_frames ;
67206723
6721- if (phba -> hba_flag & HBA_FCOE_MODE ) {
6724+ if (test_bit ( HBA_FCOE_MODE , & phba -> hba_flag ) ) {
67226725 hs -> lip_count = -1 ;
67236726 hs -> nos_count = (phba -> link_events >> 1 );
67246727 hs -> nos_count -= lso -> link_events ;
@@ -6816,7 +6819,7 @@ lpfc_reset_stats(struct Scsi_Host *shost)
68166819 lso -> invalid_tx_word_count = pmb -> un .varRdLnk .invalidXmitWord ;
68176820 lso -> invalid_crc_count = pmb -> un .varRdLnk .crcCnt ;
68186821 lso -> error_frames = pmb -> un .varRdLnk .crcCnt ;
6819- if (phba -> hba_flag & HBA_FCOE_MODE )
6822+ if (test_bit ( HBA_FCOE_MODE , & phba -> hba_flag ) )
68206823 lso -> link_events = (phba -> link_events >> 1 );
68216824 else
68226825 lso -> link_events = (phba -> fc_eventTag >> 1 );
@@ -7161,11 +7164,11 @@ lpfc_get_hba_function_mode(struct lpfc_hba *phba)
71617164 case PCI_DEVICE_ID_ZEPHYR_DCSP :
71627165 case PCI_DEVICE_ID_TIGERSHARK :
71637166 case PCI_DEVICE_ID_TOMCAT :
7164- phba -> hba_flag |= HBA_FCOE_MODE ;
7167+ set_bit ( HBA_FCOE_MODE , & phba -> hba_flag ) ;
71657168 break ;
71667169 default :
71677170 /* for others, clear the flag */
7168- phba -> hba_flag &= ~ HBA_FCOE_MODE ;
7171+ clear_bit ( HBA_FCOE_MODE , & phba -> hba_flag ) ;
71697172 }
71707173}
71717174
@@ -7236,7 +7239,7 @@ lpfc_get_cfgparam(struct lpfc_hba *phba)
72367239 lpfc_get_hba_function_mode (phba );
72377240
72387241 /* BlockGuard allowed for FC only. */
7239- if (phba -> cfg_enable_bg && phba -> hba_flag & HBA_FCOE_MODE ) {
7242+ if (phba -> cfg_enable_bg && test_bit ( HBA_FCOE_MODE , & phba -> hba_flag ) ) {
72407243 lpfc_printf_log (phba , KERN_INFO , LOG_INIT ,
72417244 "0581 BlockGuard feature not supported\n" );
72427245 /* If set, clear the BlockGuard support param */
0 commit comments