summaryrefslogtreecommitdiffstats
path: root/discover/event.h
diff options
context:
space:
mode:
authorJeremy Kerr <jk@ozlabs.org>2013-03-05 13:49:15 +0800
committerGeoff Levand <geoff@infradead.org>2013-03-05 06:06:17 -0800
commit0fdc5cc3f296db134729fe58e074c20084b99459 (patch)
tree097c3d31633d6588416fd56873ab869633ff23e6 /discover/event.h
parent6d51866f409e90274ff8cfb06b92a6c828692698 (diff)
downloadpetitboot-0fdc5cc3f296db134729fe58e074c20084b99459.zip
petitboot-0fdc5cc3f296db134729fe58e074c20084b99459.tar.gz
discover: simplify handler switch statement
Instead of using nested switch statements in device_handler_event, define an array of handlers, and lookup instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
Diffstat (limited to 'discover/event.h')
-rw-r--r--discover/event.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/discover/event.h b/discover/event.h
index 20585f2..91575cc 100644
--- a/discover/event.h
+++ b/discover/event.h
@@ -4,11 +4,13 @@
enum event_type {
EVENT_TYPE_UDEV = 10,
EVENT_TYPE_USER,
+ EVENT_TYPE_MAX,
};
enum event_action {
EVENT_ACTION_ADD = 20,
EVENT_ACTION_REMOVE,
+ EVENT_ACTION_MAX,
};
struct event {
OpenPOWER on IntegriCloud