diff options
author | Rikard Falkeborn <rikard.falkeborn@gmail.com> | 2020-09-22 00:13:43 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-09-27 11:26:00 +0200 |
commit | 2d4ffef1de00c883649b934bcc20109e28d2c9b4 (patch) | |
tree | 38f54c29bb61e338cd49e37c4304f9fbc2c5974e /drivers/media/dvb-frontends/tda18271c2dd.c | |
parent | cf580e11fb6c94bc995dddc55489c65d0499cdd9 (diff) | |
download | linux-stable-2d4ffef1de00c883649b934bcc20109e28d2c9b4.tar.gz linux-stable-2d4ffef1de00c883649b934bcc20109e28d2c9b4.tar.bz2 linux-stable-2d4ffef1de00c883649b934bcc20109e28d2c9b4.zip |
media: dvb-frontends: tda18271c2dd: Constify static structs
Constify a number of static structs that were not modified. In order to
be able to do that, const input arguments to a couple of functions that
not modify their argument. This allows the compiler to put them in
read-only memory, resulting in about 6k memory being read-only, and the
resulting module is 400 bytes smaller.
Before:
text data bss dec hex filename
15492 6873 0 22365 575d drivers/media/dvb-frontends/tda18271c2dd.ko
After:
text data bss dec hex filename
21021 897 0 21918 559e drivers/media/dvb-frontends/tda18271c2dd.ko
Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/media/dvb-frontends/tda18271c2dd.c')
-rw-r--r-- | drivers/media/dvb-frontends/tda18271c2dd.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/drivers/media/dvb-frontends/tda18271c2dd.c b/drivers/media/dvb-frontends/tda18271c2dd.c index 43312bba1aec..a34834487943 100644 --- a/drivers/media/dvb-frontends/tda18271c2dd.c +++ b/drivers/media/dvb-frontends/tda18271c2dd.c @@ -198,58 +198,55 @@ static void reset(struct tda_state *state) state->m_bFMInput = (ulFMInput == 2); } -static bool SearchMap1(struct SMap Map[], - u32 Frequency, u8 *pParam) +static bool SearchMap1(const struct SMap map[], u32 frequency, u8 *param) { int i = 0; - while ((Map[i].m_Frequency != 0) && (Frequency > Map[i].m_Frequency)) + while ((map[i].m_Frequency != 0) && (frequency > map[i].m_Frequency)) i += 1; - if (Map[i].m_Frequency == 0) + if (map[i].m_Frequency == 0) return false; - *pParam = Map[i].m_Param; + *param = map[i].m_Param; return true; } -static bool SearchMap2(struct SMapI Map[], - u32 Frequency, s32 *pParam) +static bool SearchMap2(const struct SMapI map[], u32 frequency, s32 *param) { int i = 0; - while ((Map[i].m_Frequency != 0) && - (Frequency > Map[i].m_Frequency)) + while ((map[i].m_Frequency != 0) && + (frequency > map[i].m_Frequency)) i += 1; - if (Map[i].m_Frequency == 0) + if (map[i].m_Frequency == 0) return false; - *pParam = Map[i].m_Param; + *param = map[i].m_Param; return true; } -static bool SearchMap3(struct SMap2 Map[], u32 Frequency, - u8 *pParam1, u8 *pParam2) +static bool SearchMap3(const struct SMap2 map[], u32 frequency, u8 *param1, + u8 *param2) { int i = 0; - while ((Map[i].m_Frequency != 0) && - (Frequency > Map[i].m_Frequency)) + while ((map[i].m_Frequency != 0) && + (frequency > map[i].m_Frequency)) i += 1; - if (Map[i].m_Frequency == 0) + if (map[i].m_Frequency == 0) return false; - *pParam1 = Map[i].m_Param1; - *pParam2 = Map[i].m_Param2; + *param1 = map[i].m_Param1; + *param2 = map[i].m_Param2; return true; } -static bool SearchMap4(struct SRFBandMap Map[], - u32 Frequency, u8 *pRFBand) +static bool SearchMap4(const struct SRFBandMap map[], u32 frequency, u8 *rfband) { int i = 0; - while (i < 7 && (Frequency > Map[i].m_RF_max)) + while (i < 7 && (frequency > map[i].m_RF_max)) i += 1; if (i == 7) return false; - *pRFBand = i; + *rfband = i; return true; } |