summaryrefslogtreecommitdiff
path: root/udev
diff options
context:
space:
mode:
authorAlan Jenkins <alan-jenkins@tuffmail.co.uk>2008-10-28 08:58:18 +0000
committerKay Sievers <kay.sievers@vrfy.org>2008-10-28 10:02:43 +0100
commit6270756cdca967adce6badaf1360d872a0907bf0 (patch)
treef7d0ead54e50957946970bdd9de671783b8184e5 /udev
parent65807d09ecc2f09d7643b9c2f3e9c89358304fab (diff)
udevd: simplify rules execution loop
cur can't become NULL, and the check for TK_END can be folded into the switch statement. Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Diffstat (limited to 'udev')
-rw-r--r--udev/udev-rules.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index a6f9220352..665ad71e80 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -1843,7 +1843,7 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
/* loop through token list, match, run actions or forward to next rule */
cur = &rules->tokens[0];
rule = cur;
- while (cur != NULL && cur->type != TK_END) {
+ while (1) {
unsigned int idx;
dump_token(rules, cur);
@@ -2319,11 +2319,11 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event
cur = &rules->tokens[cur->key.rule_goto];
continue;
case TK_A_LAST_RULE:
+ case TK_END:
break;
case TK_M_PARENTS_MAX:
case TK_M_MAX:
- case TK_END:
case TK_UNSET:
err(rules->udev, "wrong type %u\n", cur->type);
goto nomatch;