diff options
Diffstat (limited to 'drivers/staging/fbtft/fbtft-bus.c')
-rw-r--r-- | drivers/staging/fbtft/fbtft-bus.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/fbtft/fbtft-bus.c b/drivers/staging/fbtft/fbtft-bus.c index 58449ad84..83505bce6 100644 --- a/drivers/staging/fbtft/fbtft-bus.c +++ b/drivers/staging/fbtft/fbtft-bus.c @@ -125,7 +125,7 @@ EXPORT_SYMBOL(fbtft_write_reg8_bus9); int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) { u16 *vmem16; - u16 *txbuf16 = (u16 *)par->txbuf.buf; + u16 *txbuf16 = par->txbuf.buf; size_t remain; size_t to_copy; size_t tx_array_size; @@ -150,14 +150,14 @@ int fbtft_write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) tx_array_size = par->txbuf.len / 2; if (par->startbyte) { - txbuf16 = (u16 *)(par->txbuf.buf + 1); + txbuf16 = par->txbuf.buf + 1; tx_array_size -= 2; *(u8 *)(par->txbuf.buf) = par->startbyte | 0x2; startbyte_size = 1; } while (remain) { - to_copy = remain > tx_array_size ? tx_array_size : remain; + to_copy = min(tx_array_size, remain); dev_dbg(par->info->device, " to_copy=%zu, remain=%zu\n", to_copy, remain - to_copy); @@ -201,7 +201,7 @@ int fbtft_write_vmem16_bus9(struct fbtft_par *par, size_t offset, size_t len) tx_array_size = par->txbuf.len / 2; while (remain) { - to_copy = remain > tx_array_size ? tx_array_size : remain; + to_copy = min(tx_array_size, remain); dev_dbg(par->info->device, " to_copy=%zu, remain=%zu\n", to_copy, remain - to_copy); |