Skip to content

Commit a6cee01

Browse files
ColinIanKinggregkh
authored andcommitted
serial: 8250_mtk: make two read-only arrays static const
Don't populate the read-only arrays fraction_L_mapping and fraction_M_mapping on the stack but instead make them static const. Also makes the object code a little smaller. Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 988c7c0 commit a6cee01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/tty/serial/8250/8250_mtk.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,10 +289,10 @@ static void
289289
mtk8250_set_termios(struct uart_port *port, struct ktermios *termios,
290290
struct ktermios *old)
291291
{
292-
unsigned short fraction_L_mapping[] = {
292+
static const unsigned short fraction_L_mapping[] = {
293293
0, 1, 0x5, 0x15, 0x55, 0x57, 0x57, 0x77, 0x7F, 0xFF, 0xFF
294294
};
295-
unsigned short fraction_M_mapping[] = {
295+
static const unsigned short fraction_M_mapping[] = {
296296
0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 3
297297
};
298298
struct uart_8250_port *up = up_to_u8250p(port);

0 commit comments

Comments
 (0)