/* Function for evaluating if a data page swap is required for the tail section on the current page.  */
static bool is_tail_data_page_swap_required(void)
/* Function for evaluating if a data page swap is required for the tail section on the current page.  */
static bool is_tail_data_page_swap_required(void)
{
    bool ret_value;
    const cmd_queue_element_t * p_cmd        = &m_cmd_queue.cmd[m_cmd_queue.rp];
    const pstorage_block_t      cmd_block_id = p_cmd->storage_addr.block_id;        
    const uint32_t              last_page_id = (cmd_block_id + p_cmd->size + p_cmd->offset - 1u) / 
                                               PSTORAGE_FLASH_PAGE_SIZE;
    if ((m_tail_word_size != 0) && (m_current_page_id == last_page_id))
    {
        ret_value = true;
    }
    else
    {
        ret_value = false;    
    }
    return ret_value;
}