Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f4528696 authored by Joe Perches's avatar Joe Perches Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: Fix WL_<type> logging macros



These macros use the equivalent of "#define WL_<type>(x) printk x"
which requires an extra level of parentheses.

Convert the macros to use the normal WL_<type>(fmt, args...) style
and remove the extra parentheses from the uses.

Add format argument verification using no_printk as appropriate.
Couple of spelling typo fixes in the formats and argument alignment
at the same time. Also coalesced long formats.

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 12b9d5bf
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@
#include <wlioctl.h>
#include <wl_iw.h>

#define WL_ERROR(x) printf x
#define WL_TRACE(x)
#define WL_ERROR(fmt, args...) printk(fmt, ##args)
#define WL_TRACE(fmt, args...) no_printk(fmt, ##args)

#ifdef CUSTOMER_HW
extern void bcm_wlan_power_off(int);
@@ -67,13 +67,13 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
#endif

	if (dhd_oob_gpio_num < 0) {
		WL_ERROR(("%s: ERROR customer specific Host GPIO is NOT defined\n",
			__func__));
		WL_ERROR("%s: ERROR customer specific Host GPIO is NOT defined\n",
			 __func__);
		return dhd_oob_gpio_num;
	}

	WL_ERROR(("%s: customer specific Host GPIO number is (%d)\n",
		  __func__, dhd_oob_gpio_num));
	WL_ERROR("%s: customer specific Host GPIO number is (%d)\n",
		 __func__, dhd_oob_gpio_num);

#if defined CUSTOMER_HW
	host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num);
@@ -93,40 +93,40 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)
{
	switch (onoff) {
	case WLAN_RESET_OFF:
		WL_TRACE(("%s: call customer specific GPIO to insert WLAN RESET\n",
			__func__));
		WL_TRACE("%s: call customer specific GPIO to insert WLAN RESET\n",
			 __func__);
#ifdef CUSTOMER_HW
		bcm_wlan_power_off(2);
#endif				/* CUSTOMER_HW */
#ifdef CUSTOMER_HW2
		wifi_set_power(0, 0);
#endif
		WL_ERROR(("=========== WLAN placed in RESET ========\n"));
		WL_ERROR("=========== WLAN placed in RESET ========\n");
		break;

	case WLAN_RESET_ON:
		WL_TRACE(("%s: callc customer specific GPIO to remove WLAN RESET\n",
			__func__));
		WL_TRACE("%s: callc customer specific GPIO to remove WLAN RESET\n",
			 __func__);
#ifdef CUSTOMER_HW
		bcm_wlan_power_on(2);
#endif				/* CUSTOMER_HW */
#ifdef CUSTOMER_HW2
		wifi_set_power(1, 0);
#endif
		WL_ERROR(("=========== WLAN going back to live  ========\n"));
		WL_ERROR("=========== WLAN going back to live  ========\n");
		break;

	case WLAN_POWER_OFF:
		WL_TRACE(("%s: call customer specific GPIO to turn off WL_REG_ON\n",
			__func__));
		WL_TRACE("%s: call customer specific GPIO to turn off WL_REG_ON\n",
			 __func__);
#ifdef CUSTOMER_HW
		bcm_wlan_power_off(1);
#endif				/* CUSTOMER_HW */
		break;

	case WLAN_POWER_ON:
		WL_TRACE(("%s: call customer specific GPIO to turn on WL_REG_ON\n",
			__func__));
		WL_TRACE("%s: call customer specific GPIO to turn on WL_REG_ON\n",
			 __func__);
#ifdef CUSTOMER_HW
		bcm_wlan_power_on(1);
#endif				/* CUSTOMER_HW */
@@ -140,7 +140,7 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)
/* Function to get custom MAC address */
int dhd_custom_get_mac_address(unsigned char *buf)
{
	WL_TRACE(("%s Enter\n", __func__));
	WL_TRACE("%s Enter\n", __func__);
	if (!buf)
		return -EINVAL;

+259 −259

File changed.

Preview size limit exceeded, changes collapsed.

+24 −22
Original line number Diff line number Diff line
@@ -54,34 +54,36 @@ struct wl_ibss;

#define WL_DBG_LEVEL 1		/* 0 invalidates all debug messages.
				 default is 1 */
#define	WL_ERR(args)									\
#define	WL_ERR(fmt, args...)					\
do {								\
	if (wl_dbg_level & WL_DBG_ERR) {			\
		if (net_ratelimit()) {				\
			printk(KERN_ERR "ERROR @%s : ", __func__);	\
			printk args;						\
			printk(KERN_ERR "ERROR @%s : " fmt,	\
			       __func__, ##args);		\
		}						\
	}							\
} while (0)
#define	WL_INFO(args)									\

#define	WL_INFO(fmt, args...)					\
do {								\
	if (wl_dbg_level & WL_DBG_INFO) {			\
		if (net_ratelimit()) {				\
			printk(KERN_ERR "INFO @%s : ", __func__);	\
			printk args;						\
			printk(KERN_ERR "INFO @%s : " fmt,	\
			       __func__, ##args);		\
		}						\
	}							\
} while (0)

#if (WL_DBG_LEVEL > 0)
#define	WL_DBG(args)								\
#define	WL_DBG(fmt, args...)					\
do {								\
	if (wl_dbg_level & WL_DBG_DBG) {			\
		printk(KERN_ERR "DEBUG @%s :", __func__);	\
		printk args;							\
		printk(KERN_ERR "DEBUG @%s :" fmt,		\
		       __func__, ##args);			\
	}							\
} while (0)
#else				/* !(WL_DBG_LEVEL > 0) */
#define	WL_DBG(args)
#define	WL_DBG(fmt, args...) noprintk(fmt, ##args)
#endif				/* (WL_DBG_LEVEL > 0) */

#define WL_SCAN_RETRY_MAX	3	/* used for ibss scan */
+234 −246

File changed.

Preview size limit exceeded, changes collapsed.

+1 −1
Original line number Diff line number Diff line
@@ -78,7 +78,7 @@ typedef struct wl_iw_extra_params {

#define CHECK_EXTRA_FOR_NULL(extra) \
if (!extra) { \
	WL_ERROR(("%s: error : extra is null pointer\n", __func__)); \
	WL_ERROR("%s: error : extra is null pointer\n", __func__);	\
	return -EINVAL; \
}

Loading