From: Helge Deller <deller@gmx.de>
To: Sam Ravnborg <sam@ravnborg.org>, cgel.zte@gmail.com
Cc: 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 22:24:47 +0100 [thread overview]
Message-ID: <2bfcb259-5f81-2110-2027-cc9e61d4d671@gmx.de> (raw)
In-Reply-To: <YgQN4WXXjSHVDiBK@ravnborg.org>
On 2/9/22 19:54, Sam Ravnborg wrote:
> 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.
Daniel has quite some upcoming changes to core/fbcon, so I prefer
that he takes it when he thinks it's the right time...
Helge
>
>> ---
>> 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
prev parent reply other threads:[~2022-02-09 21:31 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
2022-02-09 21:24 ` Helge Deller [this message]
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=2bfcb259-5f81-2110-2027-cc9e61d4d671@gmx.de \
--to=deller@gmx.de \
--cc=cgel.zte@gmail.com \
--cc=cssk@net-c.es \
--cc=daniel.vetter@ffwll.ch \
--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=sam@ravnborg.org \
--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®