Skip to contentSkip to conversation

Simplify tosh_get_info() in drivers/char/toshiba.c

PATCH New Michael Opdenacker 1 participant 1 message Jan 16, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Simplify tosh_get_info() in drivers/char/toshiba.c

This patch against 2.6.15 is just a trivial simplification of tosh_get_info() in drivers/char/toshiba.c. It was doing something like: b=a; b+=c; return b-a;
Replaced by: return c;
Also removed an unnecessary local variable.

drivers/char/toshiba.c +0 -0
diff -pruN linux-2.6.15/drivers/char/toshiba.c linux-2.6.15-toshiba/drivers/char/toshiba.c
@@ -299,12 +299,6 @@ static int tosh_ioctl(struct inode *ip, #ifdef CONFIG_PROC_FS

static int tosh_get_info(char *buffer, char **start, off_t fpos, int length) {
- char *temp;
- int key;
-
- temp = buffer;
- key = tosh_fn_status();
-
/* Arguments
0) Linux driver version (this will change if format changes)
1) Machine ID
@@ -314,16 +308,14 @@ static int tosh_get_info(char *buffer, c

	     5) Fn Key status
	*/

- temp += sprintf(temp, "1.1 0x%04x %d.%d %d.%d 0x%04x 0x%02x\n",
+ return sprintf(buffer, "1.1 0x%04x %d.%d %d.%d 0x%04x 0x%02x\n",

		tosh_id,
		(tosh_sci & 0xff00)>>8,
		tosh_sci & 0xff,
		(tosh_bios & 0xff00)>>8,
		tosh_bios & 0xff,
		tosh_date,

- key);
-
- return temp-buffer;
+ tosh_fn_status());
}
#endif

Signature · 3 lines
Michael Opdenacker, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training