Commit 531940f9 authored by Larry Finger's avatar Larry Finger Committed by Kalle Valo
Browse files

rtlwifi: Replace local debug macro RT_ASSERT



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: default avatarLarry Finger <Larry.Finger@lwfinger.net>
Cc: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c7d1c777
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -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;
			}
		}
+0 −14
Original line number Diff line number Diff line
@@ -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,
+6 −6
Original line number Diff line number Diff line
@@ -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;
	}
+2 −2
Original line number Diff line number Diff line
@@ -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;
	}

+1 −1
Original line number Diff line number Diff line
@@ -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;
	}
}
Loading