It's better to save one argument by returning pid directly. This change also follow the convention of task_create. BTW, it is reasonable to adjust the function prototype a little bit from both implementation and consistency since task_spawn is NuttX specific API. Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>