diff options
author | Steve Glendinning <steve.glendinning@smsc.com> | 2011-09-07 05:34:06 -0400 |
---|---|---|
committer | Florian Tobias Schandinat <FlorianSchandinat@gmx.de> | 2011-09-14 13:04:21 -0400 |
commit | be444890c82a150d137c75cac8c7f3c5b02b7748 (patch) | |
tree | 89f15ad6dc39943f5d8c55a5b78b3853085ca939 /drivers/video/smscufx.c | |
parent | 21b5a3adf9d16a4eb9874b32cfc84af34f697c1d (diff) |
smscufx: reduce number of casts in ufx_raw_rect
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video/smscufx.c')
-rw-r--r-- | drivers/video/smscufx.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c index c6b86e7beb98..44c8cab31a01 100644 --- a/drivers/video/smscufx.c +++ b/drivers/video/smscufx.c | |||
@@ -807,7 +807,7 @@ static int ufx_ops_mmap(struct fb_info *info, struct vm_area_struct *vma) | |||
807 | return 0; | 807 | return 0; |
808 | } | 808 | } |
809 | 809 | ||
810 | static void ufx_raw_rect(struct ufx_data *dev, char *cmd, int x, int y, | 810 | static void ufx_raw_rect(struct ufx_data *dev, u16 *cmd, int x, int y, |
811 | int width, int height) | 811 | int width, int height) |
812 | { | 812 | { |
813 | size_t packed_line_len = ALIGN((width * 2), 4); | 813 | size_t packed_line_len = ALIGN((width * 2), 4); |
@@ -821,27 +821,27 @@ static void ufx_raw_rect(struct ufx_data *dev, char *cmd, int x, int y, | |||
821 | *((u32 *)&cmd[0]) = cpu_to_le32(0x01); | 821 | *((u32 *)&cmd[0]) = cpu_to_le32(0x01); |
822 | 822 | ||
823 | /* length word */ | 823 | /* length word */ |
824 | *((u32 *)&cmd[4]) = cpu_to_le32(packed_rect_len + 16); | 824 | *((u32 *)&cmd[2]) = cpu_to_le32(packed_rect_len + 16); |
825 | 825 | ||
826 | *((u16 *)&cmd[8]) = cpu_to_le16(x); | 826 | cmd[4] = cpu_to_le16(x); |
827 | *((u16 *)&cmd[10]) = cpu_to_le16(y); | 827 | cmd[5] = cpu_to_le16(y); |
828 | *((u16 *)&cmd[12]) = cpu_to_le16(width); | 828 | cmd[6] = cpu_to_le16(width); |
829 | *((u16 *)&cmd[14]) = cpu_to_le16(height); | 829 | cmd[7] = cpu_to_le16(height); |
830 | 830 | ||
831 | /* frame base address */ | 831 | /* frame base address */ |
832 | *((u32 *)&cmd[16]) = cpu_to_le32(0 & 0xffffff80); | 832 | *((u32 *)&cmd[8]) = cpu_to_le32(0); |
833 | 833 | ||
834 | /* color mode and horizontal resolution */ | 834 | /* color mode and horizontal resolution */ |
835 | *((u16 *)&cmd[20]) = cpu_to_le16(0x4000 | dev->info->var.xres); | 835 | cmd[10] = cpu_to_le16(0x4000 | dev->info->var.xres); |
836 | 836 | ||
837 | /* vertical resolution */ | 837 | /* vertical resolution */ |
838 | *((u16 *)&cmd[22]) = cpu_to_le16(dev->info->var.yres); | 838 | cmd[11] = cpu_to_le16(dev->info->var.yres); |
839 | 839 | ||
840 | /* packed data */ | 840 | /* packed data */ |
841 | for (line = 0; line < height; line++) { | 841 | for (line = 0; line < height; line++) { |
842 | const int line_offset = dev->info->fix.line_length * (y + line); | 842 | const int line_offset = dev->info->fix.line_length * (y + line); |
843 | const int byte_offset = line_offset + (x * BPP); | 843 | const int byte_offset = line_offset + (x * BPP); |
844 | memcpy(&cmd[24 + (packed_line_len * line)], | 844 | memcpy(&cmd[(24 + (packed_line_len * line)) / 2], |
845 | (char *)dev->info->fix.smem_start + byte_offset, width * BPP); | 845 | (char *)dev->info->fix.smem_start + byte_offset, width * BPP); |
846 | } | 846 | } |
847 | } | 847 | } |