Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/mipi-dbi: Make mipi_dbi_command_stackbuf() data parameter const

mipi_dbi_command_stackbuf() copies the passed buffer data, so it can be
const.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200316164249.6234-1-geert+renesas@glider.be

authored by

Geert Uytterhoeven and committed by
Sam Ravnborg
f019190b 92e513fb

+5 -3
+2 -1
drivers/gpu/drm/drm_mipi_dbi.c
··· 169 169 EXPORT_SYMBOL(mipi_dbi_command_buf); 170 170 171 171 /* This should only be used by mipi_dbi_command() */ 172 - int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len) 172 + int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data, 173 + size_t len) 173 174 { 174 175 u8 *buf; 175 176 int ret;
+3 -2
include/drm/drm_mipi_dbi.h
··· 170 170 171 171 int mipi_dbi_command_read(struct mipi_dbi *dbi, u8 cmd, u8 *val); 172 172 int mipi_dbi_command_buf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len); 173 - int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, u8 *data, size_t len); 173 + int mipi_dbi_command_stackbuf(struct mipi_dbi *dbi, u8 cmd, const u8 *data, 174 + size_t len); 174 175 int mipi_dbi_buf_copy(void *dst, struct drm_framebuffer *fb, 175 176 struct drm_rect *clip, bool swap); 176 177 /** ··· 188 187 */ 189 188 #define mipi_dbi_command(dbi, cmd, seq...) \ 190 189 ({ \ 191 - u8 d[] = { seq }; \ 190 + const u8 d[] = { seq }; \ 192 191 mipi_dbi_command_stackbuf(dbi, cmd, d, ARRAY_SIZE(d)); \ 193 192 }) 194 193