Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: rtl8188eu: remove ASSERT and ODM_RT_ASSERT macros

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>

authored by

Phillip Potter and committed by
Greg Kroah-Hartman
a75d6a32 85487bd7

+1 -14
+1 -1
drivers/staging/rtl8188eu/hal/odm.c
··· 824 824 LowRSSIThreshForRA += GoUpGap; 825 825 break; 826 826 default: 827 - ODM_RT_ASSERT(pDM_Odm, false, ("wrong rssi level setting %d !", *pRATRState)); 827 + pr_info("%s(): wrong rssi level setting %d!\n", __func__, *pRATRState); 828 828 break; 829 829 } 830 830
-13
drivers/staging/rtl8188eu/include/odm_debug.h
··· 71 71 #define RT_PRINTK(fmt, args...) \ 72 72 pr_info("%s(): " fmt, __func__, ## args); 73 73 74 - #ifndef ASSERT 75 - #define ASSERT(expr) 76 - #endif 77 - 78 74 #define ODM_RT_TRACE(pDM_Odm, comp, level, fmt) \ 79 75 if (((comp) & pDM_Odm->DebugComponents) && \ 80 76 (level <= pDM_Odm->DebugLevel)) { \ 81 77 pr_info("[ODM-8188E] "); \ 82 78 RT_PRINTK fmt; \ 83 - } 84 - 85 - #define ODM_RT_ASSERT(pDM_Odm, expr, fmt) \ 86 - if (!(expr)) { \ 87 - pr_info("Assertion failed! %s at ......\n", #expr); \ 88 - pr_info(" ......%s,%s,line=%d\n", __FILE__, \ 89 - __func__, __LINE__); \ 90 - RT_PRINTK fmt; \ 91 - ASSERT(false); \ 92 79 } 93 80 94 81 void ODM_InitDebugSetting(struct odm_dm_struct *pDM_Odm);