powerpc/bpf: Cleanup bpf_jit.h
authorNaveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Mon, 14 Feb 2022 10:41:47 +0000 (16:11 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 7 Mar 2022 13:04:59 +0000 (00:04 +1100)
- PPC_EX32() is only used by ppc32 JIT. Move it to bpf_jit_comp32.c
- PPC_LI64() is only valid in ppc64. #ifdef it
- PPC_FUNC_ADDR() is not used anymore. Remove it.

Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/58f5b66b2f8546bbbee620f62103a8e97a63eb7c.1644834730.git.naveen.n.rao@linux.vnet.ibm.com
arch/powerpc/net/bpf_jit.h
arch/powerpc/net/bpf_jit_comp32.c

index dd1b338ba0644618f17d5b7e5b24386fc7a4365a..42a9adda31eb4064d4c98a30bc4cfb52e5ef21db 100644 (file)
                                EMIT(PPC_RAW_ORI(d, d, IMM_L(i)));            \
                } } while(0)
 
-#ifdef CONFIG_PPC32
-#define PPC_EX32(r, i)         EMIT(PPC_RAW_LI((r), (i) < 0 ? -1 : 0))
-#endif
-
+#ifdef CONFIG_PPC64
 #define PPC_LI64(d, i)         do {                                          \
                if ((long)(i) >= -2147483648 &&                               \
                                (long)(i) < 2147483648)                       \
                                EMIT(PPC_RAW_ORI(d, d, (uintptr_t)(i) &       \
                                                        0xffff));             \
                } } while (0)
-
-#ifdef CONFIG_PPC64
-#define PPC_FUNC_ADDR(d,i) do { PPC_LI64(d, i); } while(0)
-#else
-#define PPC_FUNC_ADDR(d,i) do { PPC_LI32(d, i); } while(0)
 #endif
 
 /*
index b72fac52c3ca1ae7c9b6cf98d2b43f5869ac41e6..1dda7e3a3e9b5dba2b73c913a1e58758b6d4a97e 100644 (file)
@@ -36,6 +36,8 @@
 /* BPF register usage */
 #define TMP_REG        (MAX_BPF_JIT_REG + 0)
 
+#define PPC_EX32(r, i)         EMIT(PPC_RAW_LI((r), (i) < 0 ? -1 : 0))
+
 /* BPF to ppc register mappings */
 const int b2p[MAX_BPF_JIT_REG + 1] = {
        /* function return value */