Skip to content

Commit

Permalink
usb/c67x00 endianness annotations
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Al Viro authored and Linus Torvalds committed Jun 4, 2008
1 parent a064d5b commit 76e6f25
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/usb/c67x00/c67x00-ll-hpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static void hpi_write_word(struct c67x00_device *dev, u16 reg, u16 value)
* Only data is little endian, addr has cpu endianess
*/
static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr,
u16 *data, u16 count)
__le16 *data, u16 count)
{
unsigned long flags;
int i;
Expand All @@ -129,7 +129,7 @@ static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr,

hpi_write_reg(dev, HPI_ADDR, addr);
for (i = 0; i < count; i++)
hpi_write_reg(dev, HPI_DATA, cpu_to_le16(*data++));
hpi_write_reg(dev, HPI_DATA, le16_to_cpu(*data++));

spin_unlock_irqrestore(&dev->hpi.lock, flags);
}
Expand All @@ -138,15 +138,15 @@ static void hpi_write_words_le16(struct c67x00_device *dev, u16 addr,
* Only data is little endian, addr has cpu endianess
*/
static void hpi_read_words_le16(struct c67x00_device *dev, u16 addr,
u16 *data, u16 count)
__le16 *data, u16 count)
{
unsigned long flags;
int i;

spin_lock_irqsave(&dev->hpi.lock, flags);
hpi_write_reg(dev, HPI_ADDR, addr);
for (i = 0; i < count; i++)
*data++ = le16_to_cpu(hpi_read_reg(dev, HPI_DATA));
*data++ = cpu_to_le16(hpi_read_reg(dev, HPI_DATA));

spin_unlock_irqrestore(&dev->hpi.lock, flags);
}
Expand Down Expand Up @@ -425,7 +425,7 @@ void c67x00_ll_write_mem_le16(struct c67x00_device *dev, u16 addr,
len--;
}

hpi_write_words_le16(dev, addr, (u16 *)buf, len / 2);
hpi_write_words_le16(dev, addr, (__le16 *)buf, len / 2);
buf += len & ~0x01;
addr += len & ~0x01;
len &= 0x01;
Expand Down Expand Up @@ -456,7 +456,7 @@ void c67x00_ll_read_mem_le16(struct c67x00_device *dev, u16 addr,
len--;
}

hpi_read_words_le16(dev, addr, (u16 *)buf, len / 2);
hpi_read_words_le16(dev, addr, (__le16 *)buf, len / 2);
buf += len & ~0x01;
addr += len & ~0x01;
len &= 0x01;
Expand Down

0 comments on commit 76e6f25

Please sign in to comment.