Skip to content

Commit 0013de3

Browse files
Javier Martinez Canillasdavem330
authored andcommitted
net: sched: use IS_ENABLED() instead of checking for built-in or module
The IS_ENABLED() macro checks if a Kconfig symbol has been enabled either built-in or as a module, use that macro instead of open coding the same. Using the macro makes the code more readable by helping abstract away some of the Kconfig built-in and module enable details. Signed-off-by: Javier Martinez Canillas <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 9dd7994 commit 0013de3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

net/sched/cls_flow.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include <net/route.h>
3030
#include <net/flow_dissector.h>
3131

32-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
32+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
3333
#include <net/netfilter/nf_conntrack.h>
3434
#endif
3535

@@ -125,14 +125,14 @@ static u32 flow_get_mark(const struct sk_buff *skb)
125125

126126
static u32 flow_get_nfct(const struct sk_buff *skb)
127127
{
128-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
128+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
129129
return addr_fold(skb->nfct);
130130
#else
131131
return 0;
132132
#endif
133133
}
134134

135-
#if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE)
135+
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
136136
#define CTTUPLE(skb, member) \
137137
({ \
138138
enum ip_conntrack_info ctinfo; \

0 commit comments

Comments
 (0)