core: Introduce list iteration helpers
The syntax for traversing over lists is somewhat cluttered. It could be
made much better with the use of the 'typeof' keyword, but unfortunately
this is not universally supported by all compilers. We can, however,
improve the situation by introducing some macros for the common cases.
To that end, this commit introduces a number of 'for_each' macros that
iterate over a specific linked list.
Current syntax:
list_for_each_entry(itransfer, &ctx->flying_transfers, list, struct usbi_transfer)
New syntax:
for_each_transfer(ctx, itransfer)
Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>