Skip to content

Commit bd8a8d5

Browse files
wyjwangdavem330
authored andcommitted
tun: Fix code style issues in <linux/if_tun.h>
This fixes the following code style problem: - WARNING: please, no spaces at the start of a line - CHECK: Please use a blank line after function/struct/union/enum declarations Signed-off-by: Yunjian Wang <wangyunjian@huawei.com> Reviewed-by: Jiri Pirko <jiri@nvidia.com> Reviewed-by: Willem de Bruijn <willemb@google.com> Acked-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3907f1f commit bd8a8d5

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

include/linux/if_tun.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,44 +27,54 @@ struct tun_xdp_hdr {
2727
#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
2828
struct socket *tun_get_socket(struct file *);
2929
struct ptr_ring *tun_get_tx_ring(struct file *file);
30+
3031
static inline bool tun_is_xdp_frame(void *ptr)
3132
{
32-
return (unsigned long)ptr & TUN_XDP_FLAG;
33+
return (unsigned long)ptr & TUN_XDP_FLAG;
3334
}
35+
3436
static inline void *tun_xdp_to_ptr(struct xdp_frame *xdp)
3537
{
36-
return (void *)((unsigned long)xdp | TUN_XDP_FLAG);
38+
return (void *)((unsigned long)xdp | TUN_XDP_FLAG);
3739
}
40+
3841
static inline struct xdp_frame *tun_ptr_to_xdp(void *ptr)
3942
{
40-
return (void *)((unsigned long)ptr & ~TUN_XDP_FLAG);
43+
return (void *)((unsigned long)ptr & ~TUN_XDP_FLAG);
4144
}
45+
4246
void tun_ptr_free(void *ptr);
4347
#else
4448
#include <linux/err.h>
4549
#include <linux/errno.h>
4650
struct file;
4751
struct socket;
52+
4853
static inline struct socket *tun_get_socket(struct file *f)
4954
{
5055
return ERR_PTR(-EINVAL);
5156
}
57+
5258
static inline struct ptr_ring *tun_get_tx_ring(struct file *f)
5359
{
5460
return ERR_PTR(-EINVAL);
5561
}
62+
5663
static inline bool tun_is_xdp_frame(void *ptr)
5764
{
5865
return false;
5966
}
67+
6068
static inline void *tun_xdp_to_ptr(struct xdp_frame *xdp)
6169
{
6270
return NULL;
6371
}
72+
6473
static inline struct xdp_frame *tun_ptr_to_xdp(void *ptr)
6574
{
6675
return NULL;
6776
}
77+
6878
static inline void tun_ptr_free(void *ptr)
6979
{
7080
}

0 commit comments

Comments
 (0)