diff options
author | Ohad Ben-Cohen | 2012-01-31 16:07:27 +0200 |
---|---|---|
committer | Ohad Ben-Cohen | 2012-02-22 18:28:49 +0200 |
commit | e12bc14b88d44e5c1456dccb59ff58103f6c6edc (patch) | |
tree | c7df21efc8f6f3649a35c16b01e90c16ce51d49a /include/linux/remoteproc.h | |
parent | cf59d3e9a715fd2b6ff96e4a3a130fceded09a64 (diff) |
remoteproc: s/big switch/lookup table/
A lookup table would be easier to extend, and the resulting
code is a bit cleaner.
Reported-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Diffstat (limited to 'include/linux/remoteproc.h')
-rw-r--r-- | include/linux/remoteproc.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index b52f78413c5c..ada4cb063dfe 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -103,6 +103,7 @@ struct fw_resource { * the virtio device features, 'pa' holds the virtio guest * features, 'len' holds the virtio status, and 'flags' holds * the virtio id (currently only VIRTIO_ID_RPMSG is supported). + * @RSC_LAST: just keep this one at the end * * Most of the resource entries share the basic idea of address/length * negotiation with the host: the firmware usually asks (on behalf of the @@ -115,6 +116,11 @@ struct fw_resource { * will contain the expected device addresses (today we actually only support * this scheme, as there aren't yet any use cases for dynamically allocated * device addresses). + * + * Please note that these values are used as indices to the rproc_handle_rsc + * lookup table, so please keep them sane. Moreover, @RSC_LAST is used to + * check the validity of an index before the lookup table is accessed, so + * please update it as needed. */ enum fw_resource_type { RSC_CARVEOUT = 0, @@ -122,6 +128,7 @@ enum fw_resource_type { RSC_TRACE = 2, RSC_VRING = 3, RSC_VIRTIO_DEV = 4, + RSC_LAST = 5, }; /** |