diff options
author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-10-07 18:41:59 -0400 |
---|---|---|
committer | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2009-10-14 17:10:48 -0400 |
commit | 8e85973efc87dfae8508f1a3440fd44612897458 (patch) | |
tree | 9b8f0f0d1adf5a2611b58565db4d9da0ebd1cc9c /include/linux/firewire.h | |
parent | e21fcf798e246202d7b60e864f1d7302ebaaf41c (diff) |
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>
Diffstat (limited to 'include/linux/firewire.h')
-rw-r--r-- | include/linux/firewire.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 7e1d4dec83e7..53b9217de86c 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -20,20 +20,6 @@ | |||
20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) | 20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) |
21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) | 21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) |
22 | 22 | ||
23 | static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size) | ||
24 | { | ||
25 | u32 *dst = _dst; | ||
26 | __be32 *src = _src; | ||
27 | int i; | ||
28 | |||
29 | for (i = 0; i < size / 4; i++) | ||
30 | dst[i] = be32_to_cpu(src[i]); | ||
31 | } | ||
32 | |||
33 | static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size) | ||
34 | { | ||
35 | fw_memcpy_from_be32(_dst, _src, size); | ||
36 | } | ||
37 | #define CSR_REGISTER_BASE 0xfffff0000000ULL | 23 | #define CSR_REGISTER_BASE 0xfffff0000000ULL |
38 | 24 | ||
39 | /* register offsets are relative to CSR_REGISTER_BASE */ | 25 | /* register offsets are relative to CSR_REGISTER_BASE */ |