treewide: remove redundant #include <linux/kconfig.h>
[cascardo/linux.git] / arch / mips / net / bpf_jit.c
index 1a8c960..49a2e22 100644 (file)
@@ -14,7 +14,6 @@
 #include <linux/errno.h>
 #include <linux/filter.h>
 #include <linux/if_vlan.h>
-#include <linux/kconfig.h>
 #include <linux/moduleloader.h>
 #include <linux/netdevice.h>
 #include <linux/string.h>
@@ -426,7 +425,7 @@ static inline void emit_load_ptr(unsigned int dst, unsigned int src,
 static inline void emit_load_func(unsigned int reg, ptr imm,
                                  struct jit_ctx *ctx)
 {
-       if (config_enabled(CONFIG_64BIT)) {
+       if (IS_ENABLED(CONFIG_64BIT)) {
                /* At this point imm is always 64-bit */
                emit_load_imm(r_tmp, (u64)imm >> 32, ctx);
                emit_dsll(r_tmp_imm, r_tmp, 16, ctx); /* left shift by 16 */
@@ -516,7 +515,7 @@ static inline void emit_jr(unsigned int reg, struct jit_ctx *ctx)
 static inline u16 align_sp(unsigned int num)
 {
        /* Double word alignment for 32-bit, quadword for 64-bit */
-       unsigned int align = config_enabled(CONFIG_64BIT) ? 16 : 8;
+       unsigned int align = IS_ENABLED(CONFIG_64BIT) ? 16 : 8;
        num = (num + (align - 1)) & -align;
        return num;
 }
@@ -1199,7 +1198,7 @@ void bpf_jit_compile(struct bpf_prog *fp)
 
        memset(&ctx, 0, sizeof(ctx));
 
-       ctx.offsets = kcalloc(fp->len, sizeof(*ctx.offsets), GFP_KERNEL);
+       ctx.offsets = kcalloc(fp->len + 1, sizeof(*ctx.offsets), GFP_KERNEL);
        if (ctx.offsets == NULL)
                return;