mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-09 01:56:39 +07:00
Input: walkera0701 - fix abs() calculations on 64 bit values
abs() function can not be used with 64 bit values, so let's switch to abs64(). From include/linux/kernel.h: /* * abs() handles unsigned and signed longs, ints, shorts and chars. * For all input types abs() returns a signed long. * abs() should not be used for 64-bit types (s64, u64, long long) * - use abs64() for those. */ Reported-by: Joe Perches <joe@perches.com> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
parent
86a39bffc4
commit
46b018fa95
@ -150,7 +150,7 @@ static void walkera0701_irq_handler(void *handler_data)
|
|||||||
if (w->counter == 24) { /* full frame */
|
if (w->counter == 24) { /* full frame */
|
||||||
walkera0701_parse_frame(w);
|
walkera0701_parse_frame(w);
|
||||||
w->counter = NO_SYNC;
|
w->counter = NO_SYNC;
|
||||||
if (abs(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
|
if (abs64(pulse_time - SYNC_PULSE) < RESERVE) /* new frame sync */
|
||||||
w->counter = 0;
|
w->counter = 0;
|
||||||
} else {
|
} else {
|
||||||
if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE)
|
if ((pulse_time > (ANALOG_MIN_PULSE - RESERVE)
|
||||||
@ -161,7 +161,7 @@ static void walkera0701_irq_handler(void *handler_data)
|
|||||||
} else
|
} else
|
||||||
w->counter = NO_SYNC;
|
w->counter = NO_SYNC;
|
||||||
}
|
}
|
||||||
} else if (abs(pulse_time - SYNC_PULSE - BIN0_PULSE) <
|
} else if (abs64(pulse_time - SYNC_PULSE - BIN0_PULSE) <
|
||||||
RESERVE + BIN1_PULSE - BIN0_PULSE) /* frame sync .. */
|
RESERVE + BIN1_PULSE - BIN0_PULSE) /* frame sync .. */
|
||||||
w->counter = 0;
|
w->counter = 0;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user