From a9546aaf528e2162f393396aa74a8059425d4a0e Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 24 Sep 2008 14:31:37 +0000 Subject: 2008-09-24 Joel Sherrill PR 1326/cpukit * libi2c/libi2c.c: Use int for return value when negative values possible. --- cpukit/ChangeLog | 6 ++++++ cpukit/libi2c/libi2c.c | 15 ++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index f6851caec1..215784e936 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2008-09-24 Joel Sherrill + + PR 1326/cpukit + * libi2c/libi2c.c: Use int for return value when negative values + possible. + 2008-09-24 Ralf Corsépius * 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 -- cgit v1.2.3