Skip to contentSkip to conversation

fix compile error in usb-serial.c

PATCH Geert Uytterhoeven 2 participants 3 messages Nov 21, 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]

#1 lore raw
Quoted 25 lines · Linux Kernel Mailing List

ChangeSet 1.872.3.6, 2002/11/18 18:34:46-08:00, [email protected]

[PATCH] fix compile error in usb-serial.c

drivers/usb/serial/usb-serial.c in 2.5.48 fails to compile with the following error:

drivers/usb/serial/usb-serial.c:842: dereferencing pointer to incompletetype

Is the following patch correct?

# This patch includes the following deltas:
# ChangeSet 1.872.3.5 -> 1.872.3.6
# drivers/usb/serial/usb-serial.c 1.52 -> 1.53
#

 usb-serial.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -Nru a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c

drivers/usb/serial/usb-serial.c

Quoted 9 lines
drivers/usb/serial/usb-serial.c +1 -2
@@ -839,7 +839,7 @@
 
 		length += sprintf (page+length, "%d:", i);
 		if (serial->type->owner)
-			length += sprintf (page+length, " module:%s", serial->type->owner->name);
+			length += sprintf (page+length, " module:%s", module_name(serial->type->owner));
 		length += sprintf (page+length, " name:\"%s\"", serial->type->name);
 		length += sprintf (page+length, " vendor:%04x product:%04x", serial->vendor, serial->product);
 		length += sprintf (page+length, " num_ports:%d", serial->num_ports);
-

How can this be correct?

serial->type->owner is of type struct module *, not char *!

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

#2 lore raw
Quoted 7 lines · Geert Uytterhoeven

...

Review

Quoted 2 lines
(quoted diff) +1 -1
-			length += sprintf (page+length, " module:%s", serial->type->owner->name);
+			length += sprintf (page+length, " module:%s", module_name(serial->type->owner));

...
How can this be correct?

serial->type->owner is of type struct module *, not char *!

You missed the module_name().

Quoted 3 lines

Gr{oetje,eeting}s,

Geert

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#3 lore raw
Quoted 11 lines · Adrian Bunk
Quoted 7 lines · Geert Uytterhoeven

...

Review

Quoted 2 lines
(quoted diff) +1 -1
-			length += sprintf (page+length, " module:%s", serial->type->owner->name);
+			length += sprintf (page+length, " module:%s", module_name(serial->type->owner));

...
How can this be correct?

serial->type->owner is of type struct module *, not char *!

You missed the module_name().

Oops, you're right. Sorry...
Given enough eyeballs, all misreads are shallow :-)

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds