Skip to content

Commit

Permalink
V4L/DVB (3568e): bt856: Spare memory
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
  • Loading branch information
Jean Delvare authored and Mauro Carvalho Chehab committed Mar 23, 2006
1 parent 58a0b84 commit f49a5ea
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions drivers/media/video/bt856.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,14 @@ MODULE_PARM_DESC(debug, "Debug level (0-1)");

/* ----------------------------------------------------------------------- */

#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
Expand Down Expand Up @@ -120,8 +117,8 @@ bt856_dump (struct i2c_client *client)
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");
}

Expand Down

0 comments on commit f49a5ea

Please sign in to comment.