summaryrefslogtreecommitdiffstats
path: root/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'firmware')
-rw-r--r--firmware/target/arm/sandisk/sansa-e200/ata-e200.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/firmware/target/arm/sandisk/sansa-e200/ata-e200.c b/firmware/target/arm/sandisk/sansa-e200/ata-e200.c
index b94363e6b1..bfb0d27f97 100644
--- a/firmware/target/arm/sandisk/sansa-e200/ata-e200.c
+++ b/firmware/target/arm/sandisk/sansa-e200/ata-e200.c
@@ -267,27 +267,14 @@ static void copy_write_sectors(const unsigned char* buf, int wordcount)
static void copy_write_sectors(const unsigned char* buf, int wordcount)
{
- if ( (unsigned long)buf & 1)
- { /* not 16-bit aligned, copy byte by byte */
- unsigned short tmp = 0;
- const unsigned char* bufend = buf + wordcount*2;
- do
- {
- tmp = (unsigned short) *buf++;
- tmp |= (unsigned short) *buf++ << 8;
- DATA_REG = tmp;
- } while (buf < bufend); /* tail loop is faster */
- }
- else
- { /* 16-bit aligned, can do faster copy */
- unsigned short* wbuf = (unsigned short*)buf;
- unsigned short* wbufend = wbuf + wordcount;
- do
- {
- DATA_REG = *wbuf;
- asm volatile("nop\n\t");
- } while (++wbuf < wbufend); /* tail loop is faster */
- }
+ unsigned short tmp = 0;
+ const unsigned char* bufend = buf + wordcount*2;
+ do
+ {
+ tmp = (unsigned short) *buf++;
+ tmp |= (unsigned short) *buf++ << 8;
+ DATA_REG = tmp;
+ } while (buf < bufend); /* tail loop is faster */
}