Changeset 361ec320 in rtems


Ignore:
Timestamp:
01/27/21 15:33:01 (16 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
426b6cd
Parents:
3272dcb
git-author:
Sebastian Huber <sebastian.huber@…> (01/27/21 15:33:01)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/27/21 18:02:03)
Message:

cacheimpl.h: Avoid potential dead code

If CPU_DATA_CACHE_ALIGNMENT == CPU_INSTRUCTION_CACHE_ALIGNMENT we had
dead code with the previous implementation.

This fix relates to CID 1399776 (DEADCODE).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bsps/shared/cache/cacheimpl.h

    r3272dcb r361ec320  
    8383
    8484#include <rtems.h>
     85
     86#include <sys/param.h>
    8587
    8688#if defined(RTEMS_SMP) && defined(CPU_CACHE_NO_INSTRUCTION_CACHE_SNOOPING)
     
    438440  return CPU_MAXIMAL_CACHE_ALIGNMENT;
    439441#endif
    440   size_t max_line_size = 0;
    441 #if defined(CPU_DATA_CACHE_ALIGNMENT)
    442   {
    443     size_t data_line_size = CPU_DATA_CACHE_ALIGNMENT;
    444     if ( max_line_size < data_line_size )
    445       max_line_size = data_line_size;
    446   }
    447 #endif
    448 #if defined(CPU_INSTRUCTION_CACHE_ALIGNMENT)
    449   {
    450     size_t instruction_line_size = CPU_INSTRUCTION_CACHE_ALIGNMENT;
    451     if ( max_line_size < instruction_line_size )
    452       max_line_size = instruction_line_size;
    453   }
    454 #endif
    455   return max_line_size;
     442  size_t data_line_size =
     443#if defined(CPU_DATA_CACHE_ALIGNMENT)
     444    CPU_DATA_CACHE_ALIGNMENT;
     445#else
     446    0;
     447#endif
     448  size_t instruction_line_size =
     449#if defined(CPU_INSTRUCTION_CACHE_ALIGNMENT)
     450    CPU_INSTRUCTION_CACHE_ALIGNMENT;
     451#else
     452    0;
     453#endif
     454  return MAX( data_line_size, instruction_line_size );
    456455}
    457456
Note: See TracChangeset for help on using the changeset viewer.