[PATCH 1/3] staging: brcm80211: Use proper BRCM_FULLMAC #ifdefs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Make it obvious that DHD_USE_STATIC_BUF is only used as part of FULLMAC build

Signed-off-by: Brett Rudley <brudley@xxxxxxxxxxxx>
---
 drivers/staging/brcm80211/util/linux_osl.c |   30 +++++++++++++++------------
 1 files changed, 17 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/brcm80211/util/linux_osl.c b/drivers/staging/brcm80211/util/linux_osl.c
index 4055f7e..6055790 100644
--- a/drivers/staging/brcm80211/util/linux_osl.c
+++ b/drivers/staging/brcm80211/util/linux_osl.c
@@ -33,7 +33,7 @@
 #define OS_HANDLE_MAGIC		0x1234abcd	/* Magic # to recognise osh */
 #define BCM_MEM_FILENAME_LEN 	24	/* Mem. filename length */
 
-#ifdef DHD_USE_STATIC_BUF
+#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
 #define MAX_STATIC_BUF_NUM 16
 #define STATIC_BUF_SIZE	(PAGE_SIZE*2)
 #define STATIC_BUF_TOTAL_LEN (MAX_STATIC_BUF_NUM*STATIC_BUF_SIZE)
@@ -75,6 +75,7 @@ struct osl_info {
 /* Global ASSERT type flag */
 uint32 g_assert_type;
 
+#ifdef BRCM_FULLMAC
 static s16 linuxbcmerrormap[] = { 0,	/* 0 */
 	-EINVAL,		/* BCME_ERROR */
 	-EINVAL,		/* BCME_BADARG */
@@ -140,6 +141,7 @@ int osl_error(int bcmerror)
 	/* Array bounds covered by ASSERT in osl_attach */
 	return linuxbcmerrormap[-bcmerror];
 }
+#endif /* BRCM_FULLMAC */
 
 osl_t *osl_attach(void *pdev, uint bustype, bool pkttag)
 {
@@ -150,8 +152,10 @@ osl_t *osl_attach(void *pdev, uint bustype, bool pkttag)
 
 	bzero(osh, sizeof(osl_t));
 
+#ifdef BRCM_FULLMAC
 	/* Check that error map has the right number of entries in it */
 	ASSERT(ABS(BCME_LAST) == (ARRAYSIZE(linuxbcmerrormap) - 1));
+#endif /* BRCM_FULLMAC */
 
 	osh->magic = OS_HANDLE_MAGIC;
 	osh->malloced = 0;
@@ -179,8 +183,7 @@ osl_t *osl_attach(void *pdev, uint bustype, bool pkttag)
 		break;
 	}
 
-#ifdef DHD_USE_STATIC_BUF
-
+#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
 	if (!bcm_static_buf) {
 		if (!(bcm_static_buf =
 		     (bcm_static_buf_t *) dhd_os_prealloc(3,
@@ -211,7 +214,8 @@ osl_t *osl_attach(void *pdev, uint bustype, bool pkttag)
 
 		init_MUTEX(&bcm_static_skb->osl_pkt_sem);
 	}
-#endif				/* DHD_USE_STATIC_BUF */
+#endif /* defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF) */
+
 #if defined(BCMDBG) && !defined(BRCM_FULLMAC)
 	if (pkttag) {
 		struct sk_buff *skb;
@@ -226,7 +230,7 @@ void osl_detach(osl_t *osh)
 	if (osh == NULL)
 		return;
 
-#ifdef DHD_USE_STATIC_BUF
+#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
 	if (bcm_static_buf)
 		bcm_static_buf = 0;
 
@@ -287,7 +291,7 @@ void BCMFASTPATH osl_pktfree(osl_t *osh, void *p, bool send)
 	}
 }
 
-#ifdef DHD_USE_STATIC_BUF
+#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
 void *osl_pktget_static(osl_t *osh, uint len)
 {
 	int i = 0;
@@ -352,7 +356,8 @@ void osl_pktfree_static(osl_t *osh, void *p, bool send)
 	}
 	return osl_pktfree(osh, p, send);
 }
-#endif				/* DHD_USE_STATIC_BUF */
+#endif /* defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF) */
+
 uint32 osl_pci_read_config(osl_t *osh, uint offset, uint size)
 {
 	uint val = 0;
@@ -441,7 +446,7 @@ void *osl_malloc(osl_t *osh, uint size)
 	if (osh)
 		ASSERT(osh->magic == OS_HANDLE_MAGIC);
 
-#ifdef DHD_USE_STATIC_BUF
+#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
 		if (bcm_static_buf) {
 			int i = 0;
 			if ((size >= PAGE_SIZE) && (size <= STATIC_BUF_SIZE)) {
@@ -468,7 +473,7 @@ void *osl_malloc(osl_t *osh, uint size)
 			}
 		}
 	original:
-#endif				/* DHD_USE_STATIC_BUF */
+#endif /* defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF) */
 
 	addr = kmalloc(size, GFP_ATOMIC);
 	if (addr == NULL) {
@@ -484,7 +489,7 @@ void *osl_malloc(osl_t *osh, uint size)
 
 void osl_mfree(osl_t *osh, void *addr, uint size)
 {
-#ifdef DHD_USE_STATIC_BUF
+#if defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF)
 	if (bcm_static_buf) {
 		if ((addr > (void *)bcm_static_buf) && ((unsigned char *)addr
 				<= ((unsigned char *)
@@ -505,7 +510,7 @@ void osl_mfree(osl_t *osh, void *addr, uint size)
 			return;
 		}
 	}
-#endif				/* DHD_USE_STATIC_BUF */
+#endif /* defined(BRCM_FULLMAC) && defined(DHD_USE_STATIC_BUF) */
 	if (osh) {
 		ASSERT(osh->magic == OS_HANDLE_MAGIC);
 		osh->malloced -= size;
@@ -703,5 +708,4 @@ void osl_writel(osl_t *osh, volatile uint32 *r, uint32 v)
 
 	((wreg) (ctx, (void *)r, v, sizeof(uint32)));
 }
-#endif				/* BCMSDIO */
-/* Linux Kernel: File Operations: end */
+#endif	/* BCMSDIO */
-- 
1.6.3.3


_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux