Loading drivers/ieee1394/csr1212.c +9 −18 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ */ */ #include <linux/errno.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/string.h> #include <asm/bug.h> #include <asm/bug.h> #include <asm/byteorder.h> #include <asm/byteorder.h> Loading Loading @@ -113,10 +114,7 @@ static u16 csr1212_crc16(const u32 *buffer, size_t length) return cpu_to_be16(crc); return cpu_to_be16(crc); } } #if 0 /* Microsoft computes the CRC with the bytes in reverse order. */ /* Microsoft computes the CRC with the bytes in reverse order. Therefore we * have a special version of the CRC algorithm to account for their buggy * software. */ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) { { int shift; int shift; Loading @@ -135,7 +133,6 @@ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) return cpu_to_be16(crc); return cpu_to_be16(crc); } } #endif static struct csr1212_dentry * static struct csr1212_dentry * csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) Loading Loading @@ -1096,13 +1093,11 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr) return ret; return ret; } } #if 0 /* Apparently there are many different wrong implementations of the CRC /* Apparently there are too many differnt wrong implementations of the * algorithm. We don't fail, we just warn. */ * CRC algorithm that verifying them is moot. */ if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) return -EINVAL; printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); #endif cr = CSR1212_MALLOC(sizeof(*cr)); cr = CSR1212_MALLOC(sizeof(*cr)); if (!cr) if (!cr) Loading Loading @@ -1207,15 +1202,11 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, &cache->data[bytes_to_quads(kv->offset - cache->offset)]; &cache->data[bytes_to_quads(kv->offset - cache->offset)]; kvi_len = be16_to_cpu(kvi->length); kvi_len = be16_to_cpu(kvi->length); #if 0 /* Apparently there are many different wrong implementations of the CRC /* Apparently there are too many differnt wrong implementations of the * algorithm. We don't fail, we just warn. */ * CRC algorithm that verifying them is moot. */ if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) { (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) ret = -EINVAL; printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); goto out; } #endif switch (kv->key.type) { switch (kv->key.type) { case CSR1212_KV_TYPE_DIRECTORY: case CSR1212_KV_TYPE_DIRECTORY: Loading Loading
drivers/ieee1394/csr1212.c +9 −18 Original line number Original line Diff line number Diff line Loading @@ -34,6 +34,7 @@ */ */ #include <linux/errno.h> #include <linux/errno.h> #include <linux/kernel.h> #include <linux/string.h> #include <linux/string.h> #include <asm/bug.h> #include <asm/bug.h> #include <asm/byteorder.h> #include <asm/byteorder.h> Loading Loading @@ -113,10 +114,7 @@ static u16 csr1212_crc16(const u32 *buffer, size_t length) return cpu_to_be16(crc); return cpu_to_be16(crc); } } #if 0 /* Microsoft computes the CRC with the bytes in reverse order. */ /* Microsoft computes the CRC with the bytes in reverse order. Therefore we * have a special version of the CRC algorithm to account for their buggy * software. */ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) { { int shift; int shift; Loading @@ -135,7 +133,6 @@ static u16 csr1212_msft_crc16(const u32 *buffer, size_t length) return cpu_to_be16(crc); return cpu_to_be16(crc); } } #endif static struct csr1212_dentry * static struct csr1212_dentry * csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) csr1212_find_keyval(struct csr1212_keyval *dir, struct csr1212_keyval *kv) Loading Loading @@ -1096,13 +1093,11 @@ static int csr1212_parse_bus_info_block(struct csr1212_csr *csr) return ret; return ret; } } #if 0 /* Apparently there are many different wrong implementations of the CRC /* Apparently there are too many differnt wrong implementations of the * algorithm. We don't fail, we just warn. */ * CRC algorithm that verifying them is moot. */ if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && if ((csr1212_crc16(bi->data, bi->crc_length) != bi->crc) && (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) (csr1212_msft_crc16(bi->data, bi->crc_length) != bi->crc)) return -EINVAL; printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); #endif cr = CSR1212_MALLOC(sizeof(*cr)); cr = CSR1212_MALLOC(sizeof(*cr)); if (!cr) if (!cr) Loading Loading @@ -1207,15 +1202,11 @@ int csr1212_parse_keyval(struct csr1212_keyval *kv, &cache->data[bytes_to_quads(kv->offset - cache->offset)]; &cache->data[bytes_to_quads(kv->offset - cache->offset)]; kvi_len = be16_to_cpu(kvi->length); kvi_len = be16_to_cpu(kvi->length); #if 0 /* Apparently there are many different wrong implementations of the CRC /* Apparently there are too many differnt wrong implementations of the * algorithm. We don't fail, we just warn. */ * CRC algorithm that verifying them is moot. */ if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && if ((csr1212_crc16(kvi->data, kvi_len) != kvi->crc) && (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) { (csr1212_msft_crc16(kvi->data, kvi_len) != kvi->crc)) ret = -EINVAL; printk(KERN_DEBUG "IEEE 1394 device has ROM CRC error\n"); goto out; } #endif switch (kv->key.type) { switch (kv->key.type) { case CSR1212_KV_TYPE_DIRECTORY: case CSR1212_KV_TYPE_DIRECTORY: Loading