From 28a4d0cc1e39ad67fb5dd17375c1cf90944fd255 Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Wed, 23 May 2012 12:15:43 +0200 Subject: [PATCH] cls_can: Some fixes according to remarks made by Oliver. --- include/linux/can.h | 3 +++ net/sched/Makefile | 1 - net/sched/cls_can.c | 7 +------ 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/include/linux/can.h b/include/linux/can.h index d18333302cb..8986be3bbc6 100644 --- a/include/linux/can.h +++ b/include/linux/can.h @@ -40,6 +40,9 @@ */ typedef __u32 canid_t; +#define CAN_SFF_ID_BITS 11 +#define CAN_EFF_ID_BITS 29 + /* * Controller Area Network Error Frame Mask structure * diff --git a/net/sched/Makefile b/net/sched/Makefile index b89a5c4c223..6e5079637a4 100644 --- a/net/sched/Makefile +++ b/net/sched/Makefile @@ -47,4 +47,3 @@ obj-$(CONFIG_NET_EMATCH_NBYTE) += em_nbyte.o obj-$(CONFIG_NET_EMATCH_U32) += em_u32.o obj-$(CONFIG_NET_EMATCH_META) += em_meta.o obj-$(CONFIG_NET_EMATCH_TEXT) += em_text.o -CFLAGS_cls_can.o := -DDEBUG diff --git a/net/sched/cls_can.c b/net/sched/cls_can.c index 1932b15532f..cf34eb56b8d 100644 --- a/net/sched/cls_can.c +++ b/net/sched/cls_can.c @@ -35,11 +35,6 @@ #include #include -#ifndef CAN_SFF_ID_BITS - #define CAN_SFF_ID_BITS 11 - #define CAN_EFF_ID_BITS 29 -#endif - #define SFF_BITMAP 1 /* Use bitmap for storing rules for SFF frames? */ @@ -268,7 +263,7 @@ static int canfltr_set_parms(struct tcf_proto *tp, struct canfltr_state *f, int i; rules_tmp = kzalloc(sizeof(*rules_tmp), GFP_KERNEL); - if (rules_tmp == NULL) + if (!rules_tmp) return -ENOBUFS; err = -EINVAL; -- 2.39.2