All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Juhl <jesper.juhl@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: ppopov@mvista.com, source@mvista.com
Subject: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
Date: Wed, 24 Aug 2005 21:08:32 +0200	[thread overview]
Message-ID: <200508242108.32885.jesper.juhl@gmail.com> (raw)

Since strtok() died in 2002 let's not use it - use strsep() instead which
is the replacement function.

Note: I've not been able to test this patch since I lack both hardware and 
a cross compiler, so if someone else could please check it and sign off on 
it before I send it to Andrew for inclusion in -mm I'd appreciate it.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 au1100fb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

--- linux-2.6.13-rc6-mm2-orig/drivers/video/au1100fb.c	2005-08-17 21:51:59.000000000 +0200
+++ linux-2.6.13-rc6-mm2/drivers/video/au1100fb.c	2005-08-24 18:58:18.000000000 +0200
@@ -614,7 +614,7 @@ void au1100fb_cleanup(struct fb_info *in
 
 void au1100fb_setup(char *options, int *ints)
 {
-	char* this_opt;
+	char *this_opt;
 	int i;
 	int num_panels = sizeof(panels)/sizeof(struct known_lcd_panels);
 
@@ -622,8 +622,9 @@ void au1100fb_setup(char *options, int *
 	if (!options || !*options)
 		return;
 
-	for(this_opt=strtok(options, ","); this_opt;
-	    this_opt=strtok(NULL, ",")) {
+	while ((this_opt = strsep(&options, ","))) {
+		if (!*this_opt)
+			continue;
 		if (!strncmp(this_opt, "panel:", 6)) {
 #if defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100)
 			/* Read Pb1100 Switch S10 ? */



             reply	other threads:[~2005-08-24 19:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-24 19:08 Jesper Juhl [this message]
2005-08-25  6:16 ` [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c Pete Popov
2005-08-29 11:43   ` Jesper Juhl
2005-08-29 14:49     ` Pete Popov
2005-08-29 15:00       ` Jesper Juhl
2005-08-29 15:06         ` Pete Popov
2005-08-29 15:08           ` Jesper Juhl

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=200508242108.32885.jesper.juhl@gmail.com \
    --to=jesper.juhl@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ppopov@mvista.com \
    --cc=source@mvista.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.