Commit 0173ecbf authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: removed asserts from two fullmac files

ASSERTs are non desirable, replaced by error handling where applicable.
Reviewed-by: default avatarFranky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 96c75e48
...@@ -279,12 +279,16 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name, ...@@ -279,12 +279,16 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
bool bool_val; bool bool_val;
u32 actionid; u32 actionid;
ASSERT(name); if (name == NULL || len <= 0)
ASSERT(len >= 0); return -EINVAL;
/* Get must have return space; Set does not take qualifiers */ /* Set does not take qualifiers */
ASSERT(set || (arg && len)); if (set && (params || plen))
ASSERT(!set || (!params && !plen)); return -EINVAL;
/* Get must have return space;*/
if (!set && !(arg && len))
return -EINVAL;
sd_trace(("%s: Enter (%s %s)\n", __func__, (set ? "set" : "get"), sd_trace(("%s: Enter (%s %s)\n", __func__, (set ? "set" : "get"),
name)); name));
...@@ -676,7 +680,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write, ...@@ -676,7 +680,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
sd_trace(("%s: Enter\n", __func__)); sd_trace(("%s: Enter\n", __func__));
ASSERT(pkt);
BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait); BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait);
BRCMF_PM_RESUME_RETURN_ERROR(-EIO); BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
...@@ -687,14 +690,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write, ...@@ -687,14 +690,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
pkt_len += 3; pkt_len += 3;
pkt_len &= 0xFFFFFFFC; pkt_len &= 0xFFFFFFFC;
/* Make sure the packet is aligned properly.
* If it isn't, then this
* is the fault of brcmf_sdioh_request_buffer() which
* is supposed to give
* us something we can work with.
*/
ASSERT(((ulong) (pkt->data) & DMA_ALIGN_MASK) == 0);
if ((write) && (!fifo)) { if ((write) && (!fifo)) {
err_ret = sdio_memcpy_toio(gInstance->func[func], addr, err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
((u8 *) (pnext->data)), ((u8 *) (pnext->data)),
...@@ -789,11 +784,10 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc, ...@@ -789,11 +784,10 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
brcmu_pkt_buf_free_skb(mypkt); brcmu_pkt_buf_free_skb(mypkt);
} else if (((ulong) (pkt->data) & DMA_ALIGN_MASK) != 0) { } else if (((ulong) (pkt->data) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */ /*
* Case 2: We have a packet, but it is unaligned.
/* In this case, we cannot have a chain. */ * In this case, we cannot have a chain (pkt->next == NULL)
ASSERT(pkt->next == NULL); */
sd_data(("%s: Creating aligned %s Packet, len=%d\n", sd_data(("%s: Creating aligned %s Packet, len=%d\n",
__func__, write ? "TX" : "RX", pkt->len)); __func__, write ? "TX" : "RX", pkt->len));
mypkt = brcmu_pkt_buf_get_skb(pkt->len); mypkt = brcmu_pkt_buf_get_skb(pkt->len);
...@@ -886,13 +880,10 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func) ...@@ -886,13 +880,10 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
sd_trace(("brcmf: ***IRQHandler\n")); sd_trace(("brcmf: ***IRQHandler\n"));
sd = gInstance->sd; sd = gInstance->sd;
ASSERT(sd != NULL);
sdio_release_host(gInstance->func[0]); sdio_release_host(gInstance->func[0]);
if (sd->use_client_ints) { if (sd->use_client_ints) {
sd->intrcount++; sd->intrcount++;
ASSERT(sd->intr_handler);
ASSERT(sd->intr_handler_arg);
(sd->intr_handler) (sd->intr_handler_arg); (sd->intr_handler) (sd->intr_handler_arg);
} else { } else {
sd_err(("brcmf: ***IRQHandler\n")); sd_err(("brcmf: ***IRQHandler\n"));
...@@ -912,6 +903,4 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func) ...@@ -912,6 +903,4 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
sd_trace(("brcmf: ***IRQHandlerF2\n")); sd_trace(("brcmf: ***IRQHandlerF2\n"));
sd = gInstance->sd; sd = gInstance->sd;
ASSERT(sd != NULL);
} }
...@@ -194,7 +194,6 @@ int brcmf_sdioh_osinit(struct sdioh_info *sd) ...@@ -194,7 +194,6 @@ int brcmf_sdioh_osinit(struct sdioh_info *sd)
void brcmf_sdioh_osfree(struct sdioh_info *sd) void brcmf_sdioh_osfree(struct sdioh_info *sd)
{ {
struct sdos_info *sdos; struct sdos_info *sdos;
ASSERT(sd && sd->sdos_info);
sdos = (struct sdos_info *)sd->sdos_info; sdos = (struct sdos_info *)sd->sdos_info;
kfree(sdos); kfree(sdos);
...@@ -209,7 +208,6 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable) ...@@ -209,7 +208,6 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
sd_trace(("%s: %s\n", __func__, enable ? "Enabling" : "Disabling")); sd_trace(("%s: %s\n", __func__, enable ? "Enabling" : "Disabling"));
sdos = (struct sdos_info *)sd->sdos_info; sdos = (struct sdos_info *)sd->sdos_info;
ASSERT(sdos);
if (enable && !(sd->intr_handler && sd->intr_handler_arg)) { if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
sd_err(("%s: no handler registered, will not enable\n", sd_err(("%s: no handler registered, will not enable\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment