Skip to content

Commit 01826c7

Browse files
committed
The 64-bit values must not be demoted in size or the shift by max 48 will improperly clear the value entirely.
The abs() function must be promoted in size and use labs().
1 parent d269643 commit 01826c7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/hal/drivers/mesa-hostmot2/sserial.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1549,7 +1549,7 @@ int hm2_sserial_register_tram(hostmot2_t *hm2, hm2_sserial_remote_t *chan){
15491549
case 64:
15501550
shift = 0;
15511551
}
1552-
if (abs(((int)(p->s64_param) - (int)(p->s64_written)) >> shift) > 2) break;
1552+
if (labs((p->s64_param - p->s64_written) >> shift) > 2) break;
15531553
*inst->state2 = 2; // increment indices
15541554
return *inst->state2;
15551555
default:

0 commit comments

Comments
 (0)