linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: paul <paul@crapouillou.net>
To: Paul Cercueil <paul@crapouillou.net>
Cc: florianschandinat@gmx.de, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 4/4] fbcon: optimize parameters parsing loop.
Date: Wed, 25 Jul 2012 14:14:47 +0000	[thread overview]
Message-ID: <a5605d66df852b08be6444bf94f6c0dc@mail.crapouillou.net> (raw)
In-Reply-To: <1343091626-11435-4-git-send-email-paul@crapouillou.net>

 From 67cecd09d850542e00a1d9a29567232d1224cf23 Mon Sep 17 00:00:00 2001
 From: Paul Cercueil <paul@crapouillou.net>
Date: Thu, 12 Jan 2012 19:40:24 +0100
Subject: [PATCH 4/4] fbcon: optimize parameters parsing loop.


Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
  drivers/video/console/fbcon.c |    8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/video/console/fbcon.c 
b/drivers/video/console/fbcon.c
index 9b83b75..1ecaf68 100644
--- a/drivers/video/console/fbcon.c
+++ b/drivers/video/console/fbcon.c
@@ -441,8 +441,10 @@ static int __init fb_console_setup(char *this_opt)
  		return 1;

  	while ((options = strsep(&this_opt, ",")) != NULL) {
-		if (!strncmp(options, "font:", 5))
+		if (!strncmp(options, "font:", 5)) {
  			strlcpy(fontname, options + 5, sizeof(fontname));
+			continue;
+		}

  		if (!strncmp(options, "scrollback:", 11)) {
  			char *k;
@@ -468,6 +470,7 @@ static int __init fb_console_setup(char *this_opt)
  			/* (k && *k): Check for garbage after the suffix */
  			if (ret || (k && *k))
  				pr_warn("fbcon: scrollback: incorrect value.\n");
+			continue;
  		}

  		if (!strncmp(options, "map:", 4)) {
@@ -484,6 +487,7 @@ static int __init fb_console_setup(char *this_opt)
  			} else {
  				pr_warn("fbcon: map: incorrect value.\n");
  			}
+			continue;
  		}

  		if (!strncmp(options, "vc:", 3)) {
@@ -513,6 +517,7 @@ static int __init fb_console_setup(char *this_opt)
  				fbcon_is_default = 0;
  			else
  				pr_warn("fbcon: vc: incorrect value.\n");
+			continue;
  		}

  		if (!strncmp(options, "rotate:", 7)) {
@@ -525,6 +530,7 @@ static int __init fb_console_setup(char *this_opt)
  			} else {
  				pr_warn("fbcon: rotate: incorrect value.\n");
  			}
+			continue;
  		}
  	}
  	return 1;
-- 
1.7.10.4


      parent reply	other threads:[~2012-07-25 14:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-24  1:00 [PATCH 1/4] fbcon: use kstrtouint instead of deprecated function simple_strtoul Paul Cercueil
2012-07-24  1:00 ` [PATCH 2/4] fbcon: prevent possible buffer overflow Paul Cercueil
2012-08-23 20:28   ` Florian Tobias Schandinat
2012-07-24  1:00 ` [PATCH 3/4] fbcon: continue parsing parameters after an error Paul Cercueil
2012-07-24  1:00 ` [PATCH 4/4] fbcon: optimize parameters parsing loop Paul Cercueil
2012-07-25 14:13   ` paul
2012-07-25 14:14   ` paul [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=a5605d66df852b08be6444bf94f6c0dc@mail.crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=florianschandinat@gmx.de \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).