Skip to contentSkip to conversation

input-ps2: sprintf() params missing

PATCH In review Chip Salzenberg 3 participants 3 messages Oct 18, 2001 – Oct 20, 2001

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 input-ps2: sprintf() params missing

The recently advertised input-ps2 patch has a minor repeated bug, in that sprintf() calls are made without enough parameters. I'm not sure what the right fix is, but the attached patch at least calls sprintf() correctly.

Signature · 2 lines
Chip Salzenberg               - a.k.a. -              <[email protected]>
 "We have no fuel on board, plus or minus 8 kilograms."  -- NEAR tech

Index: drivers/char/atkbd.c

char/atkbd.c renamed from char/atkbd.c.old +1 -1
@@ -493,5 +493,5 @@
 		sprintf(atkbd->name, "AT Set %d keyboard", atkbd->set);
 
-	sprintf(atkbd->phys, "%s/input0\n");
+	sprintf(atkbd->phys, "/dev/serio%d", serio->number);
 
 	if (atkbd->set == 3)

Index: drivers/char/psmouse.c

char/psmouse.c renamed from char/psmouse.c.old +1 -1
@@ -609,5 +609,5 @@
 	sprintf(psmouse->devname, "%s %s %s",
 		psmouse_protocols[psmouse->type], psmouse->vendor, psmouse->name);
-	sprintf(psmouse->phys, "%s/input0\n");
+	sprintf(psmouse->phys, "/dev/serio%d", serio->number);
 
 	psmouse->dev.name = psmouse->devname;

Index: drivers/char/xtkbd.c

char/xtkbd.c renamed from char/xtkbd.c.old +1 -1
@@ -115,5 +115,5 @@
 	clear_bit(0, xtkbd->dev.keybit);
 
-	sprintf(xtkbd->phys, "%s/input0\n");
+	sprintf(xtkbd->phys, "/dev/serio%d", serio->number);
 
 	xtkbd->dev.name = xtkbd_name;
#1 lore raw
Quoted 5 lines

The recently advertised input-ps2 patch has a minor repeated bug, in that sprintf() calls are made without enough parameters. I'm not sure what the right fix is, but the attached patch at least calls sprintf() correctly.

Oops. It was a quick fix to deal with the extra field we have in struct serio whcih is not in the standard kernel. Thank you for the fix.

#2 lore raw
In reply to Chip Salzenberg
Quoted 7 lines · Chip Salzenberg

The recently advertised input-ps2 patch has a minor repeated bug, in that sprintf() calls are made without enough parameters. I'm not sure what the right fix is, but the attached patch at least calls sprintf() correctly.

Signature · 2 lines
Chip Salzenberg               - a.k.a. -              <[email protected]>
 "We have no fuel on board, plus or minus 8 kilograms."  -- NEAR tech

The correct lines should look like this:

sprintf(atkbd->phys, "%s/input0", serio->phys);

It's in the CVS, anyway.

Quoted 33 lines

Index: drivers/char/atkbd.c

char/atkbd.c renamed from char/atkbd.c.old +1 -1
@@ -493,5 +493,5 @@
 		sprintf(atkbd->name, "AT Set %d keyboard", atkbd->set);
 
-	sprintf(atkbd->phys, "%s/input0\n");
+	sprintf(atkbd->phys, "/dev/serio%d", serio->number);
 
 	if (atkbd->set == 3)

Index: drivers/char/psmouse.c

char/psmouse.c renamed from char/psmouse.c.old +1 -1
@@ -609,5 +609,5 @@
 	sprintf(psmouse->devname, "%s %s %s",
 		psmouse_protocols[psmouse->type], psmouse->vendor, psmouse->name);
-	sprintf(psmouse->phys, "%s/input0\n");
+	sprintf(psmouse->phys, "/dev/serio%d", serio->number);
 
 	psmouse->dev.name = psmouse->devname;

Index: drivers/char/xtkbd.c

char/xtkbd.c renamed from char/xtkbd.c.old +1 -1
@@ -115,5 +115,5 @@
 	clear_bit(0, xtkbd->dev.keybit);
 
-	sprintf(xtkbd->phys, "%s/input0\n");
+	sprintf(xtkbd->phys, "/dev/serio%d", serio->number);
 
 	xtkbd->dev.name = xtkbd_name;
Signature · 2 lines
Vojtech Pavlik
SuSE Labs