aboutsummaryrefslogtreecommitdiff
path: root/src/crc32.c
diff options
context:
space:
mode:
authorGareth McMullin2015-03-28 20:47:17 -0700
committerGareth McMullin2015-03-28 20:47:17 -0700
commit9f271d5cd7c51251ec5e90a986f6f70a3fff75d8 (patch)
treeda33c45f5fceb6a5bbc3475740a0197bc78042b5 /src/crc32.c
parent1e54139f4a45d379c1cda7ad02a3f4a7d321b78e (diff)
Consistently use 'target *t' for target var.
Diffstat (limited to 'src/crc32.c')
-rw-r--r--src/crc32.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/crc32.c b/src/crc32.c
index e8a046d..6f1c0e3 100644
--- a/src/crc32.c
+++ b/src/crc32.c
@@ -94,13 +94,13 @@ uint32_t crc32_calc(uint32_t crc, uint8_t data)
return (crc << 8) ^ crc32_table[((crc >> 24) ^ data) & 255];
}
-uint32_t generic_crc32(struct target_s *target, uint32_t base, int len)
+uint32_t generic_crc32(target *t, uint32_t base, int len)
{
uint32_t crc = -1;
uint8_t byte;
while (len--) {
- byte = target_mem_read8(target, base);
+ byte = target_mem_read8(t, base);
crc = crc32_calc(crc, byte);
base++;
@@ -109,7 +109,7 @@ uint32_t generic_crc32(struct target_s *target, uint32_t base, int len)
}
#else
#include <libopencm3/stm32/crc.h>
-uint32_t generic_crc32(struct target_s *target, uint32_t base, int len)
+uint32_t generic_crc32(target *t, uint32_t base, int len)
{
uint32_t data;
uint32_t crc;
@@ -118,7 +118,7 @@ uint32_t generic_crc32(struct target_s *target, uint32_t base, int len)
CRC_CR |= CRC_CR_RESET;
while (len > 3) {
- data = target_mem_read32(target, base);
+ data = target_mem_read32(t, base);
CRC_DR = __builtin_bswap32(data);
base += 4;
@@ -128,7 +128,7 @@ uint32_t generic_crc32(struct target_s *target, uint32_t base, int len)
crc = CRC_DR;
while (len--) {
- data = target_mem_read8(target, base++);
+ data = target_mem_read8(t, base++);
crc ^= data << 24;
for (i = 0; i < 8; i++) {