Skip to content

Commit

Permalink
cli: Fix a 'events -r' issue
Browse files Browse the repository at this point in the history
It was observed that the option '-r' doesn't take effect unless the
option '-a' is specified at the same time. The option '-a' should only
control the showing of events and has no control for clearing. Fix this
to allow option '-r' clear all events no matter if option '-a' is
specified.
  • Loading branch information
kelvin-cao committed Sep 8, 2023
1 parent bec25ec commit 228b239
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cli/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -796,9 +796,6 @@ static int get_events(struct switchtec_dev *dev,
break;
}

if (!show_all && e->partition != local_part)
continue;

if (clear_all || event_id & (1 << e->eid))
flags = SWITCHTEC_EVT_FLAG_CLEAR;
else
Expand All @@ -810,6 +807,9 @@ static int get_events(struct switchtec_dev *dev,
return -1;
}

if (!show_all && e->partition != local_part)
continue;

e->count = ret;
e++;
if (e - elist > elist_len)
Expand Down

0 comments on commit 228b239

Please sign in to comment.