All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
To: Linux Media Mailing List <linux-media@vger.kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Mauro Carvalho Chehab <mchehab@infradead.org>,
	Jemma Denson <jdenson@gmail.com>,
	Patrick Boettcher <patrick.boettcher@posteo.de>
Subject: [PATCH 3/3] cx24120: constify static data
Date: Tue, 19 May 2015 08:23:38 -0300	[thread overview]
Message-ID: <ed8e1da77d31ecd9f1509d160c9d990c58faae22.1432034614.git.mchehab@osg.samsung.com> (raw)
In-Reply-To: <8bf9e159ce96223ad404207d94e8e3742f2474de.1432034614.git.mchehab@osg.samsung.com>
In-Reply-To: <8bf9e159ce96223ad404207d94e8e3742f2474de.1432034614.git.mchehab@osg.samsung.com>

Use const on the static data, as gcc may optimize better the
code. Also, would prevent that some code would override the
data there.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

diff --git a/drivers/media/dvb-frontends/cx24120.c b/drivers/media/dvb-frontends/cx24120.c
index 2dcd93f63408..2b3f83d5b997 100644
--- a/drivers/media/dvb-frontends/cx24120.c
+++ b/drivers/media/dvb-frontends/cx24120.c
@@ -704,12 +704,14 @@ static int cx24120_read_status(struct dvb_frontend *fe, fe_status_t *status)
  * Used for decoding the REG_FECMODE register
  * once tuned in.
  */
-static struct cx24120_modfec {
+struct cx24120_modfec {
 	fe_delivery_system_t delsys;
 	fe_modulation_t mod;
 	fe_code_rate_t fec;
 	u8 val;
-} modfec_lookup_table[] = {
+};
+
+static const struct cx24120_modfec modfec_lookup_table[] = {
 	/*delsys     mod    fec       val */
 	{ SYS_DVBS,  QPSK,  FEC_1_2,  0x01 },
 	{ SYS_DVBS,  QPSK,  FEC_2_3,  0x02 },
@@ -784,7 +786,7 @@ static int cx24120_get_fec(struct dvb_frontend *fe)
  * There's probably some way of calculating these but I
  * can't determine the pattern
  */
-static struct cx24120_clock_ratios_table {
+struct cx24120_clock_ratios_table {
 	fe_delivery_system_t delsys;
 	fe_pilot_t pilot;
 	fe_modulation_t mod;
@@ -792,7 +794,9 @@ static struct cx24120_clock_ratios_table {
 	u32 m_rat;
 	u32 n_rat;
 	u32 rate;
-} clock_ratios_table[] = {
+};
+
+static const struct cx24120_clock_ratios_table clock_ratios_table[] = {
 	/*delsys     pilot      mod    fec       m_rat    n_rat   rate */
 	{ SYS_DVBS2, PILOT_OFF, QPSK,  FEC_1_2,  273088,  254505, 274 },
 	{ SYS_DVBS2, PILOT_OFF, QPSK,  FEC_3_5,  17272,   13395,  330 },
@@ -921,12 +925,14 @@ static int cx24120_set_inversion(struct cx24120_state *state,
 }
 
 /* FEC lookup table for tuning */
-static struct cx24120_modfec_table {
+struct cx24120_modfec_table {
 	fe_delivery_system_t delsys;
 	fe_modulation_t mod;
 	fe_code_rate_t fec;
 	u8 val;
-} modfec_table[] = {
+};
+
+static const struct cx24120_modfec_table modfec_table[] = {
 	/*delsys     mod    fec       val */
 	{ SYS_DVBS,  QPSK,  FEC_1_2,  0x2e },
 	{ SYS_DVBS,  QPSK,  FEC_2_3,  0x2f },
-- 
2.1.0


  parent reply	other threads:[~2015-05-19 11:23 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 11:23 [PATCH 1/3] cx24120: don't initialize a var that won't be used Mauro Carvalho Chehab
2015-05-19 11:23 ` [PATCH 2/3] cx24120: declare cx24120_init() as static Mauro Carvalho Chehab
2015-05-19 11:23 ` Mauro Carvalho Chehab [this message]
2015-05-19 12:11 ` [PATCH 1/3] cx24120: don't initialize a var that won't be used Patrick Boettcher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ed8e1da77d31ecd9f1509d160c9d990c58faae22.1432034614.git.mchehab@osg.samsung.com \
    --to=mchehab@osg.samsung.com \
    --cc=jdenson@gmail.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.org \
    --cc=patrick.boettcher@posteo.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.