treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / unicore32 / kernel / elf.c
blob22adc65a03e972178809df83e00c32e2777c1ed5
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * linux/arch/unicore32/kernel/elf.c
5 * Code specific to PKUnity SoC and UniCore ISA
7 * Copyright (C) 2001-2010 GUAN Xue-tao
8 */
9 #include <linux/module.h>
10 #include <linux/sched.h>
11 #include <linux/personality.h>
12 #include <linux/binfmts.h>
13 #include <linux/elf.h>
15 int elf_check_arch(const struct elf32_hdr *x)
17 /* Make sure it's an UniCore executable */
18 if (x->e_machine != EM_UNICORE)
19 return 0;
21 /* Make sure the entry address is reasonable */
22 if (x->e_entry & 3)
23 return 0;
25 return 1;
27 EXPORT_SYMBOL(elf_check_arch);
29 void elf_set_personality(const struct elf32_hdr *x)
31 unsigned int personality = PER_LINUX;
33 set_personality(personality);
35 EXPORT_SYMBOL(elf_set_personality);