diff options
author | Tom Rini <trini@konsulko.com> | 2016-10-18 10:20:26 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2016-10-18 10:20:26 -0400 |
commit | bb297ceea8bf6cc0291c556f64f49b89368f10ba (patch) | |
tree | a37b0d2af3d94480f372129e6aac53dba366937f /include | |
parent | 644074671e702e8dc0ef642b353845a40f8053da (diff) | |
parent | f822403f0164be74a5161b65698d0f01f4556234 (diff) |
Merge git://git.denx.de/u-boot-x86
Diffstat (limited to 'include')
-rw-r--r-- | include/tables_csum.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/tables_csum.h b/include/tables_csum.h new file mode 100644 index 0000000000..27d147b164 --- /dev/null +++ b/include/tables_csum.h @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2015, Bin Meng <bmeng.cn@gmail.com> + * + * SPDX-License-Identifier: GPL-2.0+ + */ + +#ifndef _TABLES_CSUM_H_ +#define _TABLES_CSUM_H_ + +static inline 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; +} + +#endif |