staging: fbtft: fix all print warnings reported by sparse
Subsystems (2)
PATCH 1/1 staging: fbtft: fix all print warnings reported by sparse
--- drivers/staging/fbtft/fbtft-core.c | 2 +- drivers/staging/fbtft/fbtft-io.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fbtft-core.c +1 -1
@@ -1000,7 +1000,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)fbtft_sysfs_init (par);if (par->txbuf.buf) -sprintf (text1,", %d KiB %sbuffer memory" , +sprintf (text1,", %zu KiB %sbuffer memory" , par->txbuf.len >>10 , par->txbuf.dma ?"DMA " :"" );if (spi) sprintf(text2, ", spi%d.%d at %d MHz", spi->master->bus_num,
drivers/staging/fbtft/fbtft-io.c +2 -2
@@ -59,7 +59,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len) }if ((len %8 ) !=0 ) {dev_err (par->info->device, -"%s: error: len=%d must be divisible by 8\n" , +"%s: error: len=%zu must be divisible by 8\n" , __func__, len);return -EINVAL ; }
@@ -106,7 +106,7 @@ int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len)if (par->startbyte) {if (len >32 ) {dev_err (par->info->device, -"%s: len=%d can't be larger than 32 when using 'startbyte'\n" , +"%s: len=%zu can't be larger than 32 when using 'startbyte'\n" , __func__, len);return -EINVAL ; }
Signature · 1 line
1.9.1
Greg Kroah-Hartman
maintainerQuoted 1 line · Marcus Folkesson
Signed-off-by Marcus Folkesson <[email protected]>
Please include the exact warning that sparse gives you for this, it's not obvious to me what is wrong with the original code.
thanks,
greg k-h
Changelog: staging: fbtft: fix all print warnings reported by sparse
In reply to Marcus FolkessonInclude sparse-warnings in commit-log according to Gregs comments.
PATCH v2 1/1 staging: fbtft: fix all print warnings reported by sparse
Warnings reported by sparse:
drivers/staging/fbtft/fbtft-core.c:1004:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat=]
par->txbuf.len >> 10, par->txbuf.dma ? "DMA " : "");
drivers/staging/fbtft/fbtft-io.c:63:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]
__func__, len);
drivers/staging/fbtft/fbtft-io.c:110:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]
__func__, len);
--- drivers/staging/fbtft/fbtft-core.c | 2 +- drivers/staging/fbtft/fbtft-io.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/staging/fbtft/fbtft-core.c +1 -1
@@ -1000,7 +1000,7 @@ int fbtft_register_framebuffer(struct fb_info *fb_info)fbtft_sysfs_init (par);if (par->txbuf.buf) -sprintf (text1,", %d KiB %sbuffer memory" , +sprintf (text1,", %zu KiB %sbuffer memory" , par->txbuf.len >>10 , par->txbuf.dma ?"DMA " :"" );if (spi) sprintf(text2, ", spi%d.%d at %d MHz", spi->master->bus_num,
drivers/staging/fbtft/fbtft-io.c +2 -2
@@ -59,7 +59,7 @@ int fbtft_write_spi_emulate_9(struct fbtft_par *par, void *buf, size_t len) }if ((len %8 ) !=0 ) {dev_err (par->info->device, -"%s: error: len=%d must be divisible by 8\n" , +"%s: error: len=%zu must be divisible by 8\n" , __func__, len);return -EINVAL ; }
@@ -106,7 +106,7 @@ int fbtft_read_spi(struct fbtft_par *par, void *buf, size_t len)if (par->startbyte) {if (len >32 ) {dev_err (par->info->device, -"%s: len=%d can't be larger than 32 when using 'startbyte'\n" , +"%s: len=%zu can't be larger than 32 when using 'startbyte'\n" , __func__, len);return -EINVAL ; }
Signature · 1 line
1.9.1
Greg Kroah-Hartman
maintainerQuoted 12 lines · Marcus Folkesson
Warnings reported by sparse:
drivers/staging/fbtft/fbtft-core.c:1004:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat=]par->txbuf.len >> 10, par->txbuf.dma ? "DMA " : "");
drivers/staging/fbtft/fbtft-io.c:63:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]__func__, len);
drivers/staging/fbtft/fbtft-io.c:110:5: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘size_t’ [-Wformat=]
Quoted 7 lines
__func__, len);Signed-off-by Marcus Folkesson <[email protected]>--- drivers/staging/fbtft/fbtft-core.c | 2 +- drivers/staging/fbtft/fbtft-io.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Doesn't apply to my tree :(