Skip to content

Commit 65632e2

Browse files
FlyGoatintel-lab-lkp
authored andcommitted
MIPS: Rename mips_instruction type to workaround bindgen issue
We have a union and a type both named after mips_instruction, rust bindgen is not happy with this kind of naming alias. Given that union mips_instruction is a part of UAPI, the best thing we can do is to rename mips_instruction type. Rename it as mips_insn, which is not conflicting with anything and aligned with struct name here. Signed-off-by: Jiaxun Yang <[email protected]>
1 parent cccf9bd commit 65632e2

File tree

6 files changed

+19
-19
lines changed

6 files changed

+19
-19
lines changed

arch/mips/include/asm/dsemul.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct task_struct;
3434
*
3535
* Return: Zero on success, negative if ir is a NOP, signal number on failure.
3636
*/
37-
extern int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
37+
extern int mips_dsemul(struct pt_regs *regs, mips_insn ir,
3838
unsigned long branch_pc, unsigned long cont_pc);
3939

4040
/**

arch/mips/include/asm/inst.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@
7171
#define I_FMA_FFMT_SFT 0
7272
#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000007)
7373

74-
typedef unsigned int mips_instruction;
74+
typedef unsigned int mips_insn;
7575

7676
/* microMIPS instruction decode structure. Do NOT export!!! */
7777
struct mm_decoded_insn {
78-
mips_instruction insn;
79-
mips_instruction next_insn;
78+
mips_insn insn;
79+
mips_insn next_insn;
8080
int pc_inc;
8181
int next_pc_inc;
8282
int micro_mips_mode;

arch/mips/kernel/ftrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ int ftrace_disable_ftrace_graph_caller(void)
248248
#define S_R_SP (0xafb0 << 16) /* s{d,w} R, offset(sp) */
249249
#define OFFSET_MASK 0xffff /* stack offset range: 0 ~ PT_SIZE */
250250

251-
unsigned long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long
251+
static long ftrace_get_parent_ra_addr(unsigned long self_ra, unsigned long
252252
old_parent_ra, unsigned long parent_ra_addr, unsigned long fp)
253253
{
254254
unsigned long sp, ip, tmp;

arch/mips/kernel/kprobes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ int arch_prepare_kprobe(struct kprobe *p)
9090
}
9191

9292
if (copy_from_kernel_nofault(&prev_insn, p->addr - 1,
93-
sizeof(mips_instruction)) == 0 &&
93+
sizeof(kprobe_opcode_t)) == 0 &&
9494
insn_has_delayslot(prev_insn)) {
9595
pr_notice("Kprobes for branch delayslot are not supported\n");
9696
ret = -EINVAL;

arch/mips/math-emu/cp1emu.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@
4343
/* Function which emulates a floating point instruction. */
4444

4545
static int fpu_emu(struct pt_regs *, struct mips_fpu_struct *,
46-
mips_instruction);
46+
mips_insn);
4747

4848
static int fpux_emu(struct pt_regs *,
49-
struct mips_fpu_struct *, mips_instruction, void __user **);
49+
struct mips_fpu_struct *, mips_insn, void __user **);
5050

5151
/* Control registers */
5252

@@ -846,7 +846,7 @@ do { \
846846
* Emulate a CFC1 instruction.
847847
*/
848848
static inline void cop1_cfc(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
849-
mips_instruction ir)
849+
mips_insn ir)
850850
{
851851
u32 fcr31 = ctx->fcr31;
852852
u32 value = 0;
@@ -903,7 +903,7 @@ static inline void cop1_cfc(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
903903
* Emulate a CTC1 instruction.
904904
*/
905905
static inline void cop1_ctc(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
906-
mips_instruction ir)
906+
mips_insn ir)
907907
{
908908
u32 fcr31 = ctx->fcr31;
909909
u32 value;
@@ -973,7 +973,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
973973
{
974974
unsigned long contpc = xcp->cp0_epc + dec_insn.pc_inc;
975975
unsigned int cond, cbit, bit0;
976-
mips_instruction ir;
976+
mips_insn ir;
977977
int likely, pc_inc;
978978
union fpureg *fpr;
979979
u32 __user *wva;
@@ -1461,7 +1461,7 @@ DEF3OP(nmadd, dp, ieee754dp_mul, ieee754dp_add, ieee754dp_neg);
14611461
DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
14621462

14631463
static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1464-
mips_instruction ir, void __user **fault_addr)
1464+
mips_insn ir, void __user **fault_addr)
14651465
{
14661466
unsigned int rcsr = 0; /* resulting csr */
14671467

@@ -1680,7 +1680,7 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
16801680
* Emulate a single COP1 arithmetic instruction.
16811681
*/
16821682
static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
1683-
mips_instruction ir)
1683+
mips_insn ir)
16841684
{
16851685
int rfmt; /* resulting format */
16861686
unsigned int rcsr = 0; /* resulting csr */
@@ -2899,9 +2899,9 @@ int fpu_emulator_cop1Handler(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
28992899
dec_insn.micro_mips_mode = 1;
29002900
} else {
29012901
if ((get_user(dec_insn.insn,
2902-
(mips_instruction __user *) xcp->cp0_epc)) ||
2902+
(mips_insn __user *) xcp->cp0_epc)) ||
29032903
(get_user(dec_insn.next_insn,
2904-
(mips_instruction __user *)(xcp->cp0_epc+4)))) {
2904+
(mips_insn __user *)(xcp->cp0_epc+4)))) {
29052905
MIPS_FPU_EMU_INC_STATS(errors);
29062906
return SIGBUS;
29072907
}

arch/mips/math-emu/dsemul.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
* couldn't already.
6262
*/
6363
struct emuframe {
64-
mips_instruction emul;
65-
mips_instruction badinst;
64+
mips_insn emul;
65+
mips_insn badinst;
6666
};
6767

6868
static const int emupage_frame_count = PAGE_SIZE / sizeof(struct emuframe);
@@ -206,11 +206,11 @@ void dsemul_mm_cleanup(struct mm_struct *mm)
206206
bitmap_free(mm_ctx->bd_emupage_allocmap);
207207
}
208208

209-
int mips_dsemul(struct pt_regs *regs, mips_instruction ir,
209+
int mips_dsemul(struct pt_regs *regs, mips_insn ir,
210210
unsigned long branch_pc, unsigned long cont_pc)
211211
{
212212
int isa16 = get_isa16_mode(regs->cp0_epc);
213-
mips_instruction break_math;
213+
mips_insn break_math;
214214
unsigned long fr_uaddr;
215215
struct emuframe fr;
216216
int fr_idx, ret;

0 commit comments

Comments
 (0)