Skip to content

Commit 80a3471

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
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>
1 parent b844e63 commit 80a3471

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/tty/vt/vt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4862,7 +4862,7 @@ static int con_font_get(struct vc_data *vc, struct console_font_op *op)
48624862
return ret;
48634863
}
48644864

4865-
c = (font.width+7)/8 * vpitch * font.charcount;
4865+
c = DIV_ROUND_UP(font.width, 8) * vpitch * font.charcount;
48664866

48674867
if (op->data && font.charcount > op->charcount)
48684868
return -ENOSPC;
@@ -4894,7 +4894,7 @@ static int con_font_set(struct vc_data *vc, const struct console_font_op *op)
48944894
return -EINVAL;
48954895
if (vpitch < op->height)
48964896
return -EINVAL;
4897-
size = (op->width+7)/8 * vpitch * op->charcount;
4897+
size = DIV_ROUND_UP(op->width, 8) * vpitch * op->charcount;
48984898
if (size > max_font_size)
48994899
return -ENOSPC;
49004900

0 commit comments

Comments
 (0)