[rtems commit] libchip: Add asserts to dwmac driver
Sebastian Huber
sebh at rtems.org
Wed Apr 30 12:46:07 UTC 2014
Module: rtems
Branch: master
Commit: b0e83e1207ea626242df3516f164cbb86e5bb047
Changeset: http://git.rtems.org/rtems/commit/?id=b0e83e1207ea626242df3516f164cbb86e5bb047
Author: Ralf Kirchner <ralf.kirchner at embedded-brains.de>
Date: Wed Apr 30 10:13:07 2014 +0200
libchip: Add asserts to dwmac driver
---
c/src/libchip/network/dwmac.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/c/src/libchip/network/dwmac.c b/c/src/libchip/network/dwmac.c
index 0e2d149..20d87dc 100644
--- a/c/src/libchip/network/dwmac.c
+++ b/c/src/libchip/network/dwmac.c
@@ -2024,6 +2024,7 @@ static int dwmac_if_clk_csr_set(
&& ( gmii_clk_rate < DWCGNAC3504_CSR_F_300M ) ) {
self->csr_clock = DWCGNAC3504_CSR_250_300M;
} else {
+ assert( gmii_clk_rate < DWCGNAC3504_CSR_F_300M );
eno = EINVAL;
}
@@ -2111,9 +2112,11 @@ static int dwmac_if_attach(
if ( eno == 0 ) {
self->dma_threshold_control = DWMAC_DMA_THRESHOLD_CONTROL_DEFAULT;
+ assert( driver_config->addr_gmac_regs != NULL );
if ( driver_config->addr_gmac_regs != NULL ) {
self->macgrp = driver_config->addr_gmac_regs;
+ assert( driver_config->addr_dma_regs != NULL );
if ( driver_config->addr_dma_regs != NULL ) {
self->dmagrp = driver_config->addr_dma_regs;
} else {
More information about the vc
mailing list