From cd784cb75decf65b8a8802798dce25c2eb51d968 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Wed, 24 Sep 2008 14:31:26 +0000 Subject: 2008-09-24 Joel Sherrill PR 1326/cpukit * libi2c/libi2c.c: Use int for return value when negative values possible. --- cpukit/libi2c/libi2c.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'cpukit/libi2c') 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