aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2012-10-27 15:14:01 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-10-28 05:38:44 -0400
commit830e4b55b02b8a2638958e4249eba71797940ee5 (patch)
tree06266c34cf84b9a4e5092df3534ff4fdbbdda495
parent5a70972e142b182fb9375b9060a4dd9fad47fadf (diff)
[media] dvb-frontends: get rid of some "always false" warnings
On gcc, enums are generally unsigned, except if a negative value is declared. Due to that, warnings may happen there: drivers/media/dvb-frontends/cx22700.c:142:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/dvb-frontends/cx22700.c:155:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/dvb-frontends/cx24123.c:341:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/dvb-frontends/l64781.c:183:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/dvb-frontends/l64781.c:187:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/dvb-frontends/mt312.c:552:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] drivers/media/dvb-frontends/mt312.c:560:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits] As other compilers might be using signed values, the better is to keep the checks there, casting the value to avoid the warning. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--drivers/media/dvb-frontends/cx22700.c4
-rw-r--r--drivers/media/dvb-frontends/cx24123.c2
-rw-r--r--drivers/media/dvb-frontends/l64781.c4
-rw-r--r--drivers/media/dvb-frontends/mt312.c4
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/dvb-frontends/cx22700.c b/drivers/media/dvb-frontends/cx22700.c
index f2a90f990ce3..3d399d9a6343 100644
--- a/drivers/media/dvb-frontends/cx22700.c
+++ b/drivers/media/dvb-frontends/cx22700.c
@@ -139,7 +139,7 @@ static int cx22700_set_tps(struct cx22700_state *state,
139 if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5) 139 if (p->code_rate_HP == FEC_4_5 || p->code_rate_LP == FEC_4_5)
140 return -EINVAL; 140 return -EINVAL;
141 141
142 if (p->guard_interval < GUARD_INTERVAL_1_32 || 142 if ((int)p->guard_interval < GUARD_INTERVAL_1_32 ||
143 p->guard_interval > GUARD_INTERVAL_1_4) 143 p->guard_interval > GUARD_INTERVAL_1_4)
144 return -EINVAL; 144 return -EINVAL;
145 145
@@ -152,7 +152,7 @@ static int cx22700_set_tps(struct cx22700_state *state,
152 p->modulation != QAM_64) 152 p->modulation != QAM_64)
153 return -EINVAL; 153 return -EINVAL;
154 154
155 if (p->hierarchy < HIERARCHY_NONE || 155 if ((int)p->hierarchy < HIERARCHY_NONE ||
156 p->hierarchy > HIERARCHY_4) 156 p->hierarchy > HIERARCHY_4)
157 return -EINVAL; 157 return -EINVAL;
158 158
diff --git a/drivers/media/dvb-frontends/cx24123.c b/drivers/media/dvb-frontends/cx24123.c
index 7e28b4ee7d4f..68c88ab58e71 100644
--- a/drivers/media/dvb-frontends/cx24123.c
+++ b/drivers/media/dvb-frontends/cx24123.c
@@ -338,7 +338,7 @@ static int cx24123_set_fec(struct cx24123_state *state, fe_code_rate_t fec)
338{ 338{
339 u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07; 339 u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07;
340 340
341 if ((fec < FEC_NONE) || (fec > FEC_AUTO)) 341 if (((int)fec < FEC_NONE) || (fec > FEC_AUTO))
342 fec = FEC_AUTO; 342 fec = FEC_AUTO;
343 343
344 /* Set the soft decision threshold */ 344 /* Set the soft decision threshold */
diff --git a/drivers/media/dvb-frontends/l64781.c b/drivers/media/dvb-frontends/l64781.c
index 36fcf559e361..ddf866c46f8b 100644
--- a/drivers/media/dvb-frontends/l64781.c
+++ b/drivers/media/dvb-frontends/l64781.c
@@ -180,11 +180,11 @@ static int apply_frontend_param(struct dvb_frontend *fe)
180 p->transmission_mode != TRANSMISSION_MODE_8K) 180 p->transmission_mode != TRANSMISSION_MODE_8K)
181 return -EINVAL; 181 return -EINVAL;
182 182
183 if (p->guard_interval < GUARD_INTERVAL_1_32 || 183 if ((int)p->guard_interval < GUARD_INTERVAL_1_32 ||
184 p->guard_interval > GUARD_INTERVAL_1_4) 184 p->guard_interval > GUARD_INTERVAL_1_4)
185 return -EINVAL; 185 return -EINVAL;
186 186
187 if (p->hierarchy < HIERARCHY_NONE || 187 if ((int)p->hierarchy < HIERARCHY_NONE ||
188 p->hierarchy > HIERARCHY_4) 188 p->hierarchy > HIERARCHY_4)
189 return -EINVAL; 189 return -EINVAL;
190 190
diff --git a/drivers/media/dvb-frontends/mt312.c b/drivers/media/dvb-frontends/mt312.c
index e20bf13aa860..ec388c1d6913 100644
--- a/drivers/media/dvb-frontends/mt312.c
+++ b/drivers/media/dvb-frontends/mt312.c
@@ -549,7 +549,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe)
549 || (p->frequency > fe->ops.info.frequency_max)) 549 || (p->frequency > fe->ops.info.frequency_max))
550 return -EINVAL; 550 return -EINVAL;
551 551
552 if ((p->inversion < INVERSION_OFF) 552 if (((int)p->inversion < INVERSION_OFF)
553 || (p->inversion > INVERSION_ON)) 553 || (p->inversion > INVERSION_ON))
554 return -EINVAL; 554 return -EINVAL;
555 555
@@ -557,7 +557,7 @@ static int mt312_set_frontend(struct dvb_frontend *fe)
557 || (p->symbol_rate > fe->ops.info.symbol_rate_max)) 557 || (p->symbol_rate > fe->ops.info.symbol_rate_max))
558 return -EINVAL; 558 return -EINVAL;
559 559
560 if ((p->fec_inner < FEC_NONE) 560 if (((int)p->fec_inner < FEC_NONE)
561 || (p->fec_inner > FEC_AUTO)) 561 || (p->fec_inner > FEC_AUTO))
562 return -EINVAL; 562 return -EINVAL;
563 563