diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-24 14:31:26 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2008-09-24 14:31:26 +0000 |
commit | cd784cb75decf65b8a8802798dce25c2eb51d968 (patch) | |
tree | 2c7c2019407e0de19c656c0497adce31efc54c27 /cpukit | |
parent | 2008-09-24 Ralf Corsépius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-cd784cb75decf65b8a8802798dce25c2eb51d968.tar.bz2 |
2008-09-24 Joel Sherrill <joel.sherrill@OARcorp.com>
PR 1326/cpukit
* libi2c/libi2c.c: Use int for return value when negative values
possible.
Diffstat (limited to 'cpukit')
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/libi2c/libi2c.c | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index bca3863097..9b55f7dc35 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2008-09-24 Joel Sherrill <joel.sherrill@OARcorp.com> + + PR 1326/cpukit + * libi2c/libi2c.c: Use int for return value when negative values + possible. + 2008-09-24 Ralf Corsépius <ralf.corsepius@rtems.org> * libnetworking/lib/ftpfs.c: Use ssize_t for read retval (Fix diff --git a/cpukit/libi2c/libi2c.c b/cpukit/libi2c/libi2c.c index db0a4fc121..64272ef5ae 100644 --- a/cpukit/libi2c/libi2c.c +++ b/cpukit/libi2c/libi2c.c @@ -542,7 +542,7 @@ rtems_libi2c_read_bytes (rtems_device_minor_number minor, int sc; DECL_CHECKED_BH (busno, bush, minor, -) - if (not_started (busno)) + if (not_started (busno)) return -RTEMS_NOT_OWNER_OF_RESOURCE; sc = bush->ops->read_bytes (bush, bytes, nbytes); @@ -559,7 +559,7 @@ rtems_libi2c_write_bytes (rtems_device_minor_number minor, int sc; DECL_CHECKED_BH (busno, bush, minor, -) - if (not_started (busno)) + if (not_started (busno)) return -RTEMS_NOT_OWNER_OF_RESOURCE; sc = bush->ops->write_bytes (bush, (unsigned char *)bytes, nbytes); @@ -643,8 +643,9 @@ do_s_rw (rtems_device_minor_number minor, int nbytes, int rw) { - rtems_status_code sc; + rtems_status_code sc; rtems_libi2c_bus_t *bush; + int status; if ((sc = rtems_libi2c_send_start (minor))) return -sc; @@ -658,14 +659,14 @@ do_s_rw (rtems_device_minor_number minor, } if (rw) - sc = bush->ops->read_bytes (bush, bytes, nbytes); + status = bush->ops->read_bytes (bush, bytes, nbytes); else - sc = bush->ops->write_bytes (bush, bytes, nbytes); + status = bush->ops->write_bytes (bush, bytes, nbytes); - if (sc < 0) { + if (status < 0) { rtems_libi2c_send_stop (minor); } - return sc; + return status; } int |