Changeset ebb9e8c in rtems


Ignore:
Timestamp:
01/16/23 08:36:54 (2 months ago)
Author:
Zhongjie Zhu <zhongjiezhu1@…>
Branches:
master
Children:
d9f3dcb
Parents:
a932d5d6
git-author:
Zhongjie Zhu <zhongjiezhu1@…> (01/16/23 08:36:54)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/07/23 16:45:24)
Message:

score: Fix maybe uninitialized warning

There are different cases for _ISR_lock_ISR_disable() and
_ISR_lock_ISR_enable() in the case RTEMS_SMP is defined or
RTEMS_PROFILING is defined, so remove the related code.

../../../cpukit/include/rtems/score/threaddispatch.h: In function '_Thread_Dispatch_disable':
../../../cpukit/include/rtems/score/threaddispatch.h:231:14: warning: 'lock_context' may be used uninitialized [-Wmaybe-uninitialized]

231 | cpu_self = _Thread_Dispatch_disable_critical( &lock_context );

| ~

../../../cpukit/include/rtems/score/threaddispatch.h:210:32: note: by argument 1 of type 'const ISR_lock_Context *' to '_Thread_Dispatch_disable_critical' declared here

210 | static inline Per_CPU_Control *_Thread_Dispatch_disable_critical(

|

../../../cpukit/include/rtems/score/threaddispatch.h:225:21: note: 'lock_context' declared here

225 | ISR_lock_Context lock_context;

| ~

Update #4662.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/include/rtems/score/threaddispatch.h

    ra932d5d6 rebb9e8c  
    223223{
    224224  Per_CPU_Control  *cpu_self;
     225
     226#if defined( RTEMS_SMP ) || defined( RTEMS_PROFILING )
    225227  ISR_lock_Context  lock_context;
    226228
    227 #if defined( RTEMS_SMP ) || defined( RTEMS_PROFILING )
    228229  _ISR_lock_ISR_disable( &lock_context );
    229 #endif
    230230
    231231  cpu_self = _Thread_Dispatch_disable_critical( &lock_context );
    232232
    233 #if defined( RTEMS_SMP ) || defined( RTEMS_PROFILING )
    234233  _ISR_lock_ISR_enable( &lock_context );
     234#else
     235  cpu_self = _Thread_Dispatch_disable_critical( NULL );
    235236#endif
    236237
Note: See TracChangeset for help on using the changeset viewer.