Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 10 Feb 2002 07:26:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 10 Feb 2002 07:26:06 -0500 Received: from cc5993-b.ensch1.ov.nl.home.com ([212.204.161.160]:48658 "HELO packetstorm.nu") by vger.kernel.org with SMTP id ; Sun, 10 Feb 2002 07:25:49 -0500 Reply-To: From: "Alex Scheele" To: Cc: "Dave Jones" , "Lkml" Subject: [patch][2.5.4-dj4] cleanup, use strsep in tridentfb.c Date: Sun, 10 Feb 2002 13:25:46 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4807.1700 Importance: Normal Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Hi, This patch changes strtok() use to strsep(). Strtok() isn't SMP/thread safe. strsep is considered safer. -- Alex (alex@packetstorm.nu) -------------------------- cut here ------------------------- diff -Nru linux-2.5.3-dj4/drivers/video/tridentfb.c linux/drivers/video/tridentfb.c --- linux-2.5.3-dj4/drivers/video/tridentfb.c Sat Feb 9 21:03:01 2002 +++ linux/drivers/video/tridentfb.c Sat Feb 9 21:03:01 2002 @@ -1259,8 +1259,8 @@ char * opt; if (!options || !*options) return 0; - for(opt = strtok(options,",");opt;opt = strtok(NULL,",")){ - if (!opt) continue; + while((opt=strsep(&options,",")) != NULL) { + if (!*opt) continue; if (!strncmp(opt,"noaccel",7)) noaccel = 1; else if (!strncmp(opt,"accel",5)) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/