Coverity Issue with bdbuf.c

Joel Sherrill joel.sherrill at oarcorp.com
Thu Nov 20 03:10:24 UTC 2014



On November 19, 2014 8:37:47 PM CST, Gedare Bloom <gedare at rtems.org> wrote:
>I'm more concerned with the hard-coded cache alignment value, than I
>am with the dead code.

The code is likely not doing what the surge intended but Chris needs to comment on that bases on git blame. :)

Definitely questionable having a hard coded value and then testing it.

>-Gedare
>
>On Wed, Nov 19, 2014 at 6:10 PM, Joel Sherrill
><joel.sherrill at oarcorp.com> wrote:
>> Hi
>>
>> Coverity ID: 1255327
>>
>> I think this looks like a legitimately flagged piece of code :
>>
>> 1537   * For unspecified cache alignments we use the CPU alignment.
>> 1538   */
>>
>> assignment: Assigning: cache_aligment = 32U.
>> 1539  cache_aligment = 32; /* FIXME rtems_cache_get_data_line_size()
>*/
>>
>> const: At condition cache_aligment <= 0U, the value of cache_aligment
>must
>> be equal to 32.
>>
>> dead_error_condition: The condition cache_aligment <= 0U cannot be
>true.
>> 1540  if (cache_aligment <= 0)
>>
>> CID 1255327 (#1 of 1): Logically dead code (DEADCODE)dead_error_line:
>> Execution cannot reach this statement: cache_aligment = 8U;.
>> 1541    cache_aligment = CPU_ALIGNMENT;
>>
>> Josh .. can you check if CodeSonar flagged this?
>>
>> --
>> Joel Sherrill, Ph.D.             Director of Research & Development
>> joel.sherrill at OARcorp.com        On-Line Applications Research
>> Ask me about RTEMS: a free RTOS  Huntsville AL 35805
>> Support Available                (256) 722-9985
>>
>>
>> _______________________________________________
>> devel mailing list
>> devel at rtems.org
>> http://lists.rtems.org/mailman/listinfo/devel



More information about the devel mailing list