candump: convert towards kernel coding style
parent
fe6ee6d33f
commit
697901f9ef
15
candump.c
15
candump.c
|
|
@ -106,7 +106,7 @@ struct if_info { /* bundled information per open socket */
|
|||
static struct if_info sock_info[MAXSOCK];
|
||||
|
||||
static char *progname;
|
||||
static char devname[MAXIFNAMES][IFNAMSIZ+1];
|
||||
static char devname[MAXIFNAMES][IFNAMSIZ + 1];
|
||||
static int dindex[MAXIFNAMES];
|
||||
static int max_devname_len; /* to prevent frazzled device name output */
|
||||
static const int canfd_on = 1;
|
||||
|
|
@ -175,7 +175,6 @@ static void sigterm(int signo)
|
|||
|
||||
static int idx2dindex(int ifidx, int socket)
|
||||
{
|
||||
|
||||
int i;
|
||||
struct ifreq ifr;
|
||||
|
||||
|
|
@ -474,8 +473,8 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
for (i = 0; i < currmax; i++) {
|
||||
struct if_info* obj = &sock_info[i];
|
||||
ptr = argv[optind+i];
|
||||
struct if_info *obj = &sock_info[i];
|
||||
ptr = argv[optind + i];
|
||||
nptr = strchr(ptr, ',');
|
||||
|
||||
pr_debug("open %d '%s'.\n", i, ptr);
|
||||
|
|
@ -715,7 +714,7 @@ int main(int argc, char **argv)
|
|||
}
|
||||
|
||||
for (i = 0; i < num_events; i++) { /* check waiting CAN RAW sockets */
|
||||
struct if_info* obj = events_pending[i].data.ptr;
|
||||
struct if_info *obj = events_pending[i].data.ptr;
|
||||
int idx;
|
||||
char *extra_info = "";
|
||||
|
||||
|
|
@ -838,9 +837,9 @@ int main(int argc, char **argv)
|
|||
|
||||
if (extra_msg_info) {
|
||||
if (msg.msg_flags & MSG_DONTROUTE)
|
||||
printf (" TX %s", extra_m_info[frame.flags & 3]);
|
||||
printf(" TX %s", extra_m_info[frame.flags & 3]);
|
||||
else
|
||||
printf (" RX %s", extra_m_info[frame.flags & 3]);
|
||||
printf(" RX %s", extra_m_info[frame.flags & 3]);
|
||||
}
|
||||
|
||||
printf("%s ", (color == 1) ? col_off : "");
|
||||
|
|
@ -850,7 +849,7 @@ int main(int argc, char **argv)
|
|||
printf("%s", (color > 1) ? col_off : "");
|
||||
printf("\n");
|
||||
|
||||
out_fflush:
|
||||
out_fflush:
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue