diff options
author | Joe Perches <joe@perches.com> | 2010-01-13 01:59:15 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:35 -0500 |
commit | 42a39e05928c6262347fba4ec9f649124bfc7a6f (patch) | |
tree | a7437aafc8c5373650b290af72ff52fb39a4623c /drivers/media/dvb/frontends/si21xx.c | |
parent | e34d375aa6dade342a266d40c6142d7f36e18683 (diff) |
V4L/DVB (13969): frontends/si21xx.c: Remove #define TRUE/FALSE, use bool
And a little code refactoring/neatening around the removals
Reduces object size a little bit:
new:
$ size drivers/media/dvb/frontends/si21xx.o
text data bss dec hex filename
8984 56 1816 10856 2a68 drivers/media/dvb/frontends/si21xx.o
old:
$ size drivers/media/dvb/frontends/si21xx.o
text data bss dec hex filename
9084 56 1792 10932 2ab4 drivers/media/dvb/frontends/si21xx.o
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/si21xx.c')
-rw-r--r-- | drivers/media/dvb/frontends/si21xx.c | 38 |
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/media/dvb/frontends/si21xx.c b/drivers/media/dvb/frontends/si21xx.c index 9552a22ccffb..d21a327db629 100644 --- a/drivers/media/dvb/frontends/si21xx.c +++ b/drivers/media/dvb/frontends/si21xx.c | |||
@@ -97,8 +97,6 @@ | |||
97 | #define LNB_SUPPLY_CTRL_REG_4 0xce | 97 | #define LNB_SUPPLY_CTRL_REG_4 0xce |
98 | #define LNB_SUPPLY_STATUS_REG 0xcf | 98 | #define LNB_SUPPLY_STATUS_REG 0xcf |
99 | 99 | ||
100 | #define FALSE 0 | ||
101 | #define TRUE 1 | ||
102 | #define FAIL -1 | 100 | #define FAIL -1 |
103 | #define PASS 0 | 101 | #define PASS 0 |
104 | 102 | ||
@@ -718,7 +716,7 @@ static int si21xx_set_frontend(struct dvb_frontend *fe, | |||
718 | int fine_tune_freq; | 716 | int fine_tune_freq; |
719 | unsigned char sample_rate = 0; | 717 | unsigned char sample_rate = 0; |
720 | /* boolean */ | 718 | /* boolean */ |
721 | unsigned int inband_interferer_ind; | 719 | bool inband_interferer_ind; |
722 | 720 | ||
723 | /* INTERMEDIATE VALUES */ | 721 | /* INTERMEDIATE VALUES */ |
724 | int icoarse_tune_freq; /* MHz */ | 722 | int icoarse_tune_freq; /* MHz */ |
@@ -728,15 +726,8 @@ static int si21xx_set_frontend(struct dvb_frontend *fe, | |||
728 | unsigned int x1; | 726 | unsigned int x1; |
729 | unsigned int x2; | 727 | unsigned int x2; |
730 | int i; | 728 | int i; |
731 | unsigned int inband_interferer_div2[ALLOWABLE_FS_COUNT] = { | 729 | bool inband_interferer_div2[ALLOWABLE_FS_COUNT]; |
732 | FALSE, FALSE, FALSE, FALSE, FALSE, | 730 | bool inband_interferer_div4[ALLOWABLE_FS_COUNT]; |
733 | FALSE, FALSE, FALSE, FALSE, FALSE | ||
734 | }; | ||
735 | unsigned int inband_interferer_div4[ALLOWABLE_FS_COUNT] = { | ||
736 | FALSE, FALSE, FALSE, FALSE, FALSE, | ||
737 | FALSE, FALSE, FALSE, FALSE, FALSE | ||
738 | }; | ||
739 | |||
740 | int status; | 731 | int status; |
741 | 732 | ||
742 | /* allowable sample rates for ADC in MHz */ | 733 | /* allowable sample rates for ADC in MHz */ |
@@ -762,7 +753,7 @@ static int si21xx_set_frontend(struct dvb_frontend *fe, | |||
762 | } | 753 | } |
763 | 754 | ||
764 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) | 755 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) |
765 | inband_interferer_div2[i] = inband_interferer_div4[i] = FALSE; | 756 | inband_interferer_div2[i] = inband_interferer_div4[i] = false; |
766 | 757 | ||
767 | if_limit_high = -700000; | 758 | if_limit_high = -700000; |
768 | if_limit_low = -100000; | 759 | if_limit_low = -100000; |
@@ -798,7 +789,7 @@ static int si21xx_set_frontend(struct dvb_frontend *fe, | |||
798 | 789 | ||
799 | if (((band_low < x1) && (x1 < band_high)) || | 790 | if (((band_low < x1) && (x1 < band_high)) || |
800 | ((band_low < x2) && (x2 < band_high))) | 791 | ((band_low < x2) && (x2 < band_high))) |
801 | inband_interferer_div4[i] = TRUE; | 792 | inband_interferer_div4[i] = true; |
802 | 793 | ||
803 | } | 794 | } |
804 | 795 | ||
@@ -811,25 +802,28 @@ static int si21xx_set_frontend(struct dvb_frontend *fe, | |||
811 | 802 | ||
812 | if (((band_low < x1) && (x1 < band_high)) || | 803 | if (((band_low < x1) && (x1 < band_high)) || |
813 | ((band_low < x2) && (x2 < band_high))) | 804 | ((band_low < x2) && (x2 < band_high))) |
814 | inband_interferer_div2[i] = TRUE; | 805 | inband_interferer_div2[i] = true; |
815 | } | 806 | } |
816 | 807 | ||
817 | inband_interferer_ind = TRUE; | 808 | inband_interferer_ind = true; |
818 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) | 809 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) { |
819 | inband_interferer_ind &= inband_interferer_div2[i] | | 810 | if (inband_interferer_div2[i] || inband_interferer_div4[i]) { |
820 | inband_interferer_div4[i]; | 811 | inband_interferer_ind = false; |
812 | break; | ||
813 | } | ||
814 | } | ||
821 | 815 | ||
822 | if (inband_interferer_ind) { | 816 | if (inband_interferer_ind) { |
823 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) { | 817 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) { |
824 | if (inband_interferer_div2[i] == FALSE) { | 818 | if (!inband_interferer_div2[i]) { |
825 | sample_rate = (u8) afs[i]; | 819 | sample_rate = (u8) afs[i]; |
826 | break; | 820 | break; |
827 | } | 821 | } |
828 | } | 822 | } |
829 | } else { | 823 | } else { |
830 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) { | 824 | for (i = 0; i < ALLOWABLE_FS_COUNT; ++i) { |
831 | if ((inband_interferer_div2[i] | | 825 | if ((inband_interferer_div2[i] || |
832 | inband_interferer_div4[i]) == FALSE) { | 826 | !inband_interferer_div4[i])) { |
833 | sample_rate = (u8) afs[i]; | 827 | sample_rate = (u8) afs[i]; |
834 | break; | 828 | break; |
835 | } | 829 | } |