Lines Matching +full:- +full:d2

1 // SPDX-License-Identifier: GPL-2.0-or-later
23 { D4, D2, I2, N0 },
24 { D4, I2, D2, N0 },
27 { D2, I2, D4, N0 },
28 { D2, I2, D2, I2 },
29 { D2, I2, I2, D2 },
30 { D2, I2, I2, I2 },
31 { D2, I2, I4, N0 },
32 { I2, D2, D4, N0 },
34 { I2, D2, I2, D2 },
35 { I2, D2, I2, I2 },
36 { I2, D2, I4, N0 },
38 { I2, I2, D2, I2 },
39 { I2, I2, I2, D2 },
43 { I4, D2, I2, N0 },
44 { I4, I2, D2, N0 },
74 return -EINVAL; in __split_next_bits()
77 ret = next_bits(p, &tmp, n - s); in __split_next_bits()
89 u8 *in = p->in, b = p->bit, bits = b + n; in next_bits()
93 return -EINVAL; in next_bits()
101 else if (p->ilen < 8 && bits > 32 && bits <= 56) in next_bits()
103 else if (p->ilen < 4 && bits > 16 && bits <= 24) in next_bits()
106 if (DIV_ROUND_UP(bits, 8) > p->ilen) in next_bits()
107 return -EOVERFLOW; in next_bits()
110 *d = *in >> (8 - bits); in next_bits()
112 *d = be16_to_cpu(get_unaligned((__be16 *)in)) >> (16 - bits); in next_bits()
114 *d = be32_to_cpu(get_unaligned((__be32 *)in)) >> (32 - bits); in next_bits()
116 *d = be64_to_cpu(get_unaligned((__be64 *)in)) >> (64 - bits); in next_bits()
118 *d &= GENMASK_ULL(n - 1, 0); in next_bits()
120 p->bit += n; in next_bits()
122 if (p->bit > 7) { in next_bits()
123 p->in += p->bit / 8; in next_bits()
124 p->ilen -= p->bit / 8; in next_bits()
125 p->bit %= 8; in next_bits()
136 if (n > p->olen) in do_data()
137 return -ENOSPC; in do_data()
145 put_unaligned(cpu_to_be16((u16)v), (__be16 *)p->out); in do_data()
148 put_unaligned(cpu_to_be32((u32)v), (__be32 *)p->out); in do_data()
151 put_unaligned(cpu_to_be64((u64)v), (__be64 *)p->out); in do_data()
154 return -EINVAL; in do_data()
157 p->out += n; in do_data()
158 p->olen -= n; in do_data()
165 u64 index, offset, total = round_down(p->out - p->ostart, 8); in __do_index()
179 u64 pos = total - section; in __do_index()
185 section -= fsize; in __do_index()
193 return -EINVAL; in __do_index()
203 (unsigned long)beN_to_cpu(&p->ostart[offset], size)); in __do_index()
205 memcpy(p->out, &p->ostart[offset], size); in __do_index()
206 p->out += size; in __do_index()
207 p->olen -= size; in __do_index()
222 return -EINVAL; in do_index()
231 return -EINVAL; in do_op()
249 return -EINVAL; in do_op()
265 * Decompress the 842-compressed buffer of length @ilen at @in
268 * The compressed buffer must be only a single 842-compressed buffer,
310 return -EINVAL; in sw842_decompress()
316 return -ENOSPC; in sw842_decompress()
318 while (rep-- > 0) { in sw842_decompress()
319 memcpy(p.out, p.out - 8, 8); in sw842_decompress()
321 p.olen -= 8; in sw842_decompress()
330 return -ENOSPC; in sw842_decompress()
334 p.olen -= 8; in sw842_decompress()
346 return -EINVAL; in sw842_decompress()
348 while (bytes-- > 0) { in sw842_decompress()
354 p.olen--; in sw842_decompress()
385 if (crc != (u64)crc32_be(0, out, total - p.olen)) { in sw842_decompress()
387 return -EINVAL; in sw842_decompress()
390 if (unlikely((total - p.olen) > UINT_MAX)) in sw842_decompress()
391 return -ENOSPC; in sw842_decompress()
393 *olen = total - p.olen; in sw842_decompress()