msm: vidc: Refactor macro
Previously, the usage of the venus_hfi_for_each_thing was awkward,
forcing the user to pass in the executable codeblock as an argument.
This had two problems:
1) It hit a limitation in the C-preprocessor. If the given code
block contained a ',' (which is common and valid), the
preprocessor would consider it to be a separate argument to the
macro, which in turn would cause compile errors.
e.g. _for_each_xxx(device, xxx, {int a, b;}) would be parsed by
the preprocessor as _for_each_xxx((device), (xxx), ({int a),
(b;}))
2) More importantly, it didn't look good
To overcome this limitation, re-write the macro to be more in line with
macros such as list_for_each(), which doesn't require the codeblock to
be passed in as an argument.
Change-Id: I584300b0a592a6c3665cf526175876871e800bf5
Signed-off-by:
Deva Ramasubramanian <dramasub@codeaurora.org>
Loading
Please register or sign in to comment