Changeset 58a8a47 in rtems


Ignore:
Timestamp:
Oct 10, 2009, 3:15:12 PM (10 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, master
Children:
2f95352c
Parents:
1c78f6a
Message:

2009-10-10 Joel Sherrill <joel.sherrill@…>

  • rtems/src/regiondelete.c, rtems/src/regionextend.c, rtems/src/regiongetfreeinfo.c, rtems/src/regiongetinfo.c, rtems/src/regiongetsegment.c, rtems/src/regionresizesegment.c, rtems/src/regionreturnsegment.c: Avoid initializing status code. This generates dead code on some targets. Add default case to eliminate unitialized variable warning.
Location:
cpukit
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    r1c78f6a r58a8a47  
     12009-10-10      Joel Sherrill <joel.sherrill@oarcorp.com>
     2
     3        * rtems/src/regiondelete.c, rtems/src/regionextend.c,
     4        rtems/src/regiongetfreeinfo.c, rtems/src/regiongetinfo.c,
     5        rtems/src/regiongetsegment.c, rtems/src/regionresizesegment.c,
     6        rtems/src/regionreturnsegment.c: Avoid initializing status code. This
     7        generates dead code on some targets. Add default case to eliminate
     8        unitialized variable warning.
     9
    1102009-10-09      Sebastian Huber <Sebastian.Huber@embedded-brains.de>
    211
  • cpukit/rtems/src/regiondelete.c

    r1c78f6a r58a8a47  
    4747)
    4848{
    49   Objects_Locations        location;
    50   rtems_status_code        return_status = RTEMS_SUCCESSFUL;
    51   register Region_Control *the_region;
     49  Objects_Locations   location;
     50  rtems_status_code   return_status;
     51  Region_Control    *the_region;
    5252
    5353  _RTEMS_Lock_allocator();
     
    6363          _Objects_Close( &_Region_Information, &the_region->Object );
    6464          _Region_Free( the_region );
     65          return_status = RTEMS_SUCCESSFUL;
    6566        }
    6667        break;
     
    7273
    7374      case OBJECTS_ERROR:
     75      default:
    7476        return_status = RTEMS_INVALID_ID;
    7577        break;
  • cpukit/rtems/src/regionextend.c

    r1c78f6a r58a8a47  
    5858    return RTEMS_INVALID_ADDRESS;
    5959
    60   return_status = RTEMS_SUCCESSFUL;
    61 
    6260  _RTEMS_Lock_allocator();                      /* to prevent deletion */
    6361
     
    7775          the_region->length                += amount_extended;
    7876          the_region->maximum_segment_size  += amount_extended;
     77          return_status = RTEMS_SUCCESSFUL;
    7978        } else if ( heap_status == HEAP_EXTEND_ERROR ) {
    8079          return_status = RTEMS_INVALID_ADDRESS;
  • cpukit/rtems/src/regiongetfreeinfo.c

    r1c78f6a r58a8a47  
    5151{
    5252  Objects_Locations        location;
    53   rtems_status_code        return_status = RTEMS_SUCCESSFUL;
     53  rtems_status_code        return_status;
    5454  register Region_Control *the_region;
    5555
     
    7979
    8080      case OBJECTS_ERROR:
     81      default:
    8182        return_status = RTEMS_INVALID_ID;
    8283        break;
  • cpukit/rtems/src/regiongetinfo.c

    r1c78f6a r58a8a47  
    4949{
    5050  Objects_Locations        location;
    51   rtems_status_code        return_status = RTEMS_SUCCESSFUL;
     51  rtems_status_code        return_status;
    5252  register Region_Control *the_region;
    5353
     
    6262      case OBJECTS_LOCAL:
    6363        _Heap_Get_information( &the_region->Memory, the_info );
     64        return_status = RTEMS_SUCCESSFUL;
    6465        break;
    6566
     
    7071
    7172      case OBJECTS_ERROR:
     73      default:
    7274        return_status = RTEMS_INVALID_ID;
    7375        break;
  • cpukit/rtems/src/regiongetsegment.c

    r1c78f6a r58a8a47  
    5454)
    5555{
    56   Thread_Control          *executing;
    57   Objects_Locations        location;
    58   rtems_status_code        return_status = RTEMS_SUCCESSFUL;
    59   register Region_Control *the_region;
    60   void                    *the_segment;
     56  Thread_Control     *executing;
     57  Objects_Locations   location;
     58  rtems_status_code   return_status;
     59  Region_Control    *the_region;
     60  void               *the_segment;
    6161
    6262  if ( !segment )
     
    8888            the_region->number_of_used_blocks += 1;
    8989            *segment = the_segment;
    90           }
    91 
    92           else if ( _Options_Is_no_wait( option_set ) ) {
     90            return_status = RTEMS_SUCCESSFUL;
     91          } else if ( _Options_Is_no_wait( option_set ) ) {
    9392            return_status = RTEMS_UNSATISFIED;
    94           }
    95 
    96           else {
     93          } else {
    9794            /*
    9895             *  Switch from using the memory allocation mutex to using a
     
    125122
    126123      case OBJECTS_ERROR:
     124      default:
    127125        return_status = RTEMS_INVALID_ID;
    128126        break;
  • cpukit/rtems/src/regionresizesegment.c

    r1c78f6a r58a8a47  
    5454  Objects_Locations        location;
    5555  uintptr_t                osize;
    56   rtems_status_code        return_status = RTEMS_SUCCESSFUL;
     56  rtems_status_code        return_status;
    5757  Heap_Resize_status       status;
    5858  register Region_Control *the_region;
     
    8686          _RTEMS_Unlock_allocator();
    8787
    88         return
    89           (status == HEAP_RESIZE_SUCCESSFUL) ?  RTEMS_SUCCESSFUL :
    90           (status == HEAP_RESIZE_UNSATISFIED) ? RTEMS_UNSATISFIED :
    91           RTEMS_INVALID_ADDRESS;
     88
     89        if (status == HEAP_RESIZE_SUCCESSFUL)
     90          return RTEMS_SUCCESSFUL;
     91        if (status == HEAP_RESIZE_UNSATISFIED)
     92          return RTEMS_UNSATISFIED;
     93        return RTEMS_INVALID_ADDRESS;
    9294        break;
    9395
     
    98100
    99101      case OBJECTS_ERROR:
     102      default:
    100103        return_status = RTEMS_INVALID_ID;
    101104        break;
  • cpukit/rtems/src/regionreturnsegment.c

    r1c78f6a r58a8a47  
    5656{
    5757  Objects_Locations        location;
    58   rtems_status_code        return_status = RTEMS_SUCCESSFUL;
     58  rtems_status_code        return_status;
    5959#ifdef RTEMS_REGION_FREE_SHRED_PATTERN
    6060  uint32_t                 size;
     
    8484          if ( !status )
    8585            return_status = RTEMS_INVALID_ADDRESS;
    86 
    8786          else {
    8887            the_region->number_of_used_blocks -= 1;
     
    103102
    104103      case OBJECTS_ERROR:
     104      default:
    105105        return_status = RTEMS_INVALID_ID;
    106106        break;
Note: See TracChangeset for help on using the changeset viewer.