Skip to content

Commit ca8ee66

Browse files
pseidererkuba-moo
authored andcommitted
net: pktgen: fix code style (WARNING: Missing a blank line after declarations)
Fix checkpatch code style warnings: WARNING: Missing a blank line after declarations kernel-patches#761: FILE: net/core/pktgen.c:761: + char c; + if (get_user(c, &user_buffer[i])) WARNING: Missing a blank line after declarations kernel-patches#780: FILE: net/core/pktgen.c:780: + char c; + if (get_user(c, &user_buffer[i])) WARNING: Missing a blank line after declarations kernel-patches#806: FILE: net/core/pktgen.c:806: + char c; + if (get_user(c, &user_buffer[i])) WARNING: Missing a blank line after declarations kernel-patches#823: FILE: net/core/pktgen.c:823: + char c; + if (get_user(c, &user_buffer[i])) WARNING: Missing a blank line after declarations kernel-patches#1968: FILE: net/core/pktgen.c:1968: + char f[32]; + memset(f, 0, 32); WARNING: Missing a blank line after declarations kernel-patches#2410: FILE: net/core/pktgen.c:2410: + struct pktgen_net *pn = net_generic(dev_net(pkt_dev->odev), pg_net_id); + if (!x) { WARNING: Missing a blank line after declarations kernel-patches#2442: FILE: net/core/pktgen.c:2442: + __u16 t; + if (pkt_dev->flags & F_QUEUE_MAP_RND) { WARNING: Missing a blank line after declarations kernel-patches#2523: FILE: net/core/pktgen.c:2523: + unsigned int i; + for (i = 0; i < pkt_dev->nr_labels; i++) WARNING: Missing a blank line after declarations kernel-patches#2567: FILE: net/core/pktgen.c:2567: + __u32 t; + if (pkt_dev->flags & F_IPSRC_RND) WARNING: Missing a blank line after declarations kernel-patches#2587: FILE: net/core/pktgen.c:2587: + __be32 s; + if (pkt_dev->flags & F_IPDST_RND) { WARNING: Missing a blank line after declarations kernel-patches#2634: FILE: net/core/pktgen.c:2634: + __u32 t; + if (pkt_dev->flags & F_TXSIZE_RND) { WARNING: Missing a blank line after declarations kernel-patches#2736: FILE: net/core/pktgen.c:2736: + int i; + for (i = 0; i < pkt_dev->cflows; i++) { WARNING: Missing a blank line after declarations kernel-patches#2738: FILE: net/core/pktgen.c:2738: + struct xfrm_state *x = pkt_dev->flows[i].x; + if (x) { WARNING: Missing a blank line after declarations kernel-patches#2752: FILE: net/core/pktgen.c:2752: + int nhead = 0; + if (x) { WARNING: Missing a blank line after declarations kernel-patches#2795: FILE: net/core/pktgen.c:2795: + unsigned int i; + for (i = 0; i < pkt_dev->nr_labels; i++) WARNING: Missing a blank line after declarations kernel-patches#3480: FILE: net/core/pktgen.c:3480: + ktime_t idle_start = ktime_get(); + schedule(); Signed-off-by: Peter Seiderer <[email protected]> Reviewed-by: Toke Høiland-Jørgensen <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 870b856 commit ca8ee66

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

net/core/pktgen.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,7 @@ static ssize_t hex32_arg(const char __user *user_buffer, size_t maxlen,
758758
for (; i < maxlen; i++) {
759759
int value;
760760
char c;
761+
761762
if (get_user(c, &user_buffer[i]))
762763
return -EFAULT;
763764
value = hex_to_bin(c);
@@ -777,6 +778,7 @@ static ssize_t count_trail_chars(const char __user *user_buffer, size_t maxlen)
777778

778779
for (i = 0; i < maxlen; i++) {
779780
char c;
781+
780782
if (get_user(c, &user_buffer[i]))
781783
return -EFAULT;
782784
switch (c) {
@@ -803,6 +805,7 @@ static ssize_t num_arg(const char __user *user_buffer, size_t maxlen,
803805

804806
for (i = 0; i < maxlen; i++) {
805807
char c;
808+
806809
if (get_user(c, &user_buffer[i]))
807810
return -EFAULT;
808811
if ((c >= '0') && (c <= '9')) {
@@ -820,6 +823,7 @@ static ssize_t strn_len(const char __user *user_buffer, size_t maxlen)
820823

821824
for (i = 0; i < maxlen; i++) {
822825
char c;
826+
823827
if (get_user(c, &user_buffer[i]))
824828
return -EFAULT;
825829
switch (c) {
@@ -1966,6 +1970,7 @@ static ssize_t pktgen_thread_write(struct file *file,
19661970

19671971
if (!strcmp(name, "add_device")) {
19681972
char f[32];
1973+
19691974
memset(f, 0, 32);
19701975
max = min(sizeof(f) - 1, count - i);
19711976
len = strn_len(&user_buffer[i], max);
@@ -2408,6 +2413,7 @@ static void get_ipsec_sa(struct pktgen_dev *pkt_dev, int flow)
24082413
#ifdef CONFIG_XFRM
24092414
struct xfrm_state *x = pkt_dev->flows[flow].x;
24102415
struct pktgen_net *pn = net_generic(dev_net(pkt_dev->odev), pg_net_id);
2416+
24112417
if (!x) {
24122418

24132419
if (pkt_dev->spi) {
@@ -2440,6 +2446,7 @@ static void set_cur_queue_map(struct pktgen_dev *pkt_dev)
24402446

24412447
else if (pkt_dev->queue_map_min <= pkt_dev->queue_map_max) {
24422448
__u16 t;
2449+
24432450
if (pkt_dev->flags & F_QUEUE_MAP_RND) {
24442451
t = get_random_u32_inclusive(pkt_dev->queue_map_min,
24452452
pkt_dev->queue_map_max);
@@ -2521,6 +2528,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
25212528

25222529
if (pkt_dev->flags & F_MPLS_RND) {
25232530
unsigned int i;
2531+
25242532
for (i = 0; i < pkt_dev->nr_labels; i++)
25252533
if (pkt_dev->labels[i] & MPLS_STACK_BOTTOM)
25262534
pkt_dev->labels[i] = MPLS_STACK_BOTTOM |
@@ -2565,6 +2573,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
25652573
imx = ntohl(pkt_dev->saddr_max);
25662574
if (imn < imx) {
25672575
__u32 t;
2576+
25682577
if (pkt_dev->flags & F_IPSRC_RND)
25692578
t = get_random_u32_inclusive(imn, imx - 1);
25702579
else {
@@ -2585,6 +2594,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
25852594
if (imn < imx) {
25862595
__u32 t;
25872596
__be32 s;
2597+
25882598
if (pkt_dev->flags & F_IPDST_RND) {
25892599

25902600
do {
@@ -2632,6 +2642,7 @@ static void mod_cur_headers(struct pktgen_dev *pkt_dev)
26322642

26332643
if (pkt_dev->min_pkt_size < pkt_dev->max_pkt_size) {
26342644
__u32 t;
2645+
26352646
if (pkt_dev->flags & F_TXSIZE_RND) {
26362647
t = get_random_u32_inclusive(pkt_dev->min_pkt_size,
26372648
pkt_dev->max_pkt_size - 1);
@@ -2734,8 +2745,10 @@ static void free_SAs(struct pktgen_dev *pkt_dev)
27342745
if (pkt_dev->cflows) {
27352746
/* let go of the SAs if we have them */
27362747
int i;
2748+
27372749
for (i = 0; i < pkt_dev->cflows; i++) {
27382750
struct xfrm_state *x = pkt_dev->flows[i].x;
2751+
27392752
if (x) {
27402753
xfrm_state_put(x);
27412754
pkt_dev->flows[i].x = NULL;
@@ -2750,6 +2763,7 @@ static int process_ipsec(struct pktgen_dev *pkt_dev,
27502763
if (pkt_dev->flags & F_IPSEC) {
27512764
struct xfrm_state *x = pkt_dev->flows[pkt_dev->curfl].x;
27522765
int nhead = 0;
2766+
27532767
if (x) {
27542768
struct ethhdr *eth;
27552769
struct iphdr *iph;
@@ -2793,6 +2807,7 @@ static int process_ipsec(struct pktgen_dev *pkt_dev,
27932807
static void mpls_push(__be32 *mpls, struct pktgen_dev *pkt_dev)
27942808
{
27952809
unsigned int i;
2810+
27962811
for (i = 0; i < pkt_dev->nr_labels; i++)
27972812
*mpls++ = pkt_dev->labels[i] & ~MPLS_STACK_BOTTOM;
27982813

@@ -3478,6 +3493,7 @@ static void pktgen_rem_thread(struct pktgen_thread *t)
34783493
static void pktgen_resched(struct pktgen_dev *pkt_dev)
34793494
{
34803495
ktime_t idle_start = ktime_get();
3496+
34813497
schedule();
34823498
pkt_dev->idle_acc += ktime_to_ns(ktime_sub(ktime_get(), idle_start));
34833499
}

0 commit comments

Comments
 (0)