public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Opdenacker <michael-lists@free-electrons.com>
To: linux-kernel@vger.kernel.org
Cc: Adrian Bunk <bunk@stusta.de>
Subject: [PATCH] [TRIVIAL] Simplify tosh_get_info() in drivers/char/toshiba.c
Date: Mon, 16 Jan 2006 18:07:35 +0100	[thread overview]
Message-ID: <43CBD2D7.6090101@free-electrons.com> (raw)

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.

Signed-off-by: Michael Opdenacker <michael@free-electrons.com>

diff -pruN linux-2.6.15/drivers/char/toshiba.c linux-2.6.15-toshiba/drivers/char/toshiba.c
--- linux-2.6.15/drivers/char/toshiba.c	2006-01-03 04:21:10.000000000 +0100
+++ linux-2.6.15-toshiba/drivers/char/toshiba.c	2006-01-16 10:26:02.000000000 +0100
@@ -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
 


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



             reply	other threads:[~2006-01-16 17:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-16 17:07 Michael Opdenacker [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-06-25 16:01 [PATCH] [TRIVIAL] Simplify tosh_get_info() in drivers/char/toshiba.c Michael Opdenacker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43CBD2D7.6090101@free-electrons.com \
    --to=michael-lists@free-electrons.com \
    --cc=bunk@stusta.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox