You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2020/09/18 14:03:18 UTC

[incubator-nuttx] 01/02: Fix build errors when using DEBUGASSERT

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 1efbb4c114880a6ffa2181f9a326389ae282da42
Author: Augusto Fraga Giachero <au...@gmail.com>
AuthorDate: Thu Sep 17 15:54:37 2020 -0300

    Fix build errors when using DEBUGASSERT
    
    I never tested these drivers with debug assertions enabled as I should
    have. This commit fixes build errors due to wrong variable names used.
---
 drivers/analog/dac7554.c | 4 ++--
 drivers/rf/dat-31r5-sp.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/analog/dac7554.c b/drivers/analog/dac7554.c
index eab701b..4e0fdab 100644
--- a/drivers/analog/dac7554.c
+++ b/drivers/analog/dac7554.c
@@ -199,7 +199,7 @@ static int dac7554_send(FAR struct dac_dev_s *dev, FAR struct dac_msg_s *msg)
 
   /* Sanity check */
 
-  DEBUGASSERT(priv->SPI != NULL);
+  DEBUGASSERT(priv->spi != NULL);
 
   /* Set up message to send */
 
@@ -261,7 +261,7 @@ FAR struct dac_dev_s *dac7554_initialize(FAR struct spi_dev_s *spi,
 
   /* Sanity check */
 
-  DEBUGASSERT(i2c != NULL);
+  DEBUGASSERT(spi != NULL);
 
   /* Initialize the DAC7554 device structure */
 
diff --git a/drivers/rf/dat-31r5-sp.c b/drivers/rf/dat-31r5-sp.c
index bc31b77..fe84b20 100644
--- a/drivers/rf/dat-31r5-sp.c
+++ b/drivers/rf/dat-31r5-sp.c
@@ -230,7 +230,7 @@ static int dat31r5sp_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
         {
           FAR struct attenuator_control *att =
             (FAR struct attenuator_control *)((uintptr_t)arg);
-          DEBUGASSERT(ptr != NULL);
+          DEBUGASSERT(att != NULL);
           dat31r5sp_set_attenuation(priv, att->attenuation);
         }
         break;