Lines Matching +full:data +full:- +full:shift

1 // SPDX-License-Identifier: GPL-2.0
6 * Copyright (C) 2023-2024 Rivos Inc.
11 #include <linux/kasan-checks.h>
27 sum += (__force unsigned long)saddr->s6_addr32[0]; in csum_ipv6_magic()
28 sum += (__force unsigned long)saddr->s6_addr32[1]; in csum_ipv6_magic()
29 sum += (__force unsigned long)saddr->s6_addr32[2]; in csum_ipv6_magic()
30 sum += (__force unsigned long)saddr->s6_addr32[3]; in csum_ipv6_magic()
32 sum += (__force unsigned long)daddr->s6_addr32[0]; in csum_ipv6_magic()
33 sum += (__force unsigned long)daddr->s6_addr32[1]; in csum_ipv6_magic()
34 sum += (__force unsigned long)daddr->s6_addr32[2]; in csum_ipv6_magic()
35 sum += (__force unsigned long)daddr->s6_addr32[3]; in csum_ipv6_magic()
90 unsigned long data) in do_csum_common() argument
92 unsigned int shift; in do_csum_common() local
96 * Do 32-bit reads on RV32 and 64-bit reads otherwise. This should be in do_csum_common()
97 * faster than doing 32-bit reads on architectures that support larger in do_csum_common()
101 csum += data; in do_csum_common()
102 carry += csum < data; in do_csum_common()
103 data = *(ptr++); in do_csum_common()
107 * Perform alignment (and over-read) bytes on the tail if any bytes in do_csum_common()
110 shift = ((long)ptr - (long)end) * 8; in do_csum_common()
112 data = (data << shift) >> shift; in do_csum_common()
114 data = (data >> shift) << shift; in do_csum_common()
116 csum += data; in do_csum_common()
117 carry += csum < data; in do_csum_common()
126 * If buff is not aligned, will over-read bytes but not use the bytes that it
127 * shouldn't. The same thing will occur on the tail-end of the read.
132 unsigned int offset, shift; in do_csum_with_alignment() local
133 unsigned long csum, data; in do_csum_with_alignment() local
143 ptr = (const unsigned long *)(buff - offset); in do_csum_with_alignment()
146 * Clear the most significant bytes that were over-read if buff was not in do_csum_with_alignment()
149 shift = offset * 8; in do_csum_with_alignment()
150 data = *(ptr++); in do_csum_with_alignment()
152 data = (data >> shift) << shift; in do_csum_with_alignment()
154 data = (data << shift) >> shift; in do_csum_with_alignment()
157 csum = do_csum_common(ptr, end, data); in do_csum_with_alignment()
236 unsigned long csum, data; in do_csum_no_alignment() local
240 data = *(ptr++); in do_csum_no_alignment()
245 csum = do_csum_common(ptr, end, data); in do_csum_no_alignment()
303 * Will do a light-weight address alignment if buff is misaligned, unless