]> Gentwo Git Trees - linux/.git/commit
serial: ce4100: clean up serial_in/out() hooks
authorJiri Slaby (SUSE) <jirislaby@kernel.org>
Mon, 23 Jun 2025 10:12:46 +0000 (12:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Jun 2025 14:32:50 +0000 (15:32 +0100)
commitd22cf1381416fd02b6db4263694e6c478f205384
tree429aa360d48799b2d86d43680755d05ef0e663e5
parentf5655940771fbc75efadfe91ca081525732bed3f
serial: ce4100: clean up serial_in/out() hooks

ce4100_mem_serial_in() unnecessarily contains 4 nested 'if's. That makes
the code hard to follow. Invert the conditions and return early if the
particular conditions do not hold.

And use "<<=" for shifting the offset in both of the hooks.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: x86@kernel.org
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20250623101246.486866-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/platform/ce4100/ce4100.c