Fix MISRA issues for ThreadX SMP (#263)
* Fixed MISRA2012 rule 10.4_a The operands `pool_ptr->tx_byte_pool_fragments' and `2' have essential type categories unsigned 32-bit int and signed 8-bit int, which do not match. * Fixed MISRA2012 rule 10.4_a The operands `next_priority' and `TX_MAX_PRIORITIES' have essential type categories unsigned 32-bit int and signed 8-bit int, which do not match. * Fixed MISRA2012 rule 8.3 Declaration/definition of `_tx_thread_smp_preemptable_threads_get' is inconsistent with previous declaration/definition in types and/or type qualifiers
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_byte_pool_search PORTABLE SMP */
|
||||
/* 6.1.7 */
|
||||
/* 6.x */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -81,6 +81,8 @@
|
||||
/* calculation, and reduced */
|
||||
/* number of search resets, */
|
||||
/* resulting in version 6.1.7 */
|
||||
/* xx-xx-xxxx Tiejun Zhou Fixed MISRA2012 rule 10.4_a, */
|
||||
/* resulting in version 6.x */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
|
||||
@@ -110,7 +112,7 @@ UINT blocks_searched = ((UINT) 0);
|
||||
|
||||
/* First, determine if there are enough bytes in the pool. */
|
||||
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
|
||||
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
|
||||
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2U) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
|
||||
if (memory_size >= total_theoretical_available)
|
||||
{
|
||||
|
||||
|
||||
Reference in New Issue
Block a user