mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Patch: linux-2.5.8-pre1: Complete strtok --> strsep conversion
@ 2002-04-04 12:30 Adam J. Richter
  0 siblings, 0 replies; only message in thread
From: Adam J. Richter @ 2002-04-04 12:30 UTC (permalink / raw)
  To: linux-kernel, torvalds; +Cc: benh, martin_rogge, jgarzik, dok, kraxel, langa2

[-- Attachment #1: Type: text/plain, Size: 677 bytes --]

	linux-2.5.8-pre1 on longer defines strtok.  Instead,
kernel code is supposed to use strsep.  Seven files still
referenced strtok.  This patch converts the remaining strtok calls
to strsep and eliminates the EXPORT_SYMBOL(strtok) from ppc64.

	The line numbers in the patches may be skewed a bit because
there are other differences between my version of some of these
files and Linus's.

-- 
Adam J. Richter     __     ______________   4880 Stevens Creek Blvd, Suite 104
adam@yggdrasil.com     \ /                  San Jose, California 95129-1034
+1 408 261-6630         | g g d r a s i l   United States of America
fax +1 408 261-6631      "Free Software For The Rest Of Us."

[-- Attachment #2: strtok.diffs --]
[-- Type: text/plain, Size: 2968 bytes --]

--- linux-2.5.8-pre1/drivers/video/atafb.c	2002-04-03 23:38:32.000000000 -0800
+++ linux/drivers/video/atafb.c	2002-04-04 03:34:00.000000000 -0800
@@ -2874,12 +2873,9 @@
 	user_mode[0]        =
 	fb_info.fontname[0] = '\0';
 
-    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;
--- linux-2.5.8-pre1/drivers/video/clgenfb.c	2002-03-18 12:37:10.000000000 -0800
+++ linux/drivers/video/clgenfb.c	2002-04-04 03:34:00.000000000 -0800
@@ -2857,12 +2883,8 @@
 
 	DPRINTK ("ENTER\n");
 
-	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);
--- linux-2.5.8-pre1/drivers/video/neofb.c	2002-03-18 12:37:04.000000000 -0800
+++ linux/drivers/video/neofb.c	2002-04-04 03:34:00.000000000 -0800
@@ -2362,10 +2362,7 @@
 
   DBG("neofb_setup");
 
-  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;
 
--- linux-2.5.8-pre1/drivers/video/sis/sis_main.c	2002-03-18 12:37:17.000000000 -0800
+++ linux/drivers/video/sis/sis_main.c	2002-04-04 04:01:17.000000000 -0800
@@ -2254,13 +2254,9 @@
 	fb_info.fontname[0] = '\0';
 	ivideo.refresh_rate = 0;
 
-	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;
 
--- linux-2.5.8-pre1/drivers/scsi/ibmmca.c	2002-03-18 12:37:05.000000000 -0800
+++ linux/drivers/scsi/ibmmca.c	2002-04-04 03:34:00.000000000 -0800
@@ -1406,9 +1408,8 @@
    io_base = 0;
    id_base = 0;
    if (str) {
-      token = strtok(str,",");
       j = 0;
-      while (token) {
+      while ((token = strsep(&str, ",")) != NULL) {
 	 if (!strcmp(token,"activity")) display_mode |= LED_ACTIVITY;
 	 if (!strcmp(token,"display")) display_mode |= LED_DISP;
 	 if (!strcmp(token,"adisplay")) display_mode |= LED_ADISP;
@@ -1424,8 +1425,7 @@
 	      scsi_id[id_base++] = simple_strtoul(token,NULL,0);
 	    j++;
 	 }
-	 token = strtok(NULL,",");
       }
    } else if (ints) {
       for (i = 0; i < IM_MAX_HOSTS && 2*i+2 < ints[0]; i++) {
--- linux-2.5.8-pre1/arch/ppc64/kernel/ppc_ksyms.c	2002-03-18 12:37:08.000000000 -0800
+++ linux/arch/ppc64/kernel/ppc_ksyms.c	2002-04-04 04:06:05.000000000 -0800
@@ -109,7 +109,6 @@
 EXPORT_SYMBOL(strchr);
 EXPORT_SYMBOL(strrchr);
 EXPORT_SYMBOL(strpbrk);
-EXPORT_SYMBOL(strtok);
 EXPORT_SYMBOL(strstr);
 EXPORT_SYMBOL(strlen);
 EXPORT_SYMBOL(strnlen);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-04-04 12:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-04 12:30 Patch: linux-2.5.8-pre1: Complete strtok --> strsep conversion Adam J. Richter

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®