mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Helge Deller <deller@gmx.de>
To: Qianqiang Liu <qianqiang.liu@163.com>
Cc: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fbcon: break earlier in search_fb_in_map and search_for_mapped_con
Date: Thu, 26 Sep 2024 18:25:54 +0200	[thread overview]
Message-ID: <5bbe55fe-4b35-43fe-8180-4fcb91c52384@gmx.de> (raw)
In-Reply-To: <20240926115911.620624-1-qianqiang.liu@163.com>

On 9/26/24 13:59, Qianqiang Liu wrote:
> Break the for loop immediately upon finding the target, making the
> process more efficient.
>
> Signed-off-by: Qianqiang Liu <qianqiang.liu@163.com>

applied.

Thanks!
Helge

> ---
>   drivers/video/fbdev/core/fbcon.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c
> index d9abae2516d8..e8b4e8c119b5 100644
> --- a/drivers/video/fbdev/core/fbcon.c
> +++ b/drivers/video/fbdev/core/fbcon.c
> @@ -512,8 +512,10 @@ static int search_fb_in_map(int idx)
>   	int i, retval = 0;
>
>   	for (i = first_fb_vc; i <= last_fb_vc; i++) {
> -		if (con2fb_map[i] == idx)
> +		if (con2fb_map[i] == idx) {
>   			retval = 1;
> +			break;
> +		}
>   	}
>   	return retval;
>   }
> @@ -523,8 +525,10 @@ static int search_for_mapped_con(void)
>   	int i, retval = 0;
>
>   	for (i = first_fb_vc; i <= last_fb_vc; i++) {
> -		if (con2fb_map[i] != -1)
> +		if (con2fb_map[i] != -1) {
>   			retval = 1;
> +			break;
> +		}
>   	}
>   	return retval;
>   }


  reply	other threads:[~2024-09-26 16:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-26 11:59 Qianqiang Liu
2024-09-26 16:25 ` Helge Deller [this message]
2024-09-29 19:45 ` Andy Shevchenko

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=5bbe55fe-4b35-43fe-8180-4fcb91c52384@gmx.de \
    --to=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=qianqiang.liu@163.com \
    /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®