firewire: optimize config ROM creation
authorStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 7 Oct 2009 22:41:59 +0000 (00:41 +0200)
committerStefan Richter <stefanr@s5r6.in-berlin.de>
Wed, 14 Oct 2009 21:10:48 +0000 (23:10 +0200)
commit8e85973efc87dfae8508f1a3440fd44612897458
tree9b8f0f0d1adf5a2611b58565db4d9da0ebd1cc9c
parente21fcf798e246202d7b60e864f1d7302ebaaf41c
firewire: optimize config ROM creation

The config ROM image of the local node was created in CPU byte order,
then a temporary big endian copy was created to compute the CRC, and
finally the card driver created its own big endian copy.

We now generate it in big endian byte order in the first place to avoid
one byte order conversion and the temporary on-stack copy of the ROM
image (1000 bytes stack usage in process context).  Furthermore, two
1000 bytes memset()s are replaced by one 1000 bytes - ROM length sized
memset.

The trivial fw_memcpy_{from,to}_be32() helpers are now superfluous and
removed.  The newly added __compute_block_crc() function will be folded
into fw_compute_block_crc() in a subsequent change.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
drivers/firewire/core-card.c
drivers/firewire/core.h
drivers/firewire/ohci.c
include/linux/firewire.h