mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bongani <bonganilinux@mweb.co.za>
To: langa2@kph.uni-mainz.de
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] Replacing strtok with strsep
Date: 03 Jul 2002 06:39:03 +0200	[thread overview]
Message-ID: <1025671145.1499.23.camel@localhost.localdomain> (raw)

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


--- linux-2.5/drivers/scsi/ibmmca.c_orig	Wed Jun 26 23:50:11 2002
+++ linux-2.5/drivers/scsi/ibmmca.c	Wed Jun 26 23:50:40 2002
@@ -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++) {




                 reply	other threads:[~2002-07-03  4:34 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=1025671145.1499.23.camel@localhost.localdomain \
    --to=bonganilinux@mweb.co.za \
    --cc=langa2@kph.uni-mainz.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®