staging: r8188eu: remove RT_PRINT_DATA macro
authorPhillip Potter <phil@philpotter.co.uk>
Sat, 31 Jul 2021 23:56:48 +0000 (00:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 1 Aug 2021 06:11:00 +0000 (08:11 +0200)
Remove RT_PRINT_DATA definition from include/rtw_debug.h, and its
two calling statements in hal/hal_com.c, as this code was not written
with best practices in mind and is safer to simply remove.

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

index 66a2f3d..91d5182 100644 (file)
@@ -339,18 +339,11 @@ s32 c2h_evt_read(struct adapter *adapter, u8 *buf)
        *buf = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL);
        *(buf+1) = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL + 1);
 
-       RT_PRINT_DATA(_module_hal_init_c_, _drv_info_, "c2h_evt_read(): ",
-                     &c2h_evt, sizeof(c2h_evt));
-
        /* Read the content */
        for (i = 0; i < c2h_evt->plen; i++)
                c2h_evt->payload[i] = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL +
                                                sizeof(*c2h_evt) + i);
 
-       RT_PRINT_DATA(_module_hal_init_c_, _drv_info_,
-                     "c2h_evt_read(): Command Content:\n",
-                     c2h_evt->payload, c2h_evt->plen);
-
        ret = _SUCCESS;
 
 clear_evt:
index 56af075..83c7127 100644 (file)
@@ -81,24 +81,6 @@ extern u32 GlobalDebugLevel;
                }                                                       \
        } while (0)
 
-#define RT_PRINT_DATA(_comp, _level, _titlestring, _hexdata, _hexdatalen)\
-       do {                                                            \
-               if (_level <= GlobalDebugLevel) {                       \
-                       int __i;                                        \
-                       u8      *ptr = (u8 *)_hexdata;                  \
-                       pr_info("%s", DRIVER_PREFIX);                   \
-                       pr_info(_titlestring);                          \
-                       for (__i = 0; __i < (int)_hexdatalen; __i++ ) { \
-                               pr_info("%02X%s", ptr[__i],             \
-                                        (((__i + 1) % 4) == 0) ?       \
-                                        "  " : " ");   \
-                               if (((__i + 1) % 16) == 0)              \
-                                       printk("\n");                   \
-                       }                                               \
-                       printk("\n");                                   \
-               }                                                       \
-       } while (0)
-
 int proc_get_drv_version(char *page, char **start,
                         off_t offset, int count,
                         int *eof, void *data);