@@ -568,11 +568,11 @@
static uint8_t tda998x_cksum(uint8_t *buf, size_t bytes)
{
- uint8_t sum = 0;
+ int sum = 0;
while (bytes--)
- sum += *buf++;
- return (255 - sum) + 1;
+ sum -= *buf++;
+ return sum;
}
#define HB(x) (x)
and the same may be done in hdmi.c:
@@ -31,14 +31,14 @@
static void hdmi_infoframe_checksum(void *buffer, size_t size)
{
u8 *ptr = buffer;
- u8 csum = 0;
+ int csum = 0;
size_t i;
/* compute checksum */
for (i = 0; i < size; i++)
- csum += ptr[i];
+ csum -= ptr[i];
- ptr[3] = 256 - csum;
+ ptr[3] = csum;
}
/**