summaryrefslogtreecommitdiffstats
path: root/cpukit/rtems
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-18 16:17:03 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-18 16:17:03 +0000
commitc1d924daa7fed91799e84cbad3b3018a489d82db (patch)
treee04eff2f56eea1a3ba5b92310f7655f7bd70565e /cpukit/rtems
parent2009-06-18 Chris Johns <chrisj@rtems.org> (diff)
downloadrtems-c1d924daa7fed91799e84cbad3b3018a489d82db.tar.bz2
2009-06-18 Joel Sherrill <joel.sherrill@OARcorp.com>
* rtems/src/regionextend.c: Restructure to eliminate dead code being generated.
Diffstat (limited to 'cpukit/rtems')
-rw-r--r--cpukit/rtems/src/regionextend.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/cpukit/rtems/src/regionextend.c b/cpukit/rtems/src/regionextend.c
index 7f29109e61..112641bc80 100644
--- a/cpukit/rtems/src/regionextend.c
+++ b/cpukit/rtems/src/regionextend.c
@@ -1,8 +1,7 @@
/*
- * Region Manager
+ * Region Manager - Extend (add memory to) a Region
*
- *
- * COPYRIGHT (c) 1989-2007.
+ * COPYRIGHT (c) 1989-2009.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -52,7 +51,7 @@ rtems_status_code rtems_region_extend(
intptr_t amount_extended;
Heap_Extend_status heap_status;
Objects_Locations location;
- rtems_status_code return_status = RTEMS_INTERNAL_ERROR;
+ rtems_status_code return_status;
Region_Control *the_region;
if ( !starting_address )
@@ -72,18 +71,14 @@ rtems_status_code rtems_region_extend(
&amount_extended
);
- switch ( heap_status ) {
- case HEAP_EXTEND_SUCCESSFUL:
- the_region->length += amount_extended;
- the_region->maximum_segment_size += amount_extended;
- return_status = RTEMS_SUCCESSFUL;
- break;
- case HEAP_EXTEND_ERROR:
- return_status = RTEMS_INVALID_ADDRESS;
- break;
- case HEAP_EXTEND_NOT_IMPLEMENTED:
- return_status = RTEMS_NOT_IMPLEMENTED;
- break;
+ if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) {
+ the_region->length += amount_extended;
+ the_region->maximum_segment_size += amount_extended;
+ return_status = RTEMS_SUCCESSFUL;
+ } else if ( heap_status == HEAP_EXTEND_ERROR ) {
+ return_status = RTEMS_INVALID_ADDRESS;
+ } else if ( heap_status == HEAP_EXTEND_NOT_IMPLEMENTED ) {
+ return_status = RTEMS_NOT_IMPLEMENTED;
}
break;
@@ -93,6 +88,7 @@ rtems_status_code rtems_region_extend(
#endif
case OBJECTS_ERROR:
+ default:
return_status = RTEMS_INVALID_ID;
break;
}