mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: LKML <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>,
	"Ronald S. Bultje" <rbultje@ronald.bitfreak.net>
Subject: [PATCH 7/8] bt856: Spare memory
Date: Mon, 13 Mar 2006 21:35:30 +0100	[thread overview]
Message-ID: <20060313213530.626ac539.khali@linux-fr.org> (raw)
In-Reply-To: <20060313210933.88a42375.khali@linux-fr.org>

The bt856 driver has a register cache much larger than needed. We
really only write to 3 registers, so a 32-byte cache is a bit too
much. We can be just as efficient with a 6-byte cache. We could even
do with a 3-byte cache, but at the cost of additional arithmetics
arguably not worth the spared 3 bytes.

Also, 4 of the 6 other members of the bt856 data structure were not
used anywhere, so we can as well drop them for an additional 16 bytes
of memory spared.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
---
 drivers/media/video/bt856.c |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

--- linux-2.6.16-rc5.orig/drivers/media/video/bt856.c	2006-03-01 21:09:59.000000000 +0100
+++ linux-2.6.16-rc5/drivers/media/video/bt856.c	2006-03-01 21:10:19.000000000 +0100
@@ -70,17 +70,14 @@
 
 /* ----------------------------------------------------------------------- */
 
-#define REG_OFFSET  0xCE
+#define REG_OFFSET	0xDA
+#define BT856_NR_REG	6
 
 struct bt856 {
-	unsigned char reg[32];
+	unsigned char reg[BT856_NR_REG];
 
 	int norm;
 	int enable;
-	int bright;
-	int contrast;
-	int hue;
-	int sat;
 };
 
 #define   I2C_BT856        0x88
@@ -119,8 +116,8 @@
 	struct bt856 *encoder = i2c_get_clientdata(client);
 
 	printk(KERN_INFO "%s: register dump:", I2C_NAME(client));
-	for (i = 0xd6; i <= 0xde; i += 2)
-		printk(" %02x", encoder->reg[i - REG_OFFSET]);
+	for (i = 0; i < BT856_NR_REG; i += 2)
+		printk(" %02x", encoder->reg[i]);
 	printk("\n");
 }
 

-- 
Jean Delvare

  parent reply	other threads:[~2006-03-13 20:35 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-13 20:09 [PATCH 0/8] Zoran drivers updates Jean Delvare
2006-03-13 20:29 ` [PATCH 1/8] saa7110: Fix array overrun Jean Delvare
2006-03-13 20:29 ` [PATCH 2/8] saa7111: Prevent " Jean Delvare
2006-03-13 20:30 ` [PATCH 3/8] saa7114: Fix i2c block write Jean Delvare
2006-03-13 20:31 ` [PATCH 4/8] adv7175: Drop unused encoder dump command Jean Delvare
2006-03-13 20:32 ` [PATCH 5/8] adv7175: Drop unused register cache Jean Delvare
2006-03-13 20:34 ` [PATCH 6/8] zoran: Use i2c_master_send when possible Jean Delvare
2006-03-13 20:35 ` Jean Delvare [this message]
2006-03-13 20:36 ` [PATCH 8/8] zoran: Init cleanups Jean Delvare
2006-03-27  5:09   ` Ronald S. Bultje
2006-03-13 20:53 ` [PATCH 0/8] Zoran drivers updates Ronald S. Bultje

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=20060313213530.626ac539.khali@linux-fr.org \
    --to=khali@linux-fr.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rbultje@ronald.bitfreak.net \
    /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

all inboxes | Powered by JetHome®