Skip to contentSkip to conversation

Replacing strtok with strsep

PATCH New Bongani 1 participant 1 message Jul 3, 2002 SCSI

lore
Share & tools
lore

Bongani

author
#0 lore raw

PATCH 1/1 Replacing strtok with strsep

Hi

You are listed as the maintainer of this driver so I'm sending this to you. This patch is against 2.5.24, it replaces strtok with a thread safe strsep as listed on the Kernel-Janitor's TODO file. Could you please verify that it is OK.

Thanx

drivers/scsi/ibmmca.c renamed from drivers/scsi/ibmmca.c_orig +1 -3
@@ -1406,9 +1406,8 @@
    io_base = 0;
    id_base = 0;
    if (str) {
-      token = strtok(str,",");
       j = 0;
-      while (token) {
+      while (token = strsep(&str,",")) {
 	 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,7 +1423,6 @@
 	      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++) {