From patchwork Wed Jul 25 14:14:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 1237761 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 15545DFFCD for ; Wed, 25 Jul 2012 14:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933083Ab2GYOOv (ORCPT ); Wed, 25 Jul 2012 10:14:51 -0400 Received: from marvin.crapouillou.net ([109.190.31.181]:63305 "EHLO marvin.crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933060Ab2GYOOu (ORCPT ); Wed, 25 Jul 2012 10:14:50 -0400 Received: from www-data by marvin.crapouillou.net with local (Exim 4.72) (envelope-from ) id 1Su2MS-0006zj-1N; Wed, 25 Jul 2012 16:14:48 +0200 To: Paul Cercueil Subject: Re: [PATCH 4/4] fbcon: optimize parameters parsing loop. X-PHP-Originating-Script: 0:main.inc MIME-Version: 1.0 Date: Wed, 25 Jul 2012 16:14:47 +0200 From: paul Cc: , , In-Reply-To: <1343091626-11435-4-git-send-email-paul@crapouillou.net> References: <1343091626-11435-1-git-send-email-paul@crapouillou.net> <1343091626-11435-4-git-send-email-paul@crapouillou.net> Message-ID: X-Sender: paul@crapouillou.net User-Agent: Roundcube Webmail/0.6 Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org From 67cecd09d850542e00a1d9a29567232d1224cf23 Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Thu, 12 Jan 2012 19:40:24 +0100 Subject: [PATCH 4/4] fbcon: optimize parameters parsing loop. Signed-off-by: Paul Cercueil --- 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;