diff options
Diffstat (limited to 'roms/u-boot/lib/tables_csum.c')
-rw-r--r-- | roms/u-boot/lib/tables_csum.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/roms/u-boot/lib/tables_csum.c b/roms/u-boot/lib/tables_csum.c new file mode 100644 index 000000000..e2630d57d --- /dev/null +++ b/roms/u-boot/lib/tables_csum.c @@ -0,0 +1,19 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> + */ + +#include <common.h> +#include <linux/ctype.h> + +u8 table_compute_checksum(void *v, int len) +{ + u8 *bytes = v; + u8 checksum = 0; + int i; + + for (i = 0; i < len; i++) + checksum -= bytes[i]; + + return checksum; +} |