notro / fbtft

Linux Framebuffer drivers for small TFT LCD display modules. Development has moved to https://git.kernel.org/cgit/linux/kernel/git/gregkh/staging.git/tree/drivers/staging/fbtft?h=staging-testing
1.86k stars 495 forks source link

Data alignment issue in fbtft-bus.c when using startbyte #88

Closed notro closed 3 years ago

notro commented 10 years ago

When using a startbyte txbuf16 gets unaligned. This can prevent the code from being portable to other platforms or degrade performance.

fbtft-bus.c

int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len)
{
[...]
    u16 *txbuf16 = (u16 *)par->txbuf.buf;
[...]
    if (par->startbyte) {
        txbuf16 = (u16 *)(par->txbuf.buf + 1);
[...]
    }

    while (remain) {
[...]
        for (i = 0; i < to_copy; i++)
            txbuf16[i] = cpu_to_be16(vmem16[i]);

Thanks to Conor O'Rourke for making me aware of this issue.

Links:

github-actions[bot] commented 3 years ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days.