From: Sam Ravnborg <sam@ravnborg.org>
To: cgel.zte@gmail.com
Cc: deller@gmx.de, linux-fbdev@vger.kernel.org, ducheng2@gmail.com,
penguin-kernel@i-love.sakura.ne.jp, daniel.vetter@ffwll.ch,
Zeal Robot <zealci@zte.com.cn>,
deng.changcheng@zte.com.cn, dri-devel@lists.freedesktop.org,
linux-kernel@vger.kernel.org, cssk@net-c.es,
geert@linux-m68k.org, svens@stackframe.org
Subject: Re: [PATCH] fbcon: use min() to make code cleaner
Date: Wed, 9 Feb 2022 19:54:25 +0100 [thread overview]
Message-ID: <YgQN4WXXjSHVDiBK@ravnborg.org> (raw)
In-Reply-To: <20220209084810.1561184-1-deng.changcheng@zte.com.cn>
On Wed, Feb 09, 2022 at 08:48:10AM +0000, cgel.zte@gmail.com wrote:
> From: Changcheng Deng <deng.changcheng@zte.com.cn>
>
> Use min() in order to make code cleaner.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Changcheng Deng <deng.changcheng@zte.com.cn>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
I had preferred in minmax.h was included, but it has an indirect include
so shrug.
I assume Daniel or Helge will pick it up.
Sam
> ---
> drivers/video/fbdev/core/fbcon.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index f36829eeb5a9..61171159fee2 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -602,7 +602,7 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info,
> save = kmalloc(array3_size(logo_lines, new_cols, 2),
> GFP_KERNEL);
> 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));
> r = q - step;
> for (cnt = 0; cnt < logo_lines; cnt++, r += i)
> --
> 2.25.1
next prev parent reply other threads:[~2022-02-09 18:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-09 8:48 cgel.zte
2022-02-09 18:54 ` Sam Ravnborg [this message]
2022-02-09 21:24 ` Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YgQN4WXXjSHVDiBK@ravnborg.org \
--to=sam@ravnborg.org \
--cc=cgel.zte@gmail.com \
--cc=cssk@net-c.es \
--cc=daniel.vetter@ffwll.ch \
--cc=deller@gmx.de \
--cc=deng.changcheng@zte.com.cn \
--cc=dri-devel@lists.freedesktop.org \
--cc=ducheng2@gmail.com \
--cc=geert@linux-m68k.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=svens@stackframe.org \
--cc=zealci@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®