diff options
author | Colin Ian King <colin.king@canonical.com> | 2017-09-12 08:08:13 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2017-10-04 16:57:01 -0300 |
commit | 022565200a4f27ffcf9315b2194ca9454059d6b1 (patch) | |
tree | 90ac9c216283b114bb2e62ee387fdc155bed42b6 /drivers/media/usb/gspca | |
parent | bc66c99a7e65d3964b4c5d10f574d462f40ae48e (diff) |
[media] gspca: make arrays static, reduces object code size
Don't populate const arrays on the stack, instead make them
static. Makes the object code smaller by over 5200 bytes:
Before:
text data bss dec hex filename
58259 8880 128 67267 106c3 ov519.o
After:
text data bss dec hex filename
52155 9776 128 62059 f26b ov519.o
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/gspca')
-rw-r--r-- | drivers/media/usb/gspca/ov519.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/media/usb/gspca/ov519.c b/drivers/media/usb/gspca/ov519.c index cdb79c5f0c38..f1537daf4e2e 100644 --- a/drivers/media/usb/gspca/ov519.c +++ b/drivers/media/usb/gspca/ov519.c @@ -2865,7 +2865,7 @@ static void sd_reset_snapshot(struct gspca_dev *gspca_dev) static void ov51x_upload_quan_tables(struct sd *sd) { - const unsigned char yQuanTable511[] = { + static const unsigned char yQuanTable511[] = { 0, 1, 1, 2, 2, 3, 3, 4, 1, 1, 1, 2, 2, 3, 4, 4, 1, 1, 2, 2, 3, 4, 4, 4, @@ -2876,7 +2876,7 @@ static void ov51x_upload_quan_tables(struct sd *sd) 4, 4, 4, 4, 5, 5, 5, 5 }; - const unsigned char uvQuanTable511[] = { + static const unsigned char uvQuanTable511[] = { 0, 2, 2, 3, 4, 4, 4, 4, 2, 2, 2, 4, 4, 4, 4, 4, 2, 2, 3, 4, 4, 4, 4, 4, @@ -2888,13 +2888,13 @@ static void ov51x_upload_quan_tables(struct sd *sd) }; /* OV518 quantization tables are 8x4 (instead of 8x8) */ - const unsigned char yQuanTable518[] = { + static const unsigned char yQuanTable518[] = { 5, 4, 5, 6, 6, 7, 7, 7, 5, 5, 5, 5, 6, 7, 7, 7, 6, 6, 6, 6, 7, 7, 7, 8, 7, 7, 6, 7, 7, 7, 8, 8 }; - const unsigned char uvQuanTable518[] = { + static const unsigned char uvQuanTable518[] = { 6, 6, 6, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7, 7, 7, 7, 6, 6, 6, 7, 7, 7, 7, 8, @@ -2943,7 +2943,7 @@ static void ov511_configure(struct gspca_dev *gspca_dev) struct sd *sd = (struct sd *) gspca_dev; /* For 511 and 511+ */ - const struct ov_regvals init_511[] = { + static const struct ov_regvals init_511[] = { { R51x_SYS_RESET, 0x7f }, { R51x_SYS_INIT, 0x01 }, { R51x_SYS_RESET, 0x7f }, @@ -2953,7 +2953,7 @@ static void ov511_configure(struct gspca_dev *gspca_dev) { R51x_SYS_RESET, 0x3d }, }; - const struct ov_regvals norm_511[] = { + static const struct ov_regvals norm_511[] = { { R511_DRAM_FLOW_CTL, 0x01 }, { R51x_SYS_SNAP, 0x00 }, { R51x_SYS_SNAP, 0x02 }, @@ -2963,7 +2963,7 @@ static void ov511_configure(struct gspca_dev *gspca_dev) { R511_COMP_LUT_EN, 0x03 }, }; - const struct ov_regvals norm_511_p[] = { + static const struct ov_regvals norm_511_p[] = { { R511_DRAM_FLOW_CTL, 0xff }, { R51x_SYS_SNAP, 0x00 }, { R51x_SYS_SNAP, 0x02 }, @@ -2973,7 +2973,7 @@ static void ov511_configure(struct gspca_dev *gspca_dev) { R511_COMP_LUT_EN, 0x03 }, }; - const struct ov_regvals compress_511[] = { + static const struct ov_regvals compress_511[] = { { 0x70, 0x1f }, { 0x71, 0x05 }, { 0x72, 0x06 }, @@ -3009,7 +3009,7 @@ static void ov518_configure(struct gspca_dev *gspca_dev) struct sd *sd = (struct sd *) gspca_dev; /* For 518 and 518+ */ - const struct ov_regvals init_518[] = { + static const struct ov_regvals init_518[] = { { R51x_SYS_RESET, 0x40 }, { R51x_SYS_INIT, 0xe1 }, { R51x_SYS_RESET, 0x3e }, @@ -3020,7 +3020,7 @@ static void ov518_configure(struct gspca_dev *gspca_dev) { 0x5d, 0x03 }, }; - const struct ov_regvals norm_518[] = { + static const struct ov_regvals norm_518[] = { { R51x_SYS_SNAP, 0x02 }, /* Reset */ { R51x_SYS_SNAP, 0x01 }, /* Enable */ { 0x31, 0x0f }, @@ -3033,7 +3033,7 @@ static void ov518_configure(struct gspca_dev *gspca_dev) { 0x2f, 0x80 }, }; - const struct ov_regvals norm_518_p[] = { + static const struct ov_regvals norm_518_p[] = { { R51x_SYS_SNAP, 0x02 }, /* Reset */ { R51x_SYS_SNAP, 0x01 }, /* Enable */ { 0x31, 0x0f }, |