public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "René Scharfe" <l.s.r@web.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] strtok --> strsep in framebuffer drivers, last pieces (really!)
Date: Fri, 16 Nov 2001 20:04:30 +0100	[thread overview]
Message-ID: <20011116200430.40edfa7e.l.s.r@web.de> (raw)

Hi,

this seems to be the really last patch regarding `strtok in framebuffer
drivers'. It removes another compiler warning, converts the last three
strtok()s to strsep()s and in two cases adds `skip empty tokens'-code.
Please, apply.

René



diff -Nur linux-2.4.15-pre5/drivers/video/atafb.c linux-2.4.15-pre5-rs/drivers/video/atafb.c
--- linux-2.4.15-pre5/drivers/video/atafb.c	Fri Sep 14 01:04:43 2001
+++ linux-2.4.15-pre5-rs/drivers/video/atafb.c	Fri Nov 16 20:21:39 2001
@@ -2899,7 +2899,7 @@
     if (!options || !*options)
 		return 0;
      
-    for(this_opt=strtok(options,","); this_opt; this_opt=strtok(NULL,",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
 	if (!*this_opt) continue;
 	if ((temp=get_video_mode(this_opt)))
 		default_par=temp;
diff -Nur linux-2.4.15-pre5/drivers/video/aty/atyfb_base.c linux-2.4.15-pre5-rs/drivers/video/aty/atyfb_base.c
--- linux-2.4.15-pre5/drivers/video/aty/atyfb_base.c	Thu Nov  8 22:51:16 2001
+++ linux-2.4.15-pre5-rs/drivers/video/aty/atyfb_base.c	Fri Nov 16 20:10:21 2001
@@ -2522,6 +2522,8 @@
 	return 0;
 
     while ((this_opt = strsep(&options, ",")) != NULL) {
+	if (!*this_opt)
+		continue;
 	if (!strncmp(this_opt, "font:", 5)) {
 		char *p;
 		int i;
diff -Nur linux-2.4.15-pre5/drivers/video/aty128fb.c linux-2.4.15-pre5-rs/drivers/video/aty128fb.c
--- linux-2.4.15-pre5/drivers/video/aty128fb.c	Fri Nov 16 18:43:02 2001
+++ linux-2.4.15-pre5-rs/drivers/video/aty128fb.c	Fri Nov 16 20:13:10 2001
@@ -1620,7 +1620,9 @@
     if (!options || !*options)
 	return 0;
 
-    while (this_opt = strsep(&options, ",")) {
+    while ((this_opt = strsep(&options, ",")) != NULL) {
+	if (!*this_opt)
+	    continue;
 	if (!strncmp(this_opt, "font:", 5)) {
 	    char *p;
 	    int i;
diff -Nur linux-2.4.15-pre5/drivers/video/clgenfb.c linux-2.4.15-pre5-rs/drivers/video/clgenfb.c
--- linux-2.4.15-pre5/drivers/video/clgenfb.c	Thu Nov  8 22:51:16 2001
+++ linux-2.4.15-pre5-rs/drivers/video/clgenfb.c	Fri Nov 16 20:19:51 2001
@@ -2823,8 +2823,7 @@
 	if (!options || !*options)
 		return 0;
 
-	for (this_opt = strtok (options, ","); this_opt != NULL;
-	     this_opt = strtok (NULL, ",")) {
+	while ((this_opt = strsep (&options, ",")) != NULL) {
 		if (!*this_opt) continue;
 
 		DPRINTK("clgenfb_setup: option '%s'\n", this_opt);
diff -Nur linux-2.4.15-pre5/drivers/video/sis/sis_main.c linux-2.4.15-pre5-rs/drivers/video/sis/sis_main.c
--- linux-2.4.15-pre5/drivers/video/sis/sis_main.c	Fri Nov 16 18:43:03 2001
+++ linux-2.4.15-pre5-rs/drivers/video/sis/sis_main.c	Fri Nov 16 20:19:04 2001
@@ -2257,8 +2257,7 @@
 	if (!options || !*options)
 		return 0;
 
-	for (this_opt = strtok (options, ","); this_opt;
-	     this_opt = strtok (NULL, ",")) {
+	while ((this_opt = strsep (&options, ",")) != NULL) {
 		if (!*this_opt)
 			continue;
 

                 reply	other threads:[~2001-11-16 19:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20011116200430.40edfa7e.l.s.r@web.de \
    --to=l.s.r@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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