Refactor subblock iterators.
authorPekka Pessi <Pekka.Pessi@nokia.com>
Thu, 8 Oct 2009 16:47:15 +0000 (19:47 +0300)
committerAki Niemi <aki.niemi@nokia.com>
Fri, 9 Oct 2009 09:54:04 +0000 (12:54 +0300)
commitd1d870ba7a037773ae731a21b9707df8dcb47992
tree793bcae692a3e9aab6f1839b0a762a702cd04cf8
parent8778826638d3f563b7a26746f05e2d0c47a9e238
Refactor subblock iterators.

Always initialize iterators.

Try to avoid pointer arithmetics on NULL; in other words, move all pointer
arithmetics inside g_isi_sb_iter_init().

There are 4 different ways for representing sub blocks in ISI message:
- 8-bit sub_blocks count, 8-bit sub_block_id/sub_block_len
- 16-bit sub_blocks count, 8-bit sub_block_id/sub_block_len
- 8-bit sub_blocks count, 16-bit sub_block_id/sub_block_len
- 16-bit sub_blocks count, 16-bit sub_block_id/sub_block_len

The compact form g_isi_sb_iter_init() supports 8-bit sub_block count before
start of the sub blocks themselves and 8-bit sub_block_id and sub_block_len.
The full form g_isi_sb_iter_init_full() with explicit longhdr and sub_block
count supports all other cases.
AUTHORS
drivers/isimodem/devinfo.c
drivers/isimodem/network-registration.c
drivers/isimodem/phonebook.c
gisi/iter.c
gisi/iter.h