summaryrefslogtreecommitdiffstats
path: root/drivers/isdn
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2015-09-21 09:33:49 -0400
committerDavid S. Miller <davem@davemloft.net>2015-09-22 19:14:31 -0400
commit8f89642fa10bb6ec02feaa8e3d1d62df671d0207 (patch)
tree6a2959940201d4dea2e94a29e4b7f7a4d1824cc0 /drivers/isdn
parent99cb99aa055a72d3880d8a95a71034c4d64bcf9a (diff)
isdn: hisax: fix frame calculation
Difference of unsigned values is also unsigned so it does not make sense to check its sign. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/isdn')
-rw-r--r--drivers/isdn/hisax/hfc4s8s_l1.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index 0e5d673871c0..9600cd771f1a 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -646,14 +646,14 @@ rx_d_frame(struct hfc4s8s_l1 *l1p, int ech)
646 646
647 f1 = Read_hfc8_stable(l1p->hw, A_F1); 647 f1 = Read_hfc8_stable(l1p->hw, A_F1);
648 f2 = Read_hfc8(l1p->hw, A_F2); 648 f2 = Read_hfc8(l1p->hw, A_F2);
649 df = f1 - f2;
650 if ((f1 - f2) < 0)
651 df = f1 - f2 + MAX_F_CNT + 1;
652 649
650 if (f1 < f2)
651 df = MAX_F_CNT + 1 + f1 - f2;
652 else
653 df = f1 - f2;
653 654
654 if (!df) { 655 if (!df)
655 return; /* no complete frame in fifo */ 656 return; /* no complete frame in fifo */
656 }
657 657
658 z1 = Read_hfc16_stable(l1p->hw, A_Z1); 658 z1 = Read_hfc16_stable(l1p->hw, A_Z1);
659 z2 = Read_hfc16(l1p->hw, A_Z2); 659 z2 = Read_hfc16(l1p->hw, A_Z2);