Skip to contentSkip to conversation

IBMMCA 2.5.31

PATCH Kronos 1 participant 1 message Aug 14, 2002 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Kronos

author
#1 lore raw

Nell'articolo <[email protected]> hai scritto:

Quoted 2 lines

I don't use this driver, so despite this patch's simplicity, please provide test info, and if i did everything right.

Well, strsep has a different prototype and different semantics, so your patch won't even compile.

This one should work:

ibmmca.c renamed from ibmmca.orig.c +4 -3
@@ -1406,9 +1406,10 @@
    io_base = 0;
    id_base = 0;
    if (str) {
-      token = strtok(str,",");
+      token = strsep(&str, ",");
       j = 0;
-      while (token) {
+      /* In case no delimiter was found str is made NULL. */
+      while (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 +1425,7 @@
 	      scsi_id[id_base++] = simple_strtoul(token,NULL,0);
 	    j++;
 	 }
-	 token = strtok(NULL,",");
+	 token = strsep(&str, ",");
       }
    } else if (ints) {
       for (i = 0; i < IM_MAX_HOSTS && 2*i+2 < ints[0]; i++) {

It compiles, but I get other errors:

kronos@dreamland:/usr/src/linux-2.5# make drivers/scsi/ibmmca.o
make[1]: Entering directory `/usr/src/linux-2.5/drivers/scsi'
  gcc -Wp,-MD,./.ibmmca.o.d -D__KERNEL__ -I/usr/src/linux-2.5/include
-Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
-march=athlon  -nostdinc -iwithprefix include
-DKBUILD_BASENAME=ibmmca   -c -o ibmmca.o ibmmca.c
ibmmca.c: In function `interrupt_handler':
ibmmca.c:508: warning: dereferencing `void *' pointer
ibmmca.c:508: request for member `host_lock' in something not a
structure or union
ibmmca.c:515: warning: dereferencing `void *' pointer
ibmmca.c:515: request for member `host_lock' in something not a
structure or union
ibmmca.c:524: warning: dereferencing `void *' pointer
ibmmca.c:524: request for member `host_lock' in something not a
structure or union
ibmmca.c:531: warning: dereferencing `void *' pointer
ibmmca.c:531: request for member `host_lock' in something not a
structure or union
ibmmca.c:532: warning: dereferencing `void *' pointer
ibmmca.c:532: request for member `host_lock' in something not a
structure or union
ibmmca.c:542: warning: dereferencing `void *' pointer
ibmmca.c:542: request for member `host_lock' in something not a
structure or union
ibmmca.c: In function `ibmmca_getinfo':
ibmmca.c:1446: warning: dereferencing `void *' pointer
ibmmca.c:1446: request for member `host_lock' in something not a
structure or union
make[1]: *** [ibmmca.o] Error 1
make[1]: Leaving directory `/usr/src/linux-2.5/drivers/scsi'
make: *** [drivers/scsi/ibmmca.o] Error 2

ciao,
Luca

Signature · 3 lines
Home: http://kronoz.cjb.net
La somma dell'intelligenza sulla terra e` una costante.
La popolazione e` in aumento.