Skip to content

Commit 9dc75e7

Browse files
KaairaGuptamchehab
authored andcommitted
media: tpg: change char argument to const char
Change the argument of type char * to const char * for function tpg_gen_text(). This function should take in a const char * as opposed to char * as it does not make changes to the text. This issue was found while passing the order of colors of tpg generated test image (which is a const char *) to this function. Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in> Reviewed-by: Helen Koike <helen.koike@collabora.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
1 parent 9c487b0 commit 9dc75e7

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎drivers/media/common/v4l2-tpg/v4l2-tpg-core.c‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,34 +1927,34 @@ typedef struct { u16 __; u8 _; } __packed x24;
19271927

19281928
static noinline void tpg_print_str_2(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
19291929
unsigned p, unsigned first, unsigned div, unsigned step,
1930-
int y, int x, char *text, unsigned len)
1930+
int y, int x, const char *text, unsigned len)
19311931
{
19321932
PRINTSTR(u8);
19331933
}
19341934

19351935
static noinline void tpg_print_str_4(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
19361936
unsigned p, unsigned first, unsigned div, unsigned step,
1937-
int y, int x, char *text, unsigned len)
1937+
int y, int x, const char *text, unsigned len)
19381938
{
19391939
PRINTSTR(u16);
19401940
}
19411941

19421942
static noinline void tpg_print_str_6(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
19431943
unsigned p, unsigned first, unsigned div, unsigned step,
1944-
int y, int x, char *text, unsigned len)
1944+
int y, int x, const char *text, unsigned len)
19451945
{
19461946
PRINTSTR(x24);
19471947
}
19481948

19491949
static noinline void tpg_print_str_8(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
19501950
unsigned p, unsigned first, unsigned div, unsigned step,
1951-
int y, int x, char *text, unsigned len)
1951+
int y, int x, const char *text, unsigned len)
19521952
{
19531953
PRINTSTR(u32);
19541954
}
19551955

19561956
void tpg_gen_text(const struct tpg_data *tpg, u8 *basep[TPG_MAX_PLANES][2],
1957-
int y, int x, char *text)
1957+
int y, int x, const char *text)
19581958
{
19591959
unsigned step = V4L2_FIELD_HAS_T_OR_B(tpg->field) ? 2 : 1;
19601960
unsigned div = step;

‎include/media/tpg/v4l2-tpg.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void tpg_log_status(struct tpg_data *tpg);
241241

242242
void tpg_set_font(const u8 *f);
243243
void tpg_gen_text(const struct tpg_data *tpg,
244-
u8 *basep[TPG_MAX_PLANES][2], int y, int x, char *text);
244+
u8 *basep[TPG_MAX_PLANES][2], int y, int x, const char *text);
245245
void tpg_calc_text_basep(struct tpg_data *tpg,
246246
u8 *basep[TPG_MAX_PLANES][2], unsigned p, u8 *vbuf);
247247
unsigned tpg_g_interleaved_plane(const struct tpg_data *tpg, unsigned buf_line);

0 commit comments

Comments
 (0)