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

Commit 0bef7748 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman
Browse files

staging: brcm80211: remove usage of printf (macro) from driver



The driver contained several calls to printf which was mapped
to printk using a macro. These have been changed to explicit
call to printk or use an appropropriate macro.

Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Reviewed-by: default avatarHenry Ptasinski <henryp@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9d2c4156
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -114,7 +114,7 @@ bool bcmsdh_chipmatch(u16 vendor, u16 device)
#ifdef BCMSDIOH_SPI
	/* This is the PciSpiHost. */
	if (device == SPIH_FPGA_ID && vendor == VENDOR_BROADCOM) {
		printf("Found PCI SPI Host Controller\n");
		WL_NONE("Found PCI SPI Host Controller\n");
		return true;
	}
#endif				/* BCMSDIOH_SPI */
+30 −6
Original line number Diff line number Diff line
@@ -18,12 +18,36 @@
#define __BCMSDH_SDMMC_H__

#ifdef BCMDBG
#define sd_err(x)	do { if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) printf x; } while (0)
#define sd_trace(x)	do { if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) printf x; } while (0)
#define sd_info(x)	do { if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) printf x; } while (0)
#define sd_debug(x)	do { if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) printf x; } while (0)
#define sd_data(x)	do { if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) printf x; } while (0)
#define sd_ctrl(x)	do { if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) printf x; } while (0)
#define sd_err(x)	\
	do { \
		if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \
			printk x; \
	} while (0)
#define sd_trace(x)	\
	do { \
		if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \
			printk x; \
	} while (0)
#define sd_info(x)	\
	do { \
		if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \
			printk x; \
	} while (0)
#define sd_debug(x)	\
	do { \
		if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \
			printk x; \
	} while (0)
#define sd_data(x)	\
	do { \
		if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \
			printk x; \
	} while (0)
#define sd_ctrl(x)	\
	do { \
		if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \
			printk x; \
	} while (0)
#else
#define sd_err(x)
#define sd_trace(x)
+9 −8
Original line number Diff line number Diff line
@@ -739,10 +739,11 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
			memcpy(&hdr, buf, MSGTRACE_HDRLEN);

			if (hdr.version != MSGTRACE_VERSION) {
				printf
				DHD_ERROR(
				    ("\nMACEVENT: %s [unsupported version --> "
				     "dhd version:%d dongle version:%d]\n",
				     event_name, MSGTRACE_VERSION, hdr.version);
				     event_name, MSGTRACE_VERSION, hdr.version)
				);
				/* Reset datalen to avoid display below */
				datalen = 0;
				break;
@@ -753,18 +754,18 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)

			if (ntoh32(hdr.discarded_bytes)
			    || ntoh32(hdr.discarded_printf)) {
				printf
				DHD_ERROR(
				    ("\nWLC_E_TRACE: [Discarded traces in dongle -->"
				     "discarded_bytes %d discarded_printf %d]\n",
				     ntoh32(hdr.discarded_bytes),
				     ntoh32(hdr.discarded_printf));
				     ntoh32(hdr.discarded_printf)));
			}

			nblost = ntoh32(hdr.seqnum) - seqnum_prev - 1;
			if (nblost > 0) {
				printf
				DHD_ERROR(
				    ("\nWLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n",
				     ntoh32(hdr.seqnum), nblost);
				     ntoh32(hdr.seqnum), nblost));
			}
			seqnum_prev = ntoh32(hdr.seqnum);

@@ -775,10 +776,10 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
			p = (char *)&buf[MSGTRACE_HDRLEN];
			while ((s = strstr(p, "\n")) != NULL) {
				*s = '\0';
				printf("%s\n", p);
				printk(KERN_DEBUG"%s\n", p);
				p = s + 1;
			}
			printf("%s\n", p);
			printk(KERN_DEBUG "%s\n", p);

			/* Reset datalen to avoid display below */
			datalen = 0;
+14 −14
Original line number Diff line number Diff line
@@ -21,31 +21,31 @@

#define DHD_ERROR(args)	       \
	do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
		printf args; } while (0)
		printk args; } while (0)
#define DHD_TRACE(args)		do {if (dhd_msg_level & DHD_TRACE_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_INFO(args)		do {if (dhd_msg_level & DHD_INFO_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_DATA(args)		do {if (dhd_msg_level & DHD_DATA_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_CTL(args)		do {if (dhd_msg_level & DHD_CTL_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_TIMER(args)		do {if (dhd_msg_level & DHD_TIMER_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_HDRS(args)		do {if (dhd_msg_level & DHD_HDRS_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_BYTES(args)		do {if (dhd_msg_level & DHD_BYTES_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_INTR(args)		do {if (dhd_msg_level & DHD_INTR_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_GLOM(args)		do {if (dhd_msg_level & DHD_GLOM_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_EVENT(args)		do {if (dhd_msg_level & DHD_EVENT_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_BTA(args)		do {if (dhd_msg_level & DHD_BTA_VAL)	\
					printf args; } while (0)
					printk args; } while (0)
#define DHD_ISCAN(args)		do {if (dhd_msg_level & DHD_ISCAN_VAL)	\
					printf args; } while (0)
					printk args; } while (0)

#define DHD_ERROR_ON()		(dhd_msg_level & DHD_ERROR_VAL)
#define DHD_TRACE_ON()		(dhd_msg_level & DHD_TRACE_VAL)
@@ -63,7 +63,7 @@

#else	/* (defined BCMDBG) || (defined DHD_DEBUG) */

#define DHD_ERROR(args)  do {if (net_ratelimit()) printf args; } while (0)
#define DHD_ERROR(args)  do {if (net_ratelimit()) printk args; } while (0)
#define DHD_TRACE(args)
#define DHD_INFO(args)
#define DHD_DATA(args)
+2 −2
Original line number Diff line number Diff line
@@ -2299,7 +2299,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
		goto fail;
	}

	printf("%s: Broadcom Dongle Host Driver\n", net->name);
	DHD_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));

	return 0;

@@ -2934,7 +2934,7 @@ int write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
	/* open file to write */
	fp = filp_open("/tmp/mem_dump", O_WRONLY | O_CREAT, 0640);
	if (!fp) {
		printf("%s: open file error\n", __func__);
		DHD_ERROR(("%s: open file error\n", __func__));
		ret = -1;
		goto exit;
	}
Loading