mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
netfilter: nf_conntrack_extend: introduce __nf_ct_ext_exist()
some users of nf_ct_ext_exist() know ct->ext isn't NULL. For these users, the check for ct->ext isn't necessary, the function __nf_ct_ext_exist() can be used instead. the type of the return value of nf_ct_ext_exist() is changed to bool. Signed-off-by: Changli Gao <xiaosuo@gmail.com> Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
parent
24b36f0193
commit
ee92d37861
2 changed files with 19 additions and 12 deletions
|
|
@ -28,9 +28,14 @@ struct nf_ct_ext {
|
|||
char data[0];
|
||||
};
|
||||
|
||||
static inline int nf_ct_ext_exist(const struct nf_conn *ct, u8 id)
|
||||
static inline bool __nf_ct_ext_exist(const struct nf_ct_ext *ext, u8 id)
|
||||
{
|
||||
return (ct->ext && ct->ext->offset[id]);
|
||||
return !!ext->offset[id];
|
||||
}
|
||||
|
||||
static inline bool nf_ct_ext_exist(const struct nf_conn *ct, u8 id)
|
||||
{
|
||||
return (ct->ext && __nf_ct_ext_exist(ct->ext, id));
|
||||
}
|
||||
|
||||
static inline void *__nf_ct_ext_find(const struct nf_conn *ct, u8 id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue