omit extra sets and clears
old code does extra sets and clears in case of quiet==1 so I've changed if statement orders and used else ifpull/50/head
parent
1ae8714d0d
commit
c45ee0cdbe
|
|
@ -265,7 +265,10 @@ int main(int argc, char **argv)
|
|||
exit(0);
|
||||
}
|
||||
|
||||
if (mask || value) {
|
||||
if (quiet)
|
||||
for (i = 0; i < 2048; i++)
|
||||
do_clr(i, ENABLE);
|
||||
else if (mask || value) {
|
||||
for (i=0; i < 2048 ;i++) {
|
||||
if ((i & mask) == (value & mask))
|
||||
do_set(i, ENABLE);
|
||||
|
|
@ -274,10 +277,6 @@ int main(int argc, char **argv)
|
|||
}
|
||||
}
|
||||
|
||||
if (quiet)
|
||||
for (i=0; i < 2048 ;i++)
|
||||
do_clr(i, ENABLE);
|
||||
|
||||
if (strlen(argv[optind]) >= IFNAMSIZ) {
|
||||
printf("name of CAN device '%s' is too long!\n", argv[optind]);
|
||||
return 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue