rtlwifi: Replace local debug macro RT_ASSERT
authorLarry Finger <Larry.Finger@lwfinger.net>
Thu, 15 Dec 2016 18:22:57 +0000 (12:22 -0600)
committerKalle Valo <kvalo@codeaurora.org>
Fri, 30 Dec 2016 13:54:19 +0000 (15:54 +0200)
This macro can be replaced with WARN_ONCE. In addition to using a
standard debugging macro for these critical errors, we also get
a stack dump.

In rtl8821ae/hw.c, a senseless comment was removed, and an incorrect
indentation was fixed.

This patch also fixes two places in each of rtl8192ee, rtl8723be,
and rtl8821ae where the logical condition was incorrect.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
38 files changed:
drivers/net/wireless/realtek/rtlwifi/core.c
drivers/net/wireless/realtek/rtlwifi/debug.h
drivers/net/wireless/realtek/rtlwifi/pci.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8188ee/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
drivers/net/wireless/realtek/rtlwifi/rtl8192c/phy_common.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ce/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192cu/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/sw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192de/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8192ee/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8192se/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8723ae/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8723be/trx.c
drivers/net/wireless/realtek/rtlwifi/rtl8723com/phy_common.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/hw.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/phy.c
drivers/net/wireless/realtek/rtlwifi/rtl8821ae/trx.c
drivers/net/wireless/realtek/rtlwifi/usb.c

index 2caa4ad04dba4a6e66a02b74173ab1b016ca7af1..7ae774da24bd67a5a09b32ccdafa9f4905f0cafd 100644 (file)
@@ -1613,8 +1613,8 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
                        RT_TRACE(rtlpriv, COMP_SEC, DBG_DMESG,
                                 "set pairwise key\n");
                        if (!sta) {
-                               RT_ASSERT(false,
-                                         "pairwise key without mac_addr\n");
+                               WARN_ONCE(true,
+                                         "rtlwifi: pairwise key without mac_addr\n");
 
                                err = -EOPNOTSUPP;
                                goto out_unlock;
@@ -1804,8 +1804,8 @@ bool rtl_hal_pwrseqcmdparsing(struct rtl_priv *rtlpriv, u8 cut_version,
                                         "rtl_hal_pwrseqcmdparsing(): PWR_CMD_END\n");
                                return true;
                        default:
-                               RT_ASSERT(false,
-                                         "rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n");
+                               WARN_ONCE(true,
+                                         "rtlwifi: rtl_hal_pwrseqcmdparsing(): Unknown CMD!!\n");
                                break;
                        }
                }
index 6156a79328c1168086747d57812b9a5592941049..6f2e2b943c3d88fa4612c2b095c953718f32a035 100644 (file)
@@ -166,15 +166,6 @@ enum dbgp_flag_e {
 
 #ifdef CONFIG_RTLWIFI_DEBUG
 
-#define RT_ASSERT(_exp, fmt, ...)                                      \
-do {                                                                   \
-       if (!(_exp)) {                                                  \
-               printk(KERN_DEBUG KBUILD_MODNAME ":%s(): " fmt,         \
-                      __func__, ##__VA_ARGS__);                        \
-       }                                                               \
-} while (0)
-
-
 struct rtl_priv;
 
 __printf(5, 6)
@@ -210,11 +201,6 @@ do {                                                                       \
 
 struct rtl_priv;
 
-__printf(2, 3)
-static inline void RT_ASSERT(int exp, const char *fmt, ...)
-{
-}
-
 __printf(4, 5)
 static inline void RT_TRACE(struct rtl_priv *rtlpriv,
                            int comp, int level,
index 8bfe020edd3a24aaa9f8ec7c194f5b8fa7093d1f..bb767186609ee863fed33501eff51c17a2c3f4e5 100644 (file)
@@ -2174,15 +2174,15 @@ int rtl_pci_probe(struct pci_dev *pdev,
 
        err = pci_enable_device(pdev);
        if (err) {
-               RT_ASSERT(false, "%s : Cannot enable new PCI device\n",
+               WARN_ONCE(true, "%s : Cannot enable new PCI device\n",
                          pci_name(pdev));
                return err;
        }
 
        if (!pci_set_dma_mask(pdev, DMA_BIT_MASK(32))) {
                if (pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
-                       RT_ASSERT(false,
-                                 "Unable to obtain 32bit DMA for consistent allocations\n");
+                       WARN_ONCE(true,
+                                 "rtlwifi: Unable to obtain 32bit DMA for consistent allocations\n");
                        err = -ENOMEM;
                        goto fail1;
                }
@@ -2193,7 +2193,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
        hw = ieee80211_alloc_hw(sizeof(struct rtl_pci_priv) +
                                sizeof(struct rtl_priv), &rtl_ops);
        if (!hw) {
-               RT_ASSERT(false,
+               WARN_ONCE(true,
                          "%s : ieee80211 alloc failed\n", pci_name(pdev));
                err = -ENOMEM;
                goto fail1;
@@ -2232,7 +2232,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
        /* MEM map */
        err = pci_request_regions(pdev, KBUILD_MODNAME);
        if (err) {
-               RT_ASSERT(false, "Can't obtain PCI resources\n");
+               WARN_ONCE(true, "rtlwifi: Can't obtain PCI resources\n");
                goto fail1;
        }
 
@@ -2245,7 +2245,7 @@ int rtl_pci_probe(struct pci_dev *pdev,
                        (unsigned long)pci_iomap(pdev,
                        rtlpriv->cfg->bar_id, pmem_len);
        if (rtlpriv->io.pci_mem_start == 0) {
-               RT_ASSERT(false, "Can't map PCI mem\n");
+               WARN_ONCE(true, "rtlwifi: Can't map PCI mem\n");
                err = -ENOMEM;
                goto fail2;
        }
index 5360d533235944a94fe931ab76ce4e04439a77ab..49da81abaf8264860227636e5c248216e7cdda8f 100644 (file)
@@ -434,8 +434,8 @@ void rtl88e_fill_h2c_cmd(struct ieee80211_hw *hw,
        u32 tmp_cmdbuf[2];
 
        if (!rtlhal->fw_ready) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
+               WARN_ONCE(true,
+                         "rtl8188ee: error H2C cmd because of Fw download fail!!!\n");
                return;
        }
 
index 37d6efc3d240d267a179b04be3ea0207a64fb3cb..1a17dfe3edf6a1dce84b08a40526efedb9d845bc 100644 (file)
@@ -1352,7 +1352,7 @@ void rtl88ee_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8188ee: invalid aci: %d !\n", aci);
                break;
        }
 }
index fffaa92eda812fc91f03cfb2b429e11efee4006d..ece8691ce3c00ef4ba34ea6f2028150313bbb034 100644 (file)
@@ -1231,8 +1231,8 @@ u8 rtl88e_phy_sw_chnl(struct ieee80211_hw *hw)
                return 0;
        if (rtlphy->set_bwmode_inprogress)
                return 0;
-       RT_ASSERT((rtlphy->current_channel <= 14),
-                 "WIRELESS_MODE_G but channel>14");
+       WARN_ONCE((rtlphy->current_channel > 14),
+                 "rtl8188ee: WIRELESS_MODE_G but channel>14");
        rtlphy->sw_chnl_inprogress = true;
        rtlphy->sw_chnl_stage = 0;
        rtlphy->sw_chnl_step = 0;
@@ -1280,8 +1280,8 @@ static bool _rtl88e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
        rfdependcmdcnt = 0;
 
-       RT_ASSERT((channel >= 1 && channel <= 14),
-                 "illegal channel for Zebra: %d\n", channel);
+       WARN_ONCE((channel < 1 || channel > 14),
+                 "rtl8188ee: illegal channel for Zebra: %d\n", channel);
 
        _rtl88e_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
                                         MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
@@ -1367,7 +1367,7 @@ static bool _rtl88e_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
        struct swchnlcmd *pcmd;
 
        if (cmdtable == NULL) {
-               RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+               WARN_ONCE(true, "rtl8188ee: cmdtable cannot be NULL.\n");
                return false;
        }
 
index 3e3b88664883cb0b88b009dc04bc6bc6244d32e3..09c908d4cf91f710e7f6c4c22c04d52baed30d5f 100644 (file)
@@ -760,7 +760,7 @@ void rtl88ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8188ee: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -779,7 +779,7 @@ void rtl88ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8188ee: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -799,7 +799,7 @@ u32 rtl88ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8188ee: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -815,7 +815,7 @@ u32 rtl88ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_BUFF_ADDR(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8188ee: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
index 7d152466152b8b799ac97bd7e4fb697c7268a19a..9c3392ad01bcd333fe35364b05220f571091ca49 100644 (file)
@@ -485,8 +485,8 @@ void rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
        u32 tmp_cmdbuf[2];
 
        if (!rtlhal->fw_ready) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
+               WARN_ONCE(true,
+                         "rtl8192c-common: return H2C cmd because of Fw download fail!!!\n");
                return;
        }
 
@@ -510,7 +510,7 @@ void rtl92c_firmware_selfreset(struct ieee80211_hw *hw)
        while (u1b_tmp & BIT(2)) {
                delay--;
                if (delay == 0) {
-                       RT_ASSERT(false, "8051 reset fail.\n");
+                       WARN_ONCE(true, "rtl8192c-common: 8051 reset fail.\n");
                        break;
                }
                udelay(50);
index 94dd25cf1ca86a6a3fe6a4ff55efb5b8fc9074a5..32fc4b60bc8649230c33039e14292dc2bdc42a0f 100644 (file)
@@ -77,7 +77,7 @@ EXPORT_SYMBOL(rtl92c_phy_set_bb_reg);
 u32 _rtl92c_phy_fw_rf_serial_read(struct ieee80211_hw *hw,
                                  enum radio_path rfpath, u32 offset)
 {
-       RT_ASSERT(false, "deprecated!\n");
+       WARN_ONCE(true, "rtl8192c-common: _rtl92c_phy_fw_rf_serial_read deprecated!\n");
        return 0;
 }
 EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_read);
@@ -86,7 +86,7 @@ void _rtl92c_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
                                    enum radio_path rfpath, u32 offset,
                                    u32 data)
 {
-       RT_ASSERT(false, "deprecated!\n");
+       WARN_ONCE(true, "rtl8192c-common: _rtl92c_phy_fw_rf_serial_write deprecated!\n");
 }
 EXPORT_SYMBOL(_rtl92c_phy_fw_rf_serial_write);
 
@@ -745,8 +745,8 @@ u8 rtl92c_phy_sw_chnl(struct ieee80211_hw *hw)
                return 0;
        if (rtlphy->set_bwmode_inprogress)
                return 0;
-       RT_ASSERT((rtlphy->current_channel <= 14),
-                 "WIRELESS_MODE_G but channel>14");
+       WARN_ONCE((rtlphy->current_channel > 14),
+                 "rtl8192c-common: WIRELESS_MODE_G but channel>14");
        rtlphy->sw_chnl_inprogress = true;
        rtlphy->sw_chnl_stage = 0;
        rtlphy->sw_chnl_step = 0;
@@ -792,7 +792,7 @@ static bool _rtl92c_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
        struct swchnlcmd *pcmd;
 
        if (cmdtable == NULL) {
-               RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+               WARN_ONCE(true, "rtl8192c-common: cmdtable cannot be NULL.\n");
                return false;
        }
 
@@ -837,8 +837,8 @@ bool _rtl92c_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
        rfdependcmdcnt = 0;
 
-       RT_ASSERT((channel >= 1 && channel <= 14),
-                 "illegal channel for Zebra: %d\n", channel);
+       WARN_ONCE((channel < 1 || channel > 14),
+                 "rtl8192c-common: illegal channel for Zebra: %d\n", channel);
 
        _rtl92c_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
                                         MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
index 4483d40ecad1b7adec14077caec71fbeb2f83545..b757a74339c13feaf19d63bf78c008f779f1d865 100644 (file)
@@ -1292,7 +1292,7 @@ void rtl92ce_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8192ce: invalid aci: %d !\n", aci);
                break;
        }
 }
index 2ab4a00246cca14fa77af6ba98a176f29917884f..3616ba21959d1edeca7df314ba2b7a648dab255d 100644 (file)
@@ -670,7 +670,7 @@ void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -690,7 +690,7 @@ void rtl92ce_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -710,7 +710,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(p_desc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192ce: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -726,7 +726,7 @@ u32 rtl92ce_get_desc(u8 *p_desc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_BUFF_ADDR(p_desc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192ce: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
index 5c7da0cfc684eb6039705479bda3690f5347016b..ddfcf9949d9e115ca831df983ffec13c6f6fc841 100644 (file)
@@ -1790,7 +1790,7 @@ void rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val)
                                                u4b_ac_param);
                                break;
                        default:
-                               RT_ASSERT(false, "invalid aci: %d !\n",
+                               WARN_ONCE(true, "rtl8192cu: invalid aci: %d !\n",
                                          e_aci);
                                break;
                        }
index 1ea878fa7901266ace020a0ff683d6e36b359ec1..6da6e2acfbecde515d44ab69a398cf70638c1273 100644 (file)
@@ -241,7 +241,7 @@ u16 rtl8192cu_mq_to_hwq(__le16 fc, u16 mac80211_queue_index)
                break;
        default:
                hw_queue_index = RTL_TXQ_BE;
-               RT_ASSERT(false, "QSLT_BE queue, skb_queue:%d\n",
+               WARN_ONCE(true, "rtl8192cu: QSLT_BE queue, skb_queue:%d\n",
                          mac80211_queue_index);
                break;
        }
index 17f6903c14bbe6f33067b83529a6f124a0b0270d..fc1d4f2ba82d652f3944c811fa827034c3b2c482 100644 (file)
@@ -182,7 +182,7 @@ void rtl92d_firmware_selfreset(struct ieee80211_hw *hw)
                udelay(50);
                u1b_tmp = rtl_read_byte(rtlpriv, REG_SYS_FUNC_EN + 1);
        }
-       RT_ASSERT((delay > 0), "8051 reset failed!\n");
+       WARN_ONCE((delay <= 0), "rtl8192de: 8051 reset failed!\n");
        RT_TRACE(rtlpriv, COMP_FW, DBG_DMESG,
                 "=====> 8051 reset success (%d)\n", delay);
 }
index 424f54babd03e8cf22e1c7c30b67959331abcf57..b0dc189e5579cc731a5436013caf045c7c15956a 100644 (file)
@@ -2700,7 +2700,7 @@ static bool _rtl92d_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
        struct swchnlcmd *pcmd;
 
        if (cmdtable == NULL) {
-               RT_ASSERT(false, "cmdtable cannot be NULL\n");
+               WARN_ONCE(true, "rtl8192de: cmdtable cannot be NULL\n");
                return false;
        }
        if (cmdtableidx >= cmdtablesz)
@@ -2893,17 +2893,17 @@ u8 rtl92d_phy_sw_chnl(struct ieee80211_hw *hw)
                 * 5G and 2.4G band. */
                if (channel <= 14)
                        return 0;
-               RT_ASSERT((channel > 14), "5G but channel<=14\n");
+               WARN_ONCE((channel <= 14), "rtl8192de: 5G but channel<=14\n");
                break;
        case BAND_ON_2_4G:
                /* Get first channel error when change between
                 * 5G and 2.4G band. */
                if (channel > 14)
                        return 0;
-               RT_ASSERT((channel <= 14), "2G but channel>14\n");
+               WARN_ONCE((channel > 14), "rtl8192de: 2G but channel>14\n");
                break;
        default:
-               RT_ASSERT(false, "Invalid WirelessMode(%#x)!!\n",
+               WARN_ONCE(true, "rtl8192de: Invalid WirelessMode(%#x)!!\n",
                          rtlpriv->mac80211.mode);
                break;
        }
@@ -3336,7 +3336,7 @@ void rtl92d_phy_set_poweron(struct ieee80211_hw *hw)
                        }
                }
                if (i == 200)
-                       RT_ASSERT(false, "Another mac power off over time\n");
+                       WARN_ONCE(true, "rtl8192de: Another mac power off over time\n");
        }
 }
 
index 2d65e40952921924b42ecfbc5daed49471ba8b3b..0d98b34eff0af1be0b02ae00cd3fb6f048bcd42b 100644 (file)
@@ -402,7 +402,7 @@ static int __init rtl92de_module_init(void)
 
        ret = pci_register_driver(&rtl92de_driver);
        if (ret)
-               RT_ASSERT(false, "No device found\n");
+               WARN_ONCE(true, "rtl8192de: No device found\n");
        return ret;
 }
 
index 5fb37564957cd9831c6c14d33908ef369e4cf5e3..5c9c8741134fb344898008c0cad7b432b7b9f547 100644 (file)
@@ -794,7 +794,7 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192de: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -814,7 +814,7 @@ void rtl92de_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -834,7 +834,7 @@ u32 rtl92de_get_desc(u8 *p_desc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(p_desc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192de: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -848,7 +848,7 @@ u32 rtl92de_get_desc(u8 *p_desc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_PKT_LEN(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192de: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
index b3f6a9ed15d44b03d7e8f5a210068d624e8396cb..7a5cc0c746cd8c36df58e4471903681773770862 100644 (file)
@@ -462,8 +462,8 @@ void rtl92ee_fill_h2c_cmd(struct ieee80211_hw *hw,
        u32 tmp_cmdbuf[2];
 
        if (!rtlhal->fw_ready) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
+               WARN_ONCE(true,
+                         "rtl8192ee: error H2C cmd because of Fw download fail!!!\n");
                return;
        }
 
index ebf663e1a81a0ab8a5613508b82690e623592822..00b211b3fc8f9170f65a99cd580b4ec5a276b042 100644 (file)
@@ -1582,7 +1582,7 @@ void rtl92ee_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8192ee: invalid aci: %d !\n", aci);
                break;
        }
 }
index 5ad7e753c357f8671a9b5f518f1661205c57e898..c35ba764a6c570b1bb900d7508797846cfc15297 100644 (file)
@@ -1176,7 +1176,7 @@ static u8 _rtl92ee_phy_get_ratesection_intxpower_byrate(enum radio_path path,
                rate_section = 7;
                break;
        default:
-               RT_ASSERT(true, "Rate_Section is Illegal\n");
+               WARN_ONCE(true, "rtl8192ee: Rate_Section is Illegal\n");
                break;
        }
        return rate_section;
@@ -1239,7 +1239,7 @@ static u8 _rtl92ee_get_txpower_by_rate(struct ieee80211_hw *hw,
                shift = 24;
                break;
        default:
-               RT_ASSERT(true, "Rate_Section is Illegal\n");
+               WARN_ONCE(true, "rtl8192ee: Rate_Section is Illegal\n");
                break;
        }
 
@@ -1811,8 +1811,8 @@ u8 rtl92ee_phy_sw_chnl(struct ieee80211_hw *hw)
                return 0;
        if (rtlphy->set_bwmode_inprogress)
                return 0;
-       RT_ASSERT((rtlphy->current_channel <= 14),
-                 "WIRELESS_MODE_G but channel>14");
+       WARN_ONCE((rtlphy->current_channel > 14),
+                 "rtl8192ee: WIRELESS_MODE_G but channel>14");
        rtlphy->sw_chnl_inprogress = true;
        rtlphy->sw_chnl_stage = 0;
        rtlphy->sw_chnl_step = 0;
@@ -1860,8 +1860,8 @@ static bool _rtl92ee_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
        rfdependcmdcnt = 0;
 
-       RT_ASSERT((channel >= 1 && channel <= 14),
-                 "illegal channel for Zebra: %d\n", channel);
+       WARN_ONCE((channel < 1 || channel > 14),
+                 "rtl8192ee: illegal channel for Zebra: %d\n", channel);
 
        _rtl92ee_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
                                          MAX_RFDEPENDCMD_CNT,
@@ -1948,7 +1948,7 @@ static bool _rtl92ee_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
        struct swchnlcmd *pcmd;
 
        if (cmdtable == NULL) {
-               RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+               WARN_ONCE(true, "rtl8192ee: cmdtable cannot be NULL.\n");
                return false;
        }
 
index 2d48ccd02ac85da1b056fe7199656f3f6f71071f..07440e9a8ca26ae0b259cf46760c188cc7422cc5 100644 (file)
@@ -991,8 +991,9 @@ void rtl92ee_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR rxdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8192ee: ERR rxdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        }
@@ -1011,8 +1012,9 @@ u32 rtl92ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_TXBUFFER_DESC_ADDR_LOW(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR txdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8192ee: ERR txdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        } else {
@@ -1027,8 +1029,9 @@ u32 rtl92ee_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_BUFF_ADDR(pdesc);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR rxdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8192ee: ERR rxdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        }
index 26e06b2837c3a97d7d74e2b84aee047d820766de..f4ab72101d044117e42d2cae4ff3f0e3e7883cdb 100644 (file)
@@ -1251,7 +1251,7 @@ void rtl92se_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, EDCAPARA_VO, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8192se: invalid aci: %d !\n", aci);
                break;
        }
 }
index fcb9216af82d1731863a604d0bee03ade5be6720..6299dc1c8eac5d1c4eea277db80c4b618a80f5af 100644 (file)
@@ -330,7 +330,7 @@ static bool _rtl92s_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
        struct swchnlcmd *pcmd;
 
        if (cmdtable == NULL) {
-               RT_ASSERT(false, "cmdtable cannot be NULL\n");
+               WARN_ONCE(true, "rtl8192se: cmdtable cannot be NULL\n");
                return false;
        }
 
@@ -374,8 +374,8 @@ static bool _rtl92s_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
        rfdependcmdcnt = 0;
 
-       RT_ASSERT((channel >= 1 && channel <= 14),
-                 "invalid channel for Zebra: %d\n", channel);
+       WARN_ONCE((channel < 1 || channel > 14),
+                 "rtl8192se: invalid channel for Zebra: %d\n", channel);
 
        _rtl92s_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
                                         MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
index 9a5a113992211d5641af7cae2d4d1412b06f9319..12cef01e593bb2f2550db876817b98c2107f2467 100644 (file)
@@ -583,7 +583,7 @@ void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -603,7 +603,7 @@ void rtl92se_set_desc(struct ieee80211_hw *hw, u8 *pdesc, bool istx,
                        SET_RX_STATUS_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -623,7 +623,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(desc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192se: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -639,7 +639,7 @@ u32 rtl92se_get_desc(u8 *desc, bool istx, u8 desc_name)
                        ret = GET_RX_STATUS_DESC_BUFF_ADDR(desc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8192se: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
index 1186755e55b84447f3753af654f25b4d6d65b7ad..164a27e725376973ebc060ece7f824e598ca5c14 100644 (file)
@@ -259,8 +259,8 @@ void rtl8723e_fill_h2c_cmd(struct ieee80211_hw *hw,
        u32 tmp_cmdbuf[2];
 
        if (!rtlhal->fw_ready) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
+               WARN_ONCE(true,
+                         "rtl8723ae: error H2C cmd because of Fw download fail!!!\n");
                return;
        }
        memset(tmp_cmdbuf, 0, 8);
index f8be0bd7e3269c128f226a53fdc4535256faf85e..e0da8dceff2cb6f99bd66721e644f85134ed9d55 100644 (file)
@@ -1256,7 +1256,7 @@ void rtl8723e_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8723ae: invalid aci: %d !\n", aci);
                break;
        }
 }
index 17b58cb32d55146f8d25e23c0a9faa0df32ec082..8001dce9f27716c241ce2c185fd191d42844b54b 100644 (file)
@@ -133,7 +133,7 @@ static void _rtl8723e_phy_fw_rf_serial_write(struct ieee80211_hw *hw,
                                             enum radio_path rfpath, u32 offset,
                                             u32 data)
 {
-       RT_ASSERT(false, "deprecated!\n");
+       WARN_ONCE(true, "rtl8723ae: _rtl8723e_phy_fw_rf_serial_write deprecated!\n");
 }
 
 static void _rtl8723e_phy_bb_config_1t(struct ieee80211_hw *hw)
@@ -885,8 +885,8 @@ u8 rtl8723e_phy_sw_chnl(struct ieee80211_hw *hw)
                return 0;
        if (rtlphy->set_bwmode_inprogress)
                return 0;
-       RT_ASSERT((rtlphy->current_channel <= 14),
-                 "WIRELESS_MODE_G but channel>14");
+       WARN_ONCE((rtlphy->current_channel > 14),
+                 "rtl8723ae: WIRELESS_MODE_G but channel>14");
        rtlphy->sw_chnl_inprogress = true;
        rtlphy->sw_chnl_stage = 0;
        rtlphy->sw_chnl_step = 0;
@@ -954,8 +954,8 @@ static bool _rtl8723e_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
        rfdependcmdcnt = 0;
 
-       RT_ASSERT((channel >= 1 && channel <= 14),
-                 "illegal channel for Zebra: %d\n", channel);
+       WARN_ONCE((channel < 1 || channel > 14),
+                 "rtl8723ae: illegal channel for Zebra: %d\n", channel);
 
        rtl8723_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
                                         MAX_RFDEPENDCMD_CNT, CMDID_RF_WRITEREG,
index e93125ebed812af0afab94e40f1fdf3bf1c9a9b2..c9838f52a7ea8a5c30802a4c2824df41b4fe48f1 100644 (file)
@@ -617,7 +617,7 @@ void rtl8723e_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *) val);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8723ae: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -636,7 +636,7 @@ void rtl8723e_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8723ae: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -656,7 +656,7 @@ u32 rtl8723e_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8723ae: ERR txdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
@@ -672,7 +672,7 @@ u32 rtl8723e_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_BUFF_ADDR(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8723ae: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
index 8c5c27ce8e059ddf8c8b31dcdb049e2cbd79fb67..6b03c7fe8a0485440d58d069a5eef8bb6171fa09 100644 (file)
@@ -224,8 +224,8 @@ void rtl8723be_fill_h2c_cmd(struct ieee80211_hw *hw, u8 element_id,
        u32 tmp_cmdbuf[2];
 
        if (!rtlhal->fw_ready) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
+               WARN_ONCE(true,
+                         "rtl8723be: error H2C cmd because of Fw download fail!!!\n");
                return;
        }
 
index aba60c3145c5f6f60b5e34cdbc7885d3042ae2f8..56a1ae438fba81ddb68600b98a34e88eca4dbd57 100644 (file)
@@ -1631,7 +1631,7 @@ void rtl8723be_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8723be: invalid aci: %d !\n", aci);
                break;
        }
 }
index 3cc2232f25caf6293c966a09dc86f1b063345b88..b4e0a58f1c1fd6e6a5de25c4097e8bbe0f2c5f7f 100644 (file)
@@ -939,7 +939,7 @@ static u8 _rtl8723be_phy_get_ratesection_intxpower_byrate(enum radio_path path,
                break;
 
        default:
-               RT_ASSERT(true, "Rate_Section is Illegal\n");
+               WARN_ONCE(true, "rtl8723be: Rate_Section is Illegal\n");
                break;
        }
 
@@ -1004,7 +1004,7 @@ static u8 _rtl8723be_get_txpower_by_rate(struct ieee80211_hw *hw,
                shift = 24;
                break;
        default:
-               RT_ASSERT(true, "Rate_Section is Illegal\n");
+               WARN_ONCE(true, "rtl8723be: Rate_Section is Illegal\n");
                break;
        }
        tx_pwr_diff = (u8)(rtlphy->tx_power_by_rate_offset[band][rfpath][tx_num]
@@ -1387,8 +1387,8 @@ u8 rtl8723be_phy_sw_chnl(struct ieee80211_hw *hw)
                return 0;
        if (rtlphy->set_bwmode_inprogress)
                return 0;
-       RT_ASSERT((rtlphy->current_channel <= 14),
-                 "WIRELESS_MODE_G but channel>14");
+       WARN_ONCE((rtlphy->current_channel > 14),
+                 "rtl8723be: WIRELESS_MODE_G but channel>14");
        rtlphy->sw_chnl_inprogress = true;
        rtlphy->sw_chnl_stage = 0;
        rtlphy->sw_chnl_step = 0;
@@ -1438,8 +1438,8 @@ static bool _rtl8723be_phy_sw_chnl_step_by_step(struct ieee80211_hw *hw,
 
        rfdependcmdcnt = 0;
 
-       RT_ASSERT((channel >= 1 && channel <= 14),
-                 "illegal channel for Zebra: %d\n", channel);
+       WARN_ONCE((channel < 1 || channel > 14),
+                 "rtl8723be: illegal channel for Zebra: %d\n", channel);
 
        rtl8723_phy_set_sw_chnl_cmdarray(rfdependcmd, rfdependcmdcnt++,
                                         MAX_RFDEPENDCMD_CNT,
index 2175aecbb8f4173145adf10f058cc6308ed0a4fa..6f65003a895a572448446c21a22725191f3cb24d 100644 (file)
@@ -666,8 +666,8 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
-                                         desc_name);
+                       WARN_ONCE(true, "rtl8723be: ERR txdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        } else {
@@ -685,8 +685,8 @@ void rtl8723be_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
-                                         desc_name);
+                       WARN_ONCE(true, "rtl8723be: ERR rxdesc :%d not process\n",
+                                 desc_name);
                        break;
                }
        }
@@ -705,8 +705,8 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR txdesc :%d not process\n",
-                                         desc_name);
+                       WARN_ONCE(true, "rtl8723be: ERR txdesc :%d not process\n",
+                                 desc_name);
                        break;
                }
        } else {
@@ -721,7 +721,7 @@ u32 rtl8723be_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_BUFF_ADDR(pdesc);
                        break;
                default:
-                       RT_ASSERT(false, "ERR rxdesc :%d not process\n",
+                       WARN_ONCE(true, "rtl8723be: ERR rxdesc :%d not processed\n",
                                  desc_name);
                        break;
                }
index 75cbd1509b52043863de0088ad18b307c412b85f..6b80ddc9e5c93788eb079535b06aa1fd5d18773f 100644 (file)
@@ -283,7 +283,7 @@ bool rtl8723_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
        struct swchnlcmd *pcmd;
 
        if (cmdtable == NULL) {
-               RT_ASSERT(false, "cmdtable cannot be NULL.\n");
+               WARN_ONCE(true, "rtl8723-common: cmdtable cannot be NULL.\n");
                return false;
        }
 
index b665446351a4f3f9497766758b6f32ef616418fa..9e87b96626c60f8c2762b305933c6bd6b803aa3d 100644 (file)
@@ -510,8 +510,8 @@ void rtl8821ae_fill_h2c_cmd(struct ieee80211_hw *hw,
        u32 tmp_cmdbuf[2];
 
        if (!rtlhal->fw_ready) {
-               RT_ASSERT(false,
-                         "return H2C cmd because of Fw download fail!!!\n");
+               WARN_ONCE(true,
+                         "rtl8821ae: error H2C cmd because of Fw download fail!!!\n");
                return;
        }
 
index 1281ebe0c30ac5c546508e26528ffe51d6f02754..b045dd065cb6f16fe664406987695a58adc43aaf 100644 (file)
@@ -2249,7 +2249,7 @@ void rtl8821ae_set_qos(struct ieee80211_hw *hw, int aci)
                rtl_write_dword(rtlpriv, REG_EDCA_VO_PARAM, 0x2f3222);
                break;
        default:
-               RT_ASSERT(false, "invalid aci: %d !\n", aci);
+               WARN_ONCE(true, "rtl8821ae: invalid aci: %d !\n", aci);
                break;
        }
 }
@@ -2601,11 +2601,10 @@ static u8 _rtl8821ae_get_chnl_group(u8 chnl)
                        group = 12;
        else if (173 <= chnl && chnl <= 177)
                        group = 13;
-               else
-                       /*RT_TRACE(rtlpriv, COMP_EFUSE,DBG_LOUD,
-                               "5G, Channel %d in Group not found\n",chnl);*/
-                       RT_ASSERT(!COMP_EFUSE,
-                               "5G, Channel %d in Group not found\n", chnl);
+       else
+               WARN_ONCE(true,
+                         "rtl8821ae: 5G, Channel %d in Group not found\n",
+                         chnl);
        }
        return group;
 }
@@ -4135,8 +4134,9 @@ void rtl8821ae_add_wowlan_pattern(struct ieee80211_hw *hw,
                        count++;
                } while (tmp && count < 100);
 
-               RT_ASSERT((count < 100),
-                         "Write wake up frame mask FAIL %d value!\n", tmp);
+               WARN_ONCE((count >= 100),
+                         "rtl8821ae: Write wake up frame mask FAIL %d value!\n",
+                         tmp);
        }
        /* Disable Rx packet buffer access. */
        rtl_write_byte(rtlpriv, REG_PKT_BUFF_ACCESS_CTRL,
index 5dad402171c2d363aa2fbacd7f2ee14c122f7a5d..7e2f7b0ae446d751695995b13f462661caf55172 100644 (file)
@@ -1870,8 +1870,8 @@ static u8 _rtl8821ae_get_rate_section_index(u32 regaddr)
        else if (regaddr >= 0xE20 && regaddr <= 0xE4C)
                index = (u8)((regaddr - 0xE20) / 4);
        else
-               RT_ASSERT(!COMP_INIT,
-                         "Invalid RegAddr 0x%x\n", regaddr);
+               WARN_ONCE(true,
+                         "rtl8821ae: Invalid RegAddr 0x%x\n", regaddr);
        return index;
 }
 
@@ -2322,7 +2322,7 @@ static s8 _rtl8821ae_phy_get_ratesection_intxpower_byrate(u8 path, u8 rate)
                rate_section = 11;
                break;
        default:
-               RT_ASSERT(true, "Rate_Section is Illegal\n");
+               WARN_ONCE(true, "rtl8821ae: Rate_Section is Illegal\n");
                break;
        }
 
@@ -2588,7 +2588,7 @@ static s8 _rtl8821ae_phy_get_txpower_by_rate(struct ieee80211_hw *hw,
                shift = 24;
                break;
        default:
-               RT_ASSERT(true, "Rate_Section is Illegal\n");
+               WARN_ONCE(true, "rtl8821ae: Rate_Section is Illegal\n");
                break;
        }
 
index 27727186ba5f0fe07d188bbd48d7055750b531bc..108098152cf3c20f67e4b147c5bdb45759835449 100644 (file)
@@ -904,8 +904,9 @@ void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_TX_DESC_NEXT_DESC_ADDRESS(pdesc, *(u32 *)val);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR txdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8821ae: ERR txdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        } else {
@@ -923,8 +924,9 @@ void rtl8821ae_set_desc(struct ieee80211_hw *hw, u8 *pdesc,
                        SET_RX_DESC_EOR(pdesc, 1);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR rxdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8821ae: ERR rxdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        }
@@ -943,8 +945,9 @@ u32 rtl8821ae_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_TX_DESC_TX_BUFFER_ADDRESS(pdesc);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR txdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8821ae: ERR txdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        } else {
@@ -959,8 +962,9 @@ u32 rtl8821ae_get_desc(u8 *pdesc, bool istx, u8 desc_name)
                        ret = GET_RX_DESC_BUFF_ADDR(pdesc);
                        break;
                default:
-                       RT_ASSERT(false,
-                                 "ERR rxdesc :%d not process\n", desc_name);
+                       WARN_ONCE(true,
+                                 "rtl8821ae: ERR rxdesc :%d not processed\n",
+                                 desc_name);
                        break;
                }
        }
index 0a508649903d73fe4b9a643a5e7e43577abc22c9..1558f541ab15867469069014ca512213cf97f74d 100644 (file)
@@ -1059,7 +1059,7 @@ int rtl_usb_probe(struct usb_interface *intf,
        hw = ieee80211_alloc_hw(sizeof(struct rtl_priv) +
                                sizeof(struct rtl_usb_priv), &rtl_ops);
        if (!hw) {
-               RT_ASSERT(false, "ieee80211 alloc failed\n");
+               WARN_ONCE(true, "rtl_usb: ieee80211 alloc failed\n");
                return -ENOMEM;
        }
        rtlpriv = hw->priv;