Skip to content

Commit 35ef8fb

Browse files
committed
Fix white space errors.
Signed-off-by: YOSHIFUJI Hideaki <[email protected]>
1 parent bad641b commit 35ef8fb

13 files changed

+241
-241
lines changed

Modules/pg3.c

+29-29
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
* the Free Software Foundation; either version 2 of the License, or
99
* (at your option) any later version.
1010
*
11-
*
11+
*
1212
*
1313
*/
1414

1515
/*
1616
17-
A tool for loading a network with a preconfigurated packets. The tool is
18-
implemented as a linux module. Parameters as output device IPG interpacket
19-
packet, number of packets can be configured. pg uses already intalled
17+
A tool for loading a network with a preconfigurated packets. The tool is
18+
implemented as a linux module. Parameters as output device IPG interpacket
19+
packet, number of packets can be configured. pg uses already intalled
2020
device driver output routine.
2121
2222
@@ -45,12 +45,12 @@ MAC address typo fixed. 010417 --ro
4545
pgset "frags 5" packet will consist of 5 fragments
4646
pgset "count 200000" sets number of packets to send
4747
pgset "ipg 5000" sets artificial gap inserted between packets
48-
to 5000 nanoseconds
48+
to 5000 nanoseconds
4949
pgset "dst 10.0.0.1" sets IP destination address
50-
(BEWARE! This generator is very aggressive!)
50+
(BEWARE! This generator is very aggressive!)
5151
pgset "dstmac 00:00:00:00:00:00" sets MAC destination address
5252
pgset stop aborts injection
53-
53+
5454
Also, ^C aborts generator.
5555
5656
---- cut here
@@ -66,7 +66,7 @@ function pgset() {
6666
6767
result=`cat /proc/net/pg | fgrep "Result: OK:"`
6868
if [ "$result" = "" ]; then
69-
cat /proc/net/pg | fgrep Result:
69+
cat /proc/net/pg | fgrep Result:
7070
fi
7171
}
7272
@@ -111,7 +111,7 @@ pgset "dst 0.0.0.0"
111111
#include <linux/if_arp.h>
112112
#include <net/checksum.h>
113113

114-
static char version[] __initdata =
114+
static char version[] __initdata =
115115
"pg3.c: v1.0 010812: Packet Generator for packet performance testing.\n";
116116

117117

@@ -131,8 +131,8 @@ int forced_stop;
131131
int pg_cpu_speed;
132132
int pg_busy;
133133

134-
static __u8 hh[14] = {
135-
0x00, 0x80, 0xC8, 0x79, 0xB3, 0xCB,
134+
static __u8 hh[14] = {
135+
0x00, 0x80, 0xC8, 0x79, 0xB3, 0xCB,
136136

137137
/* We fill in SRC address later */
138138
0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -430,9 +430,9 @@ static void pg_inject(void)
430430

431431
idle = (((idle_acc_hi<<20)/pg_cpu_speed)<<12)+idle_acc_lo/pg_cpu_speed;
432432

433-
if (1) {
433+
if (1) {
434434
char *p = pg_result;
435-
435+
436436
p += sprintf(p, "OK: %u(c%u+d%u) usec, %u (%dbyte,%dfrags) %upps %uMB/sec",
437437
total, total-idle, idle,
438438
pc, skb->len, skb_shinfo(skb)->nr_frags,
@@ -444,7 +444,7 @@ static void pg_inject(void)
444444
out_relskb:
445445
kfree_skb(skb);
446446
out_reldev:
447-
dev_put(odev);
447+
dev_put(odev);
448448
return;
449449

450450
out_intr:
@@ -461,11 +461,11 @@ int proc_pg_busy_read(char *buf , char **start, off_t offset,
461461
int len, int *eof, void *data)
462462
{
463463
char *p;
464-
464+
465465
p = buf;
466466
p += sprintf(p, "%d\n", pg_busy);
467467
*eof = 1;
468-
468+
469469
return p-buf;
470470
}
471471

@@ -474,7 +474,7 @@ int proc_pg_read(char *buf , char **start, off_t offset,
474474
{
475475
char *p;
476476
int i;
477-
477+
478478
p = buf;
479479
p += sprintf(p, "Params: count=%u pkt_size=%u frags %d ipg %u odev \"%s\" dst %s dstmac ",
480480
pg_count, pkt_size, nfrags, pg_ipg,
@@ -511,12 +511,12 @@ int count_trail_chars(const char *buffer, unsigned int maxlen)
511511
return i;
512512
}
513513

514-
unsigned long num_arg(const char *buffer, unsigned long maxlen,
514+
unsigned long num_arg(const char *buffer, unsigned long maxlen,
515515
unsigned long *num)
516516
{
517517
int i=0;
518518
*num = 0;
519-
519+
520520
for(; i<maxlen;i++) {
521521
if( (buffer[i] >= '0') && (buffer[i] <= '9')) {
522522
*num *= 10;
@@ -552,22 +552,22 @@ int proc_pg_write(struct file *file, const char *buffer,
552552
int i=0, max, len;
553553
char name[16], valstr[32];
554554
unsigned long value = 0;
555-
555+
556556
if (count < 1) {
557557
sprintf(pg_result, "Wrong command format");
558558
return -EINVAL;
559559
}
560-
560+
561561
max = count -i;
562562
i += count_trail_chars(&buffer[i], max);
563-
563+
564564
/* Read variable name */
565565

566566
len = strn_len(&buffer[i], sizeof(name)-1);
567567
memset(name, 0, sizeof(name));
568568
strncpy(name, &buffer[i], len);
569569
i += len;
570-
570+
571571
max = count -i;
572572
len = count_trail_chars(&buffer[i], max);
573573
i += len;
@@ -576,7 +576,7 @@ int proc_pg_write(struct file *file, const char *buffer,
576576
printk("pg: %s,%lu\n", name, count);
577577

578578
/* Only stop is allowed when we are running */
579-
579+
580580
if(!strcmp(name, "stop")) {
581581
forced_stop=1;
582582
if (pg_busy)
@@ -663,7 +663,7 @@ int proc_pg_write(struct file *file, const char *buffer,
663663
m++;
664664
*m = 0;
665665
}
666-
}
666+
}
667667
sprintf(pg_result, "OK: dstmac");
668668
return count;
669669
}
@@ -684,11 +684,11 @@ int proc_pg_write(struct file *file, const char *buffer,
684684

685685
static int pg_init(void)
686686
{
687-
printk(version);
688-
cycles_calibrate();
689-
if (pg_cpu_speed == 0) {
687+
printk(version);
688+
cycles_calibrate();
689+
if (pg_cpu_speed == 0) {
690690
printk("pg3: Error: your machine does not have working cycle counter.\n");
691-
return -EINVAL;
691+
return -EINVAL;
692692
}
693693
if(!pg_proc_ent) {
694694
pg_proc_ent = create_proc_entry("net/pg", 0600, 0);

arping.c

+9-9
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,10 @@ int received, brd_recv, req_recv;
6464
void usage(void)
6565
{
6666
fprintf(stderr,
67-
"Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination\n"
68-
" -f : quit on first reply\n"
67+
"Usage: arping [-fqbDUAV] [-c count] [-w timeout] [-I device] [-s source] destination\n"
68+
" -f : quit on first reply\n"
6969
" -q : be quiet\n"
70-
" -b : keep broadcasting, don't go unicast\n"
70+
" -b : keep broadcasting, don't go unicast\n"
7171
" -D : duplicate address detection mode\n"
7272
" -U : Unsolicited ARP mode, update your neighbours\n"
7373
" -A : ARP answer mode, update your neighbours\n"
@@ -77,7 +77,7 @@ void usage(void)
7777
" -I device : which ethernet device to use (eth0)\n"
7878
" -s source : source ip address\n"
7979
" destination : ask for what ip address\n"
80-
);
80+
);
8181
exit(2);
8282
}
8383

@@ -337,10 +337,10 @@ main(int argc, char **argv)
337337
timeout = atoi(optarg);
338338
break;
339339
case 'I':
340-
device = optarg;
341-
break;
342-
case 'f':
343-
quit_on_reply=1;
340+
device = optarg;
341+
break;
342+
case 'f':
343+
quit_on_reply=1;
344344
break;
345345
case 's':
346346
source = optarg;
@@ -416,7 +416,7 @@ main(int argc, char **argv)
416416

417417
if (!dad && unsolicited && src.s_addr == 0)
418418
src = dst;
419-
419+
420420
if (!dad || src.s_addr) {
421421
struct sockaddr_in saddr;
422422
int probe_fd = socket(AF_INET, SOCK_DGRAM, 0);

0 commit comments

Comments
 (0)