You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2018/09/21 23:30:45 UTC
[mynewt-core] branch master updated: drivers/bq27z561: remove
assert in driver (#1413)
This is an automated email from the ASF dual-hosted git repository.
vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 3225dce drivers/bq27z561: remove assert in driver (#1413)
3225dce is described below
commit 3225dcea96e6fccb49f2f386c91af894497cb5db
Author: Vipul Rahane <vr...@gmail.com>
AuthorDate: Fri Sep 21 16:30:41 2018 -0700
drivers/bq27z561: remove assert in driver (#1413)
- Remove assert in code and just return return codes
---
hw/drivers/bq27z561/src/bq27z561.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/hw/drivers/bq27z561/src/bq27z561.c b/hw/drivers/bq27z561/src/bq27z561.c
index 28bd0a2..d65ee24 100644
--- a/hw/drivers/bq27z561/src/bq27z561.c
+++ b/hw/drivers/bq27z561/src/bq27z561.c
@@ -17,7 +17,6 @@
* under the License.
*/
-#include <assert.h>
#include <math.h>
#include <string.h>
@@ -1079,7 +1078,7 @@ bq27z561_battery_property_get(struct battery_driver *driver,
property->bp_value.bpv_temperature = val.bpv_i8;
} else {
rc = -1;
- assert(0);
+ return rc;
}
if (rc == 0) {
property->bp_valid = 1;
@@ -1138,7 +1137,6 @@ bq27z561_battery_property_set(struct battery_driver *driver,
(int16_t)property->bp_value.bpv_temperature);
} else {
rc = -1;
- assert(0);
}
return rc;
}