staging: fbtft: fixed format-string errors.

Added __printf attribute to declaration of fbtft_dbg_hex and fixed
mismatches between format-specifiers and arguments in several function
calls.

Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Jeremy Sowden 2019-03-08 08:49:51 +00:00 committed by Greg Kroah-Hartman
parent df9ce52c8a
commit 27a0eb8fb6
5 changed files with 10 additions and 9 deletions

View File

@ -406,7 +406,7 @@ static int write_vmem(struct fbtft_par *par, size_t offset, size_t len)
static int write(struct fbtft_par *par, void *buf, size_t len) static int write(struct fbtft_par *par, void *buf, size_t len)
{ {
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
gpiod_set_value(par->RW, 0); /* set write mode */ gpiod_set_value(par->RW, 0); /* set write mode */

View File

@ -24,7 +24,7 @@ static int write_spi(struct fbtft_par *par, void *buf, size_t len)
struct spi_message m; struct spi_message m;
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
if (!par->spi) { if (!par->spi) {
dev_err(par->info->device, dev_err(par->info->device,

View File

@ -14,7 +14,7 @@ int fbtft_write_spi(struct fbtft_par *par, void *buf, size_t len)
struct spi_message m; struct spi_message m;
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
if (!par->spi) { if (!par->spi) {
dev_err(par->info->device, dev_err(par->info->device,
@ -47,7 +47,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len)
u64 val, dc, tmp; u64 val, dc, tmp;
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
if (!par->extra) { if (!par->extra) {
dev_err(par->info->device, "%s: error: par->extra is NULL\n", dev_err(par->info->device, "%s: error: par->extra is NULL\n",
@ -109,7 +109,7 @@ int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len)
txbuf[0] = par->startbyte | 0x3; txbuf[0] = par->startbyte | 0x3;
t.tx_buf = txbuf; t.tx_buf = txbuf;
fbtft_par_dbg_hex(DEBUG_READ, par, par->info->device, u8, fbtft_par_dbg_hex(DEBUG_READ, par, par->info->device, u8,
txbuf, len, "%s(len=%d) txbuf => ", txbuf, len, "%s(len=%zu) txbuf => ",
__func__, len); __func__, len);
} }
@ -117,7 +117,7 @@ int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len)
spi_message_add_tail(&t, &m); spi_message_add_tail(&t, &m);
ret = spi_sync(par->spi, &m); ret = spi_sync(par->spi, &m);
fbtft_par_dbg_hex(DEBUG_READ, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_READ, par, par->info->device, u8, buf, len,
"%s(len=%d) buf <= ", __func__, len); "%s(len=%zu) buf <= ", __func__, len);
return ret; return ret;
} }
@ -136,7 +136,7 @@ int fbtft_write_gpio8_wr(struct fbtft_par *par, void *buf, size_t len)
#endif #endif
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
while (len--) { while (len--) {
data = *(u8 *)buf; data = *(u8 *)buf;
@ -186,7 +186,7 @@ int fbtft_write_gpio16_wr(struct fbtft_par *par, void *buf, size_t len)
#endif #endif
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
while (len) { while (len) {
data = *(u16 *)buf; data = *(u16 *)buf;

View File

@ -238,6 +238,7 @@ struct fbtft_par {
/* fbtft-core.c */ /* fbtft-core.c */
int fbtft_write_buf_dc(struct fbtft_par *par, void *buf, size_t len, int dc); int fbtft_write_buf_dc(struct fbtft_par *par, void *buf, size_t len, int dc);
__printf(5, 6)
void fbtft_dbg_hex(const struct device *dev, int groupsize, void fbtft_dbg_hex(const struct device *dev, int groupsize,
void *buf, size_t len, const char *fmt, ...); void *buf, size_t len, const char *fmt, ...);
struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display, struct fb_info *fbtft_framebuffer_alloc(struct fbtft_display *display,

View File

@ -965,7 +965,7 @@ static int write_gpio16_wr_slow(struct fbtft_par *par, void *buf, size_t len)
#endif #endif
fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len, fbtft_par_dbg_hex(DEBUG_WRITE, par, par->info->device, u8, buf, len,
"%s(len=%d): ", __func__, len); "%s(len=%zu): ", __func__, len);
while (len) { while (len) {
data = *(u16 *)buf; data = *(u16 *)buf;