]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
serial: max310x: simplify max310x_update_best_err()
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Fri, 17 Apr 2026 14:53:29 +0000 (10:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 11 May 2026 15:20:18 +0000 (17:20 +0200)
commitdb3c618405d2a4ac870915b8438ff17be93b5f16
tree45d32c895587d4311088972029bb7e09f70743f9
parent0dcaf1c6b20546661ed14d9b1e3e9c252a0df9f7
serial: max310x: simplify max310x_update_best_err()

besterr was defined as a signed type was to make sure that the first call
to max310x_update_best_err() would always set besterr. Also there is no
need for it to be a long. By changing its type to unsigned int and initial
value to UINT_MAX, max310x_update_best_err() can be simplified and be more
efficient while achieving the same initial result.

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