public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
@ 2005-08-24 19:08 Jesper Juhl
  2005-08-25  6:16 ` Pete Popov
  0 siblings, 1 reply; 7+ messages in thread
From: Jesper Juhl @ 2005-08-24 19:08 UTC (permalink / raw)
  To: linux-kernel; +Cc: ppopov, source

Since strtok() died in 2002 let's not use it - use strsep() instead which
is the replacement function.

Note: I've not been able to test this patch since I lack both hardware and 
a cross compiler, so if someone else could please check it and sign off on 
it before I send it to Andrew for inclusion in -mm I'd appreciate it.


Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
---

 au1100fb.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

--- linux-2.6.13-rc6-mm2-orig/drivers/video/au1100fb.c	2005-08-17 21:51:59.000000000 +0200
+++ linux-2.6.13-rc6-mm2/drivers/video/au1100fb.c	2005-08-24 18:58:18.000000000 +0200
@@ -614,7 +614,7 @@ void au1100fb_cleanup(struct fb_info *in
 
 void au1100fb_setup(char *options, int *ints)
 {
-	char* this_opt;
+	char *this_opt;
 	int i;
 	int num_panels = sizeof(panels)/sizeof(struct known_lcd_panels);
 
@@ -622,8 +622,9 @@ void au1100fb_setup(char *options, int *
 	if (!options || !*options)
 		return;
 
-	for(this_opt=strtok(options, ","); this_opt;
-	    this_opt=strtok(NULL, ",")) {
+	while ((this_opt = strsep(&options, ","))) {
+		if (!*this_opt)
+			continue;
 		if (!strncmp(this_opt, "panel:", 6)) {
 #if defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100)
 			/* Read Pb1100 Switch S10 ? */



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
  2005-08-24 19:08 [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c Jesper Juhl
@ 2005-08-25  6:16 ` Pete Popov
  2005-08-29 11:43   ` Jesper Juhl
  0 siblings, 1 reply; 7+ messages in thread
From: Pete Popov @ 2005-08-25  6:16 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linux-kernel@vger.kernel.org


I see the patch, or an equivalent, has been applied already.

Pete

On Wed, 2005-08-24 at 21:08 +0200, Jesper Juhl wrote:
> Since strtok() died in 2002 let's not use it - use strsep() instead which
> is the replacement function.
> 
> Note: I've not been able to test this patch since I lack both hardware and 
> a cross compiler, so if someone else could please check it and sign off on 
> it before I send it to Andrew for inclusion in -mm I'd appreciate it.
> 
> 
> Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
> ---
> 
>  au1100fb.c |    7 ++++---
>  1 files changed, 4 insertions(+), 3 deletions(-)
> 
> --- linux-2.6.13-rc6-mm2-orig/drivers/video/au1100fb.c	2005-08-17 21:51:59.000000000 +0200
> +++ linux-2.6.13-rc6-mm2/drivers/video/au1100fb.c	2005-08-24 18:58:18.000000000 +0200
> @@ -614,7 +614,7 @@ void au1100fb_cleanup(struct fb_info *in
>  
>  void au1100fb_setup(char *options, int *ints)
>  {
> -	char* this_opt;
> +	char *this_opt;
>  	int i;
>  	int num_panels = sizeof(panels)/sizeof(struct known_lcd_panels);
>  
> @@ -622,8 +622,9 @@ void au1100fb_setup(char *options, int *
>  	if (!options || !*options)
>  		return;
>  
> -	for(this_opt=strtok(options, ","); this_opt;
> -	    this_opt=strtok(NULL, ",")) {
> +	while ((this_opt = strsep(&options, ","))) {
> +		if (!*this_opt)
> +			continue;
>  		if (!strncmp(this_opt, "panel:", 6)) {
>  #if defined(CONFIG_MIPS_PB1100) || defined(CONFIG_MIPS_DB1100)
>  			/* Read Pb1100 Switch S10 ? */
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
  2005-08-25  6:16 ` Pete Popov
@ 2005-08-29 11:43   ` Jesper Juhl
  2005-08-29 14:49     ` Pete Popov
  0 siblings, 1 reply; 7+ messages in thread
From: Jesper Juhl @ 2005-08-29 11:43 UTC (permalink / raw)
  To: Pete Popov; +Cc: linux-kernel@vger.kernel.org

On 8/25/05, Pete Popov <ppopov@mvista.com> wrote:
> 
> I see the patch, or an equivalent, has been applied already.
> 
Ohh, where? I don't see such a patch in 2.6.12-rc6-mm2 nor in 2.6.13.

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
  2005-08-29 11:43   ` Jesper Juhl
@ 2005-08-29 14:49     ` Pete Popov
  2005-08-29 15:00       ` Jesper Juhl
  0 siblings, 1 reply; 7+ messages in thread
From: Pete Popov @ 2005-08-29 14:49 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linux-kernel@vger.kernel.org

On Mon, 2005-08-29 at 13:43 +0200, Jesper Juhl wrote:
> On 8/25/05, Pete Popov <ppopov@mvista.com> wrote:
> > 
> > I see the patch, or an equivalent, has been applied already.
> > 
> Ohh, where? I don't see such a patch in 2.6.12-rc6-mm2 nor in 2.6.13.

2.6.13. 

Pete


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
  2005-08-29 14:49     ` Pete Popov
@ 2005-08-29 15:00       ` Jesper Juhl
  2005-08-29 15:06         ` Pete Popov
  0 siblings, 1 reply; 7+ messages in thread
From: Jesper Juhl @ 2005-08-29 15:00 UTC (permalink / raw)
  To: Pete Popov; +Cc: linux-kernel@vger.kernel.org

On 8/29/05, Pete Popov <ppopov@mvista.com> wrote:
> On Mon, 2005-08-29 at 13:43 +0200, Jesper Juhl wrote:
> > On 8/25/05, Pete Popov <ppopov@mvista.com> wrote:
> > >
> > > I see the patch, or an equivalent, has been applied already.
> > >
> > Ohh, where? I don't see such a patch in 2.6.12-rc6-mm2 nor in 2.6.13.
> 
> 2.6.13.
> 
Then I must be blind, because I still see the old strtok() using code
in there :

juhl@dragon:~/download/kernel/linux-2.6.13$ head -n 5 Makefile
VERSION = 2
PATCHLEVEL = 6
SUBLEVEL = 13
EXTRAVERSION =
NAME=Woozy Numbat
juhl@dragon:~/download/kernel/linux-2.6.13$ grep -A 1 strtok
drivers/video/au1100fb.c
        for(this_opt=strtok(options, ","); this_opt;
            this_opt=strtok(NULL, ",")) {
                if (!strncmp(this_opt, "panel:", 6)) {

And the patch I created still applies just fine.


-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
  2005-08-29 15:00       ` Jesper Juhl
@ 2005-08-29 15:06         ` Pete Popov
  2005-08-29 15:08           ` Jesper Juhl
  0 siblings, 1 reply; 7+ messages in thread
From: Pete Popov @ 2005-08-29 15:06 UTC (permalink / raw)
  To: Jesper Juhl; +Cc: linux-kernel@vger.kernel.org

> Then I must be blind, because I still see the old strtok() using code
> in there :

You must be looking at kernel.org. I'm talking about linux-mips.  Any
linux mips patches should go through linux-mips.org and Ralf eventually
gets them into kernel.org.

Pete

> juhl@dragon:~/download/kernel/linux-2.6.13$ head -n 5 Makefile
> VERSION = 2
> PATCHLEVEL = 6
> SUBLEVEL = 13
> EXTRAVERSION =
> NAME=Woozy Numbat
> juhl@dragon:~/download/kernel/linux-2.6.13$ grep -A 1 strtok
> drivers/video/au1100fb.c
>         for(this_opt=strtok(options, ","); this_opt;
>             this_opt=strtok(NULL, ",")) {
>                 if (!strncmp(this_opt, "panel:", 6)) {
> 
> And the patch I created still applies just fine.
> 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c
  2005-08-29 15:06         ` Pete Popov
@ 2005-08-29 15:08           ` Jesper Juhl
  0 siblings, 0 replies; 7+ messages in thread
From: Jesper Juhl @ 2005-08-29 15:08 UTC (permalink / raw)
  To: Pete Popov; +Cc: linux-kernel@vger.kernel.org

On 8/29/05, Pete Popov <ppopov@mvista.com> wrote:
> > Then I must be blind, because I still see the old strtok() using code
> > in there :
> 
> You must be looking at kernel.org. I'm talking about linux-mips.  Any

Yes, I was looking at 2.6.13 from kernel.org. 

> linux mips patches should go through linux-mips.org and Ralf eventually
> gets them into kernel.org.
> 
Ohh, ok.  No problem then :)

-- 
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please      http://www.expita.com/nomime.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-08-29 15:08 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-24 19:08 [PATCH 2/3] exterminate strtok - drivers/video/au1100fb.c Jesper Juhl
2005-08-25  6:16 ` Pete Popov
2005-08-29 11:43   ` Jesper Juhl
2005-08-29 14:49     ` Pete Popov
2005-08-29 15:00       ` Jesper Juhl
2005-08-29 15:06         ` Pete Popov
2005-08-29 15:08           ` Jesper Juhl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox