]> git.ipfire.org Git - thirdparty/linux.git/commit
serial: max310x: improve max310x_set_ref_clk() efficiency
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Fri, 17 Apr 2026 14:53:32 +0000 (10:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 May 2026 15:20:18 +0000 (17:20 +0200)
commitd0001adcd1f838d97bc23a20375f60bb3304aa5c
tree78d819508d8f0c3d9836d4b23d77464072c7ec60
parentffc3414d15c615bc0a46536343f917d8a5f14655
serial: max310x: improve max310x_set_ref_clk() efficiency

The same basic code is duplicated for each of the four PLL multiplier
values, so simplify and streamline it. Doing so allows us to avoid
some unnecessary (fdiv * factor) multiplications for some fdiv values and
replace the second "if" statement with an "else if" and avoid a useless
comparison.

Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://patch.msgid.link/20260417-max310x-2-v1-5-b424e105ecac@dimonoff.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/max310x.c