diff options
author | David Brownell <david-b@pacbell.net> | 2007-05-01 17:26:28 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-05-01 17:26:28 -0400 |
commit | 2096b956d24c4b5950b808fc23b218425d79ebb1 (patch) | |
tree | 9e2c09c2e40c65bd56cbfd50955d5c7355474655 /drivers/video | |
parent | 4ad4eac60667f7c321faae28a3437f7a8b3d17cb (diff) |
i2c: Shrink struct i2c_client
This shrinks the size of "struct i2c_client" by 40 bytes:
- Substantially shrinks the string used to identify the chip type
- The "flags" don't need to be so big
- Removes some internal padding
It also adds kerneldoc for that struct, explaining how "name" is really a
chip type identifier; it's otherwise potentially confusing.
Because the I2C_NAME_SIZE symbol was abused for both i2c_client.name
and for i2c_adapter.name, this needed to affect i2c_adapter too. The
adapters which used that symbol now use the more-obviously-correct
idiom of taking the size of that field.
JD: Shorten i2c_adapter.name from 50 to 48 bytes while we're here, to
avoid wasting space in padding.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/intelfb/intelfb_i2c.c | 3 | ||||
-rw-r--r-- | drivers/video/matrox/i2c-matroxfb.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/drivers/video/intelfb/intelfb_i2c.c b/drivers/video/intelfb/intelfb_i2c.c index f4ede5f6b588..61e4c8759b23 100644 --- a/drivers/video/intelfb/intelfb_i2c.c +++ b/drivers/video/intelfb/intelfb_i2c.c | |||
@@ -104,7 +104,8 @@ static int intelfb_setup_i2c_bus(struct intelfb_info *dinfo, | |||
104 | 104 | ||
105 | chan->dinfo = dinfo; | 105 | chan->dinfo = dinfo; |
106 | chan->reg = reg; | 106 | chan->reg = reg; |
107 | snprintf(chan->adapter.name, I2C_NAME_SIZE, "intelfb %s", name); | 107 | snprintf(chan->adapter.name, sizeof(chan->adapter.name), |
108 | "intelfb %s", name); | ||
108 | chan->adapter.owner = THIS_MODULE; | 109 | chan->adapter.owner = THIS_MODULE; |
109 | chan->adapter.id = I2C_HW_B_INTELFB; | 110 | chan->adapter.id = I2C_HW_B_INTELFB; |
110 | chan->adapter.algo_data = &chan->algo; | 111 | chan->adapter.algo_data = &chan->algo; |
diff --git a/drivers/video/matrox/i2c-matroxfb.c b/drivers/video/matrox/i2c-matroxfb.c index 5ec718a5fe22..4baab7be58de 100644 --- a/drivers/video/matrox/i2c-matroxfb.c +++ b/drivers/video/matrox/i2c-matroxfb.c | |||
@@ -111,7 +111,7 @@ static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, | |||
111 | b->mask.data = data; | 111 | b->mask.data = data; |
112 | b->mask.clock = clock; | 112 | b->mask.clock = clock; |
113 | b->adapter = matrox_i2c_adapter_template; | 113 | b->adapter = matrox_i2c_adapter_template; |
114 | snprintf(b->adapter.name, I2C_NAME_SIZE, name, | 114 | snprintf(b->adapter.name, sizeof(b->adapter.name), name, |
115 | minfo->fbcon.node); | 115 | minfo->fbcon.node); |
116 | i2c_set_adapdata(&b->adapter, b); | 116 | i2c_set_adapdata(&b->adapter, b); |
117 | b->adapter.algo_data = &b->bac; | 117 | b->adapter.algo_data = &b->bac; |