Skip to content
Commit 7e26c84d authored by Ilpo Järvinen's avatar Ilpo Järvinen Committed by Greg Kroah-Hartman
Browse files

n_tty: Use DIV_ROUND_UP() in room calculation



When PARMRK is set, a character can result in up to 3 chars in the read
buffer. Receive code calculates for how many characters there (at
least) is room. Convert an opencoded rounding in the calculation to use
DIV_ROUND_UP().

Note: the room variable is decremented afterwards by one which ensures
the characters will fit into the buffer for real so the code is okay
despite rounding upwards.

Signed-off-by: default avatarIlpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230309082035.14880-6-ilpo.jarvinen@linux.intel.com


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9db1be84
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment