Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f89642f authored by Andrzej Hajda's avatar Andrzej Hajda Committed by David S. Miller
Browse files

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: default avatarAndrzej Hajda <a.hajda@samsung.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 99cb99aa
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -646,14 +646,14 @@ rx_d_frame(struct hfc4s8s_l1 *l1p, int ech)

		f1 = Read_hfc8_stable(l1p->hw, A_F1);
		f2 = Read_hfc8(l1p->hw, A_F2);
		df = f1 - f2;
		if ((f1 - f2) < 0)
			df = f1 - f2 + MAX_F_CNT + 1;

		if (f1 < f2)
			df = MAX_F_CNT + 1 + f1 - f2;
		else
			df = f1 - f2;

		if (!df) {
		if (!df)
			return;	/* no complete frame in fifo */
		}

		z1 = Read_hfc16_stable(l1p->hw, A_Z1);
		z2 = Read_hfc16(l1p->hw, A_Z2);