Re: [patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-17 Thread Sam Ravnborg
On Fri, Mar 18, 2005 at 03:46:20AM +0100, Nicolas Kaiser wrote:
> * Sam Ravnborg <[EMAIL PROTECTED]>:
> 
> > On Sat, Mar 05, 2005 at 04:35:45PM +0100, [EMAIL PROTECTED] wrote:
> > > 
> > > Replaces strtok() with strsep()
> > 
> > Why - does it increase portability?
> 
>  "strtok() is not thread and SMP safe and strsep() should be
> used instead"
> 
> http://janitor.kernelnewbies.org/docs/driver-howto.html#3.3.1

It does not matter in this particular file.
But applied for consistency (so it does not show up if you grep for it).

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-17 Thread Nicolas Kaiser
* Sam Ravnborg <[EMAIL PROTECTED]>:

> On Sat, Mar 05, 2005 at 04:35:45PM +0100, [EMAIL PROTECTED] wrote:
> > 
> > Replaces strtok() with strsep()
> 
> Why - does it increase portability?

 "strtok() is not thread and SMP safe and strsep() should be
used instead"

http://janitor.kernelnewbies.org/docs/driver-howto.html#3.3.1

Cheers,
n.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-17 Thread Sam Ravnborg
On Sat, Mar 05, 2005 at 04:35:45PM +0100, [EMAIL PROTECTED] wrote:
> 
> Replaces strtok() with strsep()

Why - does it increase portability?

Sam
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-17 Thread Sam Ravnborg
On Sat, Mar 05, 2005 at 04:35:45PM +0100, [EMAIL PROTECTED] wrote:
 
 Replaces strtok() with strsep()

Why - does it increase portability?

Sam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-17 Thread Nicolas Kaiser
* Sam Ravnborg [EMAIL PROTECTED]:

 On Sat, Mar 05, 2005 at 04:35:45PM +0100, [EMAIL PROTECTED] wrote:
  
  Replaces strtok() with strsep()
 
 Why - does it increase portability?

 strtok() is not thread and SMP safe and strsep() should be
used instead

http://janitor.kernelnewbies.org/docs/driver-howto.html#3.3.1

Cheers,
n.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-17 Thread Sam Ravnborg
On Fri, Mar 18, 2005 at 03:46:20AM +0100, Nicolas Kaiser wrote:
 * Sam Ravnborg [EMAIL PROTECTED]:
 
  On Sat, Mar 05, 2005 at 04:35:45PM +0100, [EMAIL PROTECTED] wrote:
   
   Replaces strtok() with strsep()
  
  Why - does it increase portability?
 
  strtok() is not thread and SMP safe and strsep() should be
 used instead
 
 http://janitor.kernelnewbies.org/docs/driver-howto.html#3.3.1

It does not matter in this particular file.
But applied for consistency (so it does not show up if you grep for it).

Sam
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-05 Thread domen

Replaces strtok() with strsep()
 
 Signed-off-by: Nicolas Kaiser <[EMAIL PROTECTED]>
Signed-off-by: Domen Puncer <[EMAIL PROTECTED]>
---


 kj-domen/scripts/mod/sumversion.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN scripts/mod/sumversion.c~strtok-scripts_mod_sumversion 
scripts/mod/sumversion.c
--- kj/scripts/mod/sumversion.c~strtok-scripts_mod_sumversion   2005-03-05 
16:13:15.0 +0100
+++ kj-domen/scripts/mod/sumversion.c   2005-03-05 16:13:15.0 +0100
@@ -419,7 +419,9 @@ void get_src_version(const char *modname
*end = '\0';
 
md4_init();
-   for (fname = strtok(sources, " "); fname; fname = strtok(NULL, " ")) {
+   while ((fname = strsep(, " ")) != NULL) {
+   if (!*fname)
+   continue;
if (!parse_source_files(fname, ))
goto release;
}
_
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[patch 12/12] scripts/mod/sumversion.c: replace strtok() with strsep()

2005-03-05 Thread domen

Replaces strtok() with strsep()
 
 Signed-off-by: Nicolas Kaiser [EMAIL PROTECTED]
Signed-off-by: Domen Puncer [EMAIL PROTECTED]
---


 kj-domen/scripts/mod/sumversion.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff -puN scripts/mod/sumversion.c~strtok-scripts_mod_sumversion 
scripts/mod/sumversion.c
--- kj/scripts/mod/sumversion.c~strtok-scripts_mod_sumversion   2005-03-05 
16:13:15.0 +0100
+++ kj-domen/scripts/mod/sumversion.c   2005-03-05 16:13:15.0 +0100
@@ -419,7 +419,9 @@ void get_src_version(const char *modname
*end = '\0';
 
md4_init(md);
-   for (fname = strtok(sources,  ); fname; fname = strtok(NULL,  )) {
+   while ((fname = strsep(sources,  )) != NULL) {
+   if (!*fname)
+   continue;
if (!parse_source_files(fname, md))
goto release;
}
_
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/