]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
staging: rtl8188eu: remove ASSERT and ODM_RT_ASSERT macros
authorPhillip Potter <phil@philpotter.co.uk>
Mon, 24 May 2021 22:45:32 +0000 (23:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 May 2021 16:25:52 +0000 (18:25 +0200)
Remove the ASSERT and ODM_RT_ASSERT macros from include/odm_debug.h
as they are unnecessary.

ASSERT does nothing, compiling to a single empty statement.
ODM_RT_ASSERT is used in only one place, in the ODM_RAStateCheck
function with hal/odm.c - it seems to have been intended as an
assertion of some kind, but given it is always called with false
here, there is little point in it not just being a pr_info() call.

Also, the lines relating to the file, function and line number are
not needed as the pr_info() with the function name and error message
is sufficient should anyone wish to track down this error at a source
level, within what is currently a relatively small function.

Signed-off-by: Phillip Potter <phil@philpotter.co.uk>
Link: https://lore.kernel.org/r/20210524224532.1230-1-phil@philpotter.co.uk
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/rtl8188eu/hal/odm.c
drivers/staging/rtl8188eu/include/odm_debug.h

index 4d659a812aede8afbd8955478af22edfc972a1a5..b800d0c6dff50adfa91ac8dc29d849472252e648 100644 (file)
@@ -824,7 +824,7 @@ bool ODM_RAStateCheck(struct odm_dm_struct *pDM_Odm, s32 RSSI, bool bForceUpdate
                LowRSSIThreshForRA += GoUpGap;
                break;
        default:
-               ODM_RT_ASSERT(pDM_Odm, false, ("wrong rssi level setting %d !", *pRATRState));
+               pr_info("%s(): wrong rssi level setting %d!\n", __func__, *pRATRState);
                break;
        }
 
index 857c64b8d2f4ee7d3e7f04702a9b62ece6fa15e9..3c576a029c945ef265b26db1b855cafe95fde34c 100644 (file)
 #define RT_PRINTK(fmt, args...)                                \
        pr_info("%s(): " fmt, __func__, ## args);
 
-#ifndef ASSERT
-       #define ASSERT(expr)
-#endif
-
 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt)                                \
        if (((comp) & pDM_Odm->DebugComponents) &&                      \
            (level <= pDM_Odm->DebugLevel)) {                           \
                RT_PRINTK fmt;                                          \
        }
 
-#define ODM_RT_ASSERT(pDM_Odm, expr, fmt)                              \
-       if (!(expr)) {                                                  \
-               pr_info("Assertion failed! %s at ......\n", #expr);     \
-               pr_info("      ......%s,%s,line=%d\n", __FILE__,        \
-                       __func__, __LINE__);                            \
-               RT_PRINTK fmt;                                          \
-               ASSERT(false);                                          \
-       }
-
 void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm);
 
 #endif /*  __ODM_DBG_H__ */