From 8744526c56a08e20aeeea848a5873c048f2644c0 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Mon, 4 Jul 2011 14:05:19 +0000 Subject: A number of cases of testing for unsigned int < 0 Signed-off-by: Tzafrir Cohen git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@10021 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- drivers/dahdi/xpp/card_bri.c | 4 ++-- drivers/dahdi/xpp/card_pri.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/dahdi/xpp') diff --git a/drivers/dahdi/xpp/card_bri.c b/drivers/dahdi/xpp/card_bri.c index 518e61f..a6296f0 100644 --- a/drivers/dahdi/xpp/card_bri.c +++ b/drivers/dahdi/xpp/card_bri.c @@ -81,12 +81,12 @@ static const char *xhfc_state_name(bool is_nt, enum xhfc_states state) }; #undef _E if(is_nt) { - if ((state < ST_RESET) || (state > ST_NT_DEACTIVTING)) + if (state > ST_NT_DEACTIVTING) p = "NT ???"; else p = nt_names[state]; } else { - if ((state < ST_RESET) || (state > ST_TE_LOST_FRAMING)) + if (state > ST_TE_LOST_FRAMING) p = "TE ???"; else p = te_names[state]; diff --git a/drivers/dahdi/xpp/card_pri.c b/drivers/dahdi/xpp/card_pri.c index 604163a..ad39f18 100644 --- a/drivers/dahdi/xpp/card_pri.c +++ b/drivers/dahdi/xpp/card_pri.c @@ -1934,7 +1934,7 @@ static int decode_cas_e1(xpd_t *xpd, byte regnum, byte data_low) BUG_ON(!priv->is_cas); BUG_ON(priv->pri_protocol != PRI_PROTO_E1); XPD_DBG(SIGNAL, xpd, "RBS: RX: data_low=0x%02X\n", data_low); - if(pos < 0 || pos >= NUM_CAS_RS_E) { + if(pos >= NUM_CAS_RS_E) { XPD_ERR(xpd, "%s: got bad pos=%d [0-%d]\n", __FUNCTION__, pos, NUM_CAS_RS_E); return -EINVAL; } @@ -1975,7 +1975,7 @@ static int decode_cas_t1(xpd_t *xpd, byte regnum, byte data_low) BUG_ON(!priv->is_cas); BUG_ON(priv->pri_protocol != PRI_PROTO_T1); rsnum = regnum - REG_RS1_E; - if(rsnum < 0 || rsnum >= 12) { + if(rsnum >= 12) { XPD_ERR(xpd, "Bad rsnum=%d\n", rsnum); return 0; } @@ -2321,7 +2321,7 @@ static DEVICE_ATTR_READER(pri_alarms_show, dev, buf) struct PRI_priv_data *priv; unsigned long flags; int len = 0; - const static struct { + static const struct { byte bits; const char *name; } alarm_types[] = { -- cgit v1.2.3