ip: fix all the checkpatch warnings
Zhang Shengju some places where tabs were not being used. Go ahead and fix all the trival checkpatch warnings in ip/ip.c Also fix bridge.c
This commit is contained in:
parent
99bb68ff66
commit
ec7aff5c4f
|
|
@ -18,12 +18,12 @@
|
||||||
struct rtnl_handle rth = { .fd = -1 };
|
struct rtnl_handle rth = { .fd = -1 };
|
||||||
int preferred_family = AF_UNSPEC;
|
int preferred_family = AF_UNSPEC;
|
||||||
int resolve_hosts;
|
int resolve_hosts;
|
||||||
int oneline = 0;
|
int oneline;
|
||||||
int show_stats;
|
int show_stats;
|
||||||
int show_details;
|
int show_details;
|
||||||
int compress_vlans;
|
int compress_vlans;
|
||||||
int timestamp;
|
int timestamp;
|
||||||
char * _SL_ = NULL;
|
const char *_SL_;
|
||||||
|
|
||||||
static void usage(void) __attribute__((noreturn));
|
static void usage(void) __attribute__((noreturn));
|
||||||
|
|
||||||
|
|
@ -66,7 +66,8 @@ static int do_cmd(const char *argv0, int argc, char **argv)
|
||||||
return c->func(argc-1, argv+1);
|
return c->func(argc-1, argv+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fprintf(stderr, "Object \"%s\" is unknown, try \"bridge help\".\n", argv0);
|
fprintf(stderr,
|
||||||
|
"Object \"%s\" is unknown, try \"bridge help\".\n", argv0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -74,7 +75,8 @@ int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
while (argc > 1) {
|
while (argc > 1) {
|
||||||
char *opt = argv[1];
|
const char *opt = argv[1];
|
||||||
|
|
||||||
if (strcmp(opt, "--") == 0) {
|
if (strcmp(opt, "--") == 0) {
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
break;
|
break;
|
||||||
|
|
@ -122,7 +124,9 @@ main(int argc, char **argv)
|
||||||
} else if (matches(opt, "-compressvlans") == 0) {
|
} else if (matches(opt, "-compressvlans") == 0) {
|
||||||
++compress_vlans;
|
++compress_vlans;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Option \"%s\" is unknown, try \"bridge help\".\n", opt);
|
fprintf(stderr,
|
||||||
|
"Option \"%s\" is unknown, try \"bridge help\".\n",
|
||||||
|
opt);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ extern int resolve_hosts;
|
||||||
extern int oneline;
|
extern int oneline;
|
||||||
extern int timestamp;
|
extern int timestamp;
|
||||||
extern int timestamp_short;
|
extern int timestamp_short;
|
||||||
extern char * _SL_;
|
extern const char * _SL_;
|
||||||
extern int max_flush_loops;
|
extern int max_flush_loops;
|
||||||
extern int batch_mode;
|
extern int batch_mode;
|
||||||
extern bool do_all;
|
extern bool do_all;
|
||||||
|
|
|
||||||
36
ip/ip.c
36
ip/ip.c
|
|
@ -26,18 +26,18 @@
|
||||||
#include "color.h"
|
#include "color.h"
|
||||||
|
|
||||||
int preferred_family = AF_UNSPEC;
|
int preferred_family = AF_UNSPEC;
|
||||||
int human_readable = 0;
|
int human_readable;
|
||||||
int use_iec = 0;
|
int use_iec;
|
||||||
int show_stats = 0;
|
int show_stats;
|
||||||
int show_details = 0;
|
int show_details;
|
||||||
int resolve_hosts = 0;
|
int resolve_hosts;
|
||||||
int oneline = 0;
|
int oneline;
|
||||||
int timestamp = 0;
|
int timestamp;
|
||||||
char * _SL_ = NULL;
|
const char *_SL_;
|
||||||
int force = 0;
|
int force;
|
||||||
int max_flush_loops = 10;
|
int max_flush_loops = 10;
|
||||||
int batch_mode = 0;
|
int batch_mode;
|
||||||
bool do_all = false;
|
bool do_all;
|
||||||
|
|
||||||
struct rtnl_handle rth = { .fd = -1 };
|
struct rtnl_handle rth = { .fd = -1 };
|
||||||
|
|
||||||
|
|
@ -105,10 +105,9 @@ static int do_cmd(const char *argv0, int argc, char **argv)
|
||||||
const struct cmd *c;
|
const struct cmd *c;
|
||||||
|
|
||||||
for (c = cmds; c->cmd; ++c) {
|
for (c = cmds; c->cmd; ++c) {
|
||||||
if (matches(argv0, c->cmd) == 0) {
|
if (matches(argv0, c->cmd) == 0)
|
||||||
return -(c->func(argc-1, argv+1));
|
return -(c->func(argc-1, argv+1));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
fprintf(stderr, "Object \"%s\" is unknown, try \"ip help\".\n", argv0);
|
fprintf(stderr, "Object \"%s\" is unknown, try \"ip help\".\n", argv0);
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
@ -124,7 +123,8 @@ static int batch(const char *name)
|
||||||
|
|
||||||
if (name && strcmp(name, "-") != 0) {
|
if (name && strcmp(name, "-") != 0) {
|
||||||
if (freopen(name, "r", stdin) == NULL) {
|
if (freopen(name, "r", stdin) == NULL) {
|
||||||
fprintf(stderr, "Cannot open file \"%s\" for reading: %s\n",
|
fprintf(stderr,
|
||||||
|
"Cannot open file \"%s\" for reading: %s\n",
|
||||||
name, strerror(errno));
|
name, strerror(errno));
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +145,8 @@ static int batch(const char *name)
|
||||||
continue; /* blank line */
|
continue; /* blank line */
|
||||||
|
|
||||||
if (do_cmd(largv[0], largc, largv)) {
|
if (do_cmd(largv[0], largc, largv)) {
|
||||||
fprintf(stderr, "Command failed %s:%d\n", name, cmdlineno);
|
fprintf(stderr, "Command failed %s:%d\n",
|
||||||
|
name, cmdlineno);
|
||||||
ret = EXIT_FAILURE;
|
ret = EXIT_FAILURE;
|
||||||
if (!force)
|
if (!force)
|
||||||
break;
|
break;
|
||||||
|
|
@ -172,6 +173,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
while (argc > 1) {
|
while (argc > 1) {
|
||||||
char *opt = argv[1];
|
char *opt = argv[1];
|
||||||
|
|
||||||
if (strcmp(opt, "--") == 0) {
|
if (strcmp(opt, "--") == 0) {
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
break;
|
break;
|
||||||
|
|
@ -269,7 +271,9 @@ int main(int argc, char **argv)
|
||||||
} else if (matches(opt, "-all") == 0) {
|
} else if (matches(opt, "-all") == 0) {
|
||||||
do_all = true;
|
do_all = true;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, "Option \"%s\" is unknown, try \"ip -help\".\n", opt);
|
fprintf(stderr,
|
||||||
|
"Option \"%s\" is unknown, try \"ip -help\".\n",
|
||||||
|
opt);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue