bna: correct comparisons/assignments to bool
[cascardo/linux.git] / drivers / net / ethernet / brocade / bna / bfa_ioc.c
index 68f3c13..52fc439 100644 (file)
 
 /* IOC local definitions */
 
-#define bfa_ioc_state_disabled(__sm)                   \
-       (((__sm) == BFI_IOC_UNINIT) ||                  \
-        ((__sm) == BFI_IOC_INITING) ||                 \
-        ((__sm) == BFI_IOC_HWINIT) ||                  \
-        ((__sm) == BFI_IOC_DISABLED) ||                \
-        ((__sm) == BFI_IOC_FAIL) ||                    \
-        ((__sm) == BFI_IOC_CFG_DISABLED))
-
 /* Asic specific macros : see bfa_hw_cb.c and bfa_hw_ct.c for details. */
 
 #define bfa_ioc_firmware_lock(__ioc)                   \
                        ((__ioc)->ioc_hwif->ioc_get_fwstate(__ioc))
 #define bfa_ioc_set_alt_ioc_fwstate(__ioc, __fwstate)          \
                ((__ioc)->ioc_hwif->ioc_set_alt_fwstate(__ioc, __fwstate))
-#define bfa_ioc_get_alt_ioc_fwstate(__ioc)             \
-                       ((__ioc)->ioc_hwif->ioc_get_alt_fwstate(__ioc))
-
-#define bfa_ioc_mbox_cmd_pending(__ioc)                \
-                       (!list_empty(&((__ioc)->mbox_mod.cmd_q)) || \
-                       readl((__ioc)->ioc_regs.hfn_mbox_cmd))
 
 static bool bfa_nw_auto_recover = true;
 
@@ -1387,7 +1373,7 @@ static enum bfi_ioc_img_ver_cmp
 bfa_ioc_fw_ver_patch_cmp(struct bfi_ioc_image_hdr *base_fwhdr,
                         struct bfi_ioc_image_hdr *fwhdr_to_cmp)
 {
-       if (bfa_ioc_fw_ver_compatible(base_fwhdr, fwhdr_to_cmp) == false)
+       if (!bfa_ioc_fw_ver_compatible(base_fwhdr, fwhdr_to_cmp))
                return BFI_IOC_IMG_VER_INCOMP;
 
        if (fwhdr_to_cmp->fwver.patch > base_fwhdr->fwver.patch)
@@ -1398,7 +1384,7 @@ bfa_ioc_fw_ver_patch_cmp(struct bfi_ioc_image_hdr *base_fwhdr,
        /* GA takes priority over internal builds of the same patch stream.
         * At this point major minor maint and patch numbers are same.
         */
-       if (fwhdr_is_ga(base_fwhdr) == true)
+       if (fwhdr_is_ga(base_fwhdr))
                if (fwhdr_is_ga(fwhdr_to_cmp))
                        return BFI_IOC_IMG_VER_SAME;
                else
@@ -2223,7 +2209,7 @@ bfa_nw_ioc_smem_read(struct bfa_ioc *ioc, void *tbuf, u32 soff, u32 sz)
        /*
         *  Hold semaphore to serialize pll init and fwtrc.
        */
-       if (bfa_nw_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg) == 0)
+       if (!bfa_nw_ioc_sem_get(ioc->ioc_regs.ioc_init_sem_reg))
                return 1;
 
        writel(pgnum, ioc->ioc_regs.host_page_num_fn);
@@ -2278,7 +2264,7 @@ bfa_nw_ioc_debug_save_ftrc(struct bfa_ioc *ioc)
        int tlen;
 
        if (ioc->dbg_fwsave_once) {
-               ioc->dbg_fwsave_once = 0;
+               ioc->dbg_fwsave_once = false;
                if (ioc->dbg_fwsave_len) {
                        tlen = ioc->dbg_fwsave_len;
                        bfa_nw_ioc_debug_fwtrc(ioc, ioc->dbg_fwsave, &tlen);
@@ -2796,7 +2782,7 @@ bfa_ioc_get_adapter_attr(struct bfa_ioc *ioc,
                ad_attr->prototype = 0;
 
        ad_attr->pwwn = bfa_ioc_get_pwwn(ioc);
-       ad_attr->mac  = bfa_nw_ioc_get_mac(ioc);
+       bfa_nw_ioc_get_mac(ioc, ad_attr->mac);
 
        ad_attr->pcie_gen = ioc_attr->pcie_gen;
        ad_attr->pcie_lanes = ioc_attr->pcie_lanes;
@@ -2942,10 +2928,10 @@ bfa_ioc_get_pwwn(struct bfa_ioc *ioc)
        return ioc->attr->pwwn;
 }
 
-mac_t
-bfa_nw_ioc_get_mac(struct bfa_ioc *ioc)
+void
+bfa_nw_ioc_get_mac(struct bfa_ioc *ioc, u8 *mac)
 {
-       return ioc->attr->mac;
+       ether_addr_copy(mac, ioc->attr->mac);
 }
 
 /* Firmware failure detected. Start recovery actions. */