Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: vt: do not open code DIV_ROUND_UP()

Use the designated DIV_ROUND_UP() macro instead of explicit addition
with division.

Signed-off-by: Jiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://patch.msgid.link/20251119092457.826789-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
80a3471f b844e638

+2 -2
+2 -2
drivers/tty/vt/vt.c
··· 4862 4862 return ret; 4863 4863 } 4864 4864 4865 - c = (font.width+7)/8 * vpitch * font.charcount; 4865 + c = DIV_ROUND_UP(font.width, 8) * vpitch * font.charcount; 4866 4866 4867 4867 if (op->data && font.charcount > op->charcount) 4868 4868 return -ENOSPC; ··· 4894 4894 return -EINVAL; 4895 4895 if (vpitch < op->height) 4896 4896 return -EINVAL; 4897 - size = (op->width+7)/8 * vpitch * op->charcount; 4897 + size = DIV_ROUND_UP(op->width, 8) * vpitch * op->charcount; 4898 4898 if (size > max_font_size) 4899 4899 return -ENOSPC; 4900 4900