1
linux/drivers/media/video/usbvision
Trent Piepho c682b3a7fb V4L/DVB (5517): Usbvision: store the device database more efficiently
One bit wide bitfields need to declared unsigned to have the range 0 to
1, or they have the range -1 to 0.

A few techniques to reduce the driver's size by about 1700 bytes on ia32,
probably more on x86-64.

Put the biggest fields first, less padding is necessary that way.

Put fields with a limited range into a smaller type.  For example
VideoChannels will fit in 3 bits, and TunerType can use 8 bits.

Vin_Reg1, Vin_Reg2, and Dvi_yuv define values for 8-bit registers, but
they can't just go into an 8-bit field with no changes, since -1 was used
as a flag to indicate a value was not present.  So what we do is create a
one-bit flag for each one to indicate if a value is or is not present.

This only takes 9 bits and has the added advantage that when the register
isn't overridden (Vin_Reg[12] never are) it doesn't need to appear in the
structure definition since the default value for the flag will be zero.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Thierry MERLE <thierry.merle@free.fr>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-04-27 15:45:34 -03:00
..
Kconfig V4L/DVB (5206): Usbvision: set alternate interface modification 2007-02-21 13:35:19 -02:00
Makefile V4L/DVB (4937): Usbvision cleanup and code reorganization 2006-12-10 09:22:49 -02:00
usbvision-cards.c V4L/DVB (5517): Usbvision: store the device database more efficiently 2007-04-27 15:45:34 -03:00
usbvision-cards.h V4L/DVB (5515): Use a better format to represent usbvision supported boards 2007-04-27 15:45:32 -03:00
usbvision-core.c V4L/DVB (5517): Usbvision: store the device database more efficiently 2007-04-27 15:45:34 -03:00
usbvision-i2c.c [PATCH] remove many unneeded #includes of sched.h 2007-02-14 08:09:54 -08:00
usbvision-video.c V4L/DVB (5517): Usbvision: store the device database more efficiently 2007-04-27 15:45:34 -03:00
usbvision.h V4L/DVB (5517): Usbvision: store the device database more efficiently 2007-04-27 15:45:34 -03:00