mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-04 22:09:57 +02:00
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 if
This commit is contained in:
+4
-5
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user