elf: Replace {0x7f, 'E', 'L', 'F'} to EI_MAGIC

to avoid the duplication of the magic number.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2023-07-04 17:34:09 +08:00 committed by Alan Carvalho de Assis
parent 3cee81af6d
commit 7bb97f7e22
2 changed files with 2 additions and 9 deletions

View file

@ -39,10 +39,7 @@
* Private Constant Data
****************************************************************************/
static const char g_elfmagic[EI_MAGIC_SIZE] =
{
0x7f, 'E', 'L', 'F'
};
static const char g_elfmagic[EI_MAGIC_SIZE] = EI_MAGIC;
/****************************************************************************
* Private Functions

View file

@ -28,7 +28,6 @@
#include <debug.h>
#include <errno.h>
#include <nuttx/arch.h>
#include <nuttx/elf.h>
#include <nuttx/lib/modlib.h>
@ -36,10 +35,7 @@
* Private Constant Data
****************************************************************************/
static const char g_modmagic[EI_MAGIC_SIZE] =
{
0x7f, 'E', 'L', 'F'
};
static const char g_modmagic[EI_MAGIC_SIZE] = EI_MAGIC;
/****************************************************************************
* Public Functions