Commit 62c6f4f9 authored by Changcheng Deng's avatar Changcheng Deng Committed by Helge Deller

fbcon: use min() to make code cleaner

Use min() in order to make code cleaner.
Reported-by: default avatarZeal Robot <zealci@zte.com.cn>
Signed-off-by: default avatarChangcheng Deng <deng.changcheng@zte.com.cn>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20220209084810.1561184-1-deng.changcheng@zte.com.cn
parent c6346218
...@@ -578,7 +578,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, ...@@ -578,7 +578,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
save = kmalloc(array3_size(logo_lines, new_cols, 2), save = kmalloc(array3_size(logo_lines, new_cols, 2),
GFP_KERNEL); GFP_KERNEL);
if (save) { if (save) {
int i = cols < new_cols ? cols : new_cols; int i = min(cols, new_cols);
scr_memsetw(save, erase, array3_size(logo_lines, new_cols, 2)); scr_memsetw(save, erase, array3_size(logo_lines, new_cols, 2));
r = q - step; r = q - step;
for (cnt = 0; cnt < logo_lines; cnt++, r += i) for (cnt = 0; cnt < logo_lines; cnt++, r += i)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment