diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-16 17:46:28 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-09-18 12:23:40 +0200 |
commit | 0d586255ca647ba8f5d7f0210d1516f942e5b43b (patch) | |
tree | 70d620ae99b301164a75ba4a5126f2d6c594982d /drivers/staging/fbtft | |
parent | c5bf8914024ed00b8121ac64a61d49d3cc13d64c (diff) | |
download | linux-stable-0d586255ca647ba8f5d7f0210d1516f942e5b43b.tar.gz linux-stable-0d586255ca647ba8f5d7f0210d1516f942e5b43b.tar.bz2 linux-stable-0d586255ca647ba8f5d7f0210d1516f942e5b43b.zip |
staging: fbtft: remove redundant initialization of txbuf16
txbuf16 is being initialized at declaration time and then later
set to another value without it being read inbetween, hence making
the initialization redundant. Fix this by setting txbuf16 just
the once. Also clean up some incorrect indentations. Cleans up
clang build warning:
warning: Value stored to 'txbuf16' during its initialization is never read
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/fbtft')
-rw-r--r-- | drivers/staging/fbtft/fb_ra8875.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/staging/fbtft/fb_ra8875.c b/drivers/staging/fbtft/fb_ra8875.c index a899614ce829..6d1cad85957b 100644 --- a/drivers/staging/fbtft/fb_ra8875.c +++ b/drivers/staging/fbtft/fb_ra8875.c @@ -253,7 +253,7 @@ static void write_reg8_bus8(struct fbtft_par *par, int len, ...) static int write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) { u16 *vmem16; - __be16 *txbuf16 = par->txbuf.buf; + __be16 *txbuf16; size_t remain; size_t to_copy; size_t tx_array_size; @@ -267,10 +267,10 @@ static int write_vmem16_bus8(struct fbtft_par *par, size_t offset, size_t len) remain = len / 2; vmem16 = (u16 *)(par->info->screen_buffer + offset); tx_array_size = par->txbuf.len / 2; - txbuf16 = par->txbuf.buf + 1; - tx_array_size -= 2; - *(u8 *)(par->txbuf.buf) = 0x00; - startbyte_size = 1; + txbuf16 = par->txbuf.buf + 1; + tx_array_size -= 2; + *(u8 *)(par->txbuf.buf) = 0x00; + startbyte_size = 1; while (remain) { to_copy = min(tx_array_size, remain); |