Skip to content

Commit 13de234

Browse files
andy-shevojeda
authored andcommitted
auxdisplay: lcd2s: Use array size explicitly in lcd2s_gotoxy()
Currently the reading of the onstack array is confusing since two out of three members are of different types. Let it be more clear by explicitly set the array size, so everybody will understand that parameters are cast to the type of the array. While at it, add a missed space. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
1 parent 8fefb31 commit 13de234

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/auxdisplay/lcd2s.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int lcd2s_print(struct charlcd *lcd, int c)
106106
static int lcd2s_gotoxy(struct charlcd *lcd, unsigned int x, unsigned int y)
107107
{
108108
struct lcd2s_data *lcd2s = lcd->drvdata;
109-
u8 buf[] = { LCD2S_CMD_CUR_POS, y + 1, x + 1};
109+
u8 buf[3] = { LCD2S_CMD_CUR_POS, y + 1, x + 1 };
110110

111111
lcd2s_i2c_master_send(lcd2s->i2c, buf, sizeof(buf));
112112

0 commit comments

Comments
 (0)