Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

media: dvb-frontends/stv{0910,6111}: constify tables

Mark lookup tables and fe_ops things const so the compiler can put them
into .rodata.

While at it, improve name and identifier strings (moddesc, fe_ops).

Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>

authored by

Daniel Scheller and committed by
Mauro Carvalho Chehab
20e671df 85e36b47

+22 -21
+12 -12
drivers/media/dvb-frontends/stv0910.c
··· 207 207 return status; 208 208 } 209 209 210 - static struct slookup s1_sn_lookup[] = { 210 + static const struct slookup s1_sn_lookup[] = { 211 211 { 0, 9242 }, /* C/N= 0dB */ 212 212 { 5, 9105 }, /* C/N= 0.5dB */ 213 213 { 10, 8950 }, /* C/N= 1.0dB */ ··· 264 264 { 510, 425 } /* C/N=51.0dB */ 265 265 }; 266 266 267 - static struct slookup s2_sn_lookup[] = { 267 + static const struct slookup s2_sn_lookup[] = { 268 268 { -30, 13950 }, /* C/N=-2.5dB */ 269 269 { -25, 13580 }, /* C/N=-2.5dB */ 270 270 { -20, 13150 }, /* C/N=-2.0dB */ ··· 327 327 { 510, 463 }, /* C/N=51.0dB */ 328 328 }; 329 329 330 - static struct slookup padc_lookup[] = { 330 + static const struct slookup padc_lookup[] = { 331 331 { 0, 118000 }, /* PADC= +0dBm */ 332 332 { -100, 93600 }, /* PADC= -1dBm */ 333 333 { -200, 74500 }, /* PADC= -2dBm */ ··· 349 349 /********************************************************************* 350 350 * Tracking carrier loop carrier QPSK 1/4 to 8PSK 9/10 long Frame 351 351 *********************************************************************/ 352 - static u8 s2car_loop[] = { 352 + static const u8 s2car_loop[] = { 353 353 /* 354 354 * Modcod 2MPon 2MPoff 5MPon 5MPoff 10MPon 10MPoff 355 355 * 20MPon 20MPoff 30MPon 30MPoff ··· 587 587 return 0; 588 588 } 589 589 590 - static s32 table_lookup(struct slookup *table, 590 + static s32 table_lookup(const struct slookup *table, 591 591 int table_size, u32 reg_value) 592 592 { 593 593 s32 value; ··· 629 629 u8 data1; 630 630 u16 data; 631 631 int n_lookup; 632 - struct slookup *lookup; 632 + const struct slookup *lookup; 633 633 634 634 *signal_to_noise = 0; 635 635 ··· 693 693 694 694 static u32 dvbs2_nbch(enum dvbs2_mod_cod mod_cod, enum dvbs2_fectype fectype) 695 695 { 696 - static u32 nbch[][2] = { 696 + static const u32 nbch[][2] = { 697 697 { 0, 0}, /* DUMMY_PLF */ 698 698 {16200, 3240}, /* QPSK_1_4, */ 699 699 {21600, 5400}, /* QPSK_1_3, */ ··· 953 953 954 954 static int set_vth(struct stv *state) 955 955 { 956 - static struct slookup vthlookup_table[] = { 956 + static const struct slookup vthlookup_table[] = { 957 957 {250, 8780}, /* C/N= 1.5dB */ 958 958 {100, 7405}, /* C/N= 4.5dB */ 959 959 {40, 6330}, /* C/N= 6.5dB */ ··· 1515 1515 1516 1516 if (state->receive_mode == RCVMODE_DVBS2) { 1517 1517 u32 mc; 1518 - enum fe_modulation modcod2mod[0x20] = { 1518 + const enum fe_modulation modcod2mod[0x20] = { 1519 1519 QPSK, QPSK, QPSK, QPSK, 1520 1520 QPSK, QPSK, QPSK, QPSK, 1521 1521 QPSK, QPSK, QPSK, QPSK, ··· 1525 1525 APSK_32, APSK_32, APSK_32, APSK_32, 1526 1526 APSK_32, 1527 1527 }; 1528 - enum fe_code_rate modcod2fec[0x20] = { 1528 + const enum fe_code_rate modcod2fec[0x20] = { 1529 1529 FEC_NONE, FEC_NONE, FEC_NONE, FEC_2_5, 1530 1530 FEC_1_2, FEC_3_5, FEC_2_3, FEC_3_4, 1531 1531 FEC_4_5, FEC_5_6, FEC_8_9, FEC_9_10, ··· 1673 1673 return 0; 1674 1674 } 1675 1675 1676 - static struct dvb_frontend_ops stv0910_ops = { 1676 + static const struct dvb_frontend_ops stv0910_ops = { 1677 1677 .delsys = { SYS_DVBS, SYS_DVBS2, SYS_DSS }, 1678 1678 .info = { 1679 - .name = "STV0910", 1679 + .name = "ST STV0910", 1680 1680 .frequency_min = 950000, 1681 1681 .frequency_max = 2150000, 1682 1682 .frequency_stepsize = 0,
+10 -9
drivers/media/dvb-frontends/stv6111.c
··· 41 41 u16 reg_value; 42 42 }; 43 43 44 - static struct slookup lnagain_nf_lookup[] = { 44 + static const struct slookup lnagain_nf_lookup[] = { 45 45 /* Gain *100dB // Reg */ 46 46 { 2572, 0 }, 47 47 { 2575, 1 }, ··· 77 77 { 5102, 31 } 78 78 }; 79 79 80 - static struct slookup lnagain_iip3_lookup[] = { 80 + static const struct slookup lnagain_iip3_lookup[] = { 81 81 /* Gain *100dB // reg */ 82 82 { 1548, 0 }, 83 83 { 1552, 1 }, ··· 113 113 { 4535, 31 } 114 114 }; 115 115 116 - static struct slookup gain_rfagc_lookup[] = { 116 + static const struct slookup gain_rfagc_lookup[] = { 117 117 /* Gain *100dB // reg */ 118 118 { 4870, 0x3000 }, 119 119 { 4850, 0x3C00 }, ··· 173 173 * This table is 6 dB too low comapred to the others (probably created with 174 174 * a different BB_MAG setting) 175 175 */ 176 - static struct slookup gain_channel_agc_nf_lookup[] = { 176 + static const struct slookup gain_channel_agc_nf_lookup[] = { 177 177 /* Gain *100dB // reg */ 178 178 { 7082, 0x3000 }, 179 179 { 7052, 0x4000 }, ··· 232 232 { 1927, 0xFF00 } 233 233 }; 234 234 235 - static struct slookup gain_channel_agc_iip3_lookup[] = { 235 + static const struct slookup gain_channel_agc_iip3_lookup[] = { 236 236 /* Gain *100dB // reg */ 237 237 { 7070, 0x3000 }, 238 238 { 7028, 0x4000 }, ··· 533 533 return 0; 534 534 } 535 535 536 - static s32 table_lookup(struct slookup *table, int table_size, u16 reg_value) 536 + static s32 table_lookup(const struct slookup *table, 537 + int table_size, u16 reg_value) 537 538 { 538 539 s32 gain; 539 540 s32 reg_diff; ··· 635 634 return 0; 636 635 } 637 636 638 - static struct dvb_tuner_ops tuner_ops = { 637 + static const struct dvb_tuner_ops tuner_ops = { 639 638 .info = { 640 - .name = "STV6111", 639 + .name = "ST STV6111", 641 640 .frequency_min = 950000, 642 641 .frequency_max = 2150000, 643 642 .frequency_step = 0 ··· 676 675 } 677 676 EXPORT_SYMBOL_GPL(stv6111_attach); 678 677 679 - MODULE_DESCRIPTION("STV6111 driver"); 678 + MODULE_DESCRIPTION("ST STV6111 satellite tuner driver"); 680 679 MODULE_AUTHOR("Ralph Metzler, Manfred Voelkel"); 681 680 MODULE_LICENSE("GPL");