Home
last modified time | relevance | path

Searched refs:checked_add (Results 1 – 12 of 12) sorted by relevance

/linux/rust/kernel/
H A Dptr.rs224 .and_then(|align| aligned_down.checked_add(align))
291 match value.checked_add(align.as_usize() - 1) {
H A Duaccess.rs535 if offset.checked_add(count).ok_or(EOVERFLOW)? > len { in write_dma()
H A Dmaple_tree.rs59 Bound::Excluded(start) => start.checked_add(1)?, in to_maple_range()
H A Dio.rs182 if let Some(end) = offset.checked_add(size_of::<U>()) { in offset_valid()
/linux/drivers/android/binder/
H A Dallocation.rs83 let overflow_fail = offset.checked_add(size).is_none(); in size_check()
343 if offset.checked_add(size_of::<T>()).ok_or(EINVAL)? > self.limit { in read()
350 if offset.checked_add(size_of::<T>()).ok_or(EINVAL)? > self.limit { in write()
362 if offset.checked_add(size).ok_or(EINVAL)? > self.limit { in copy_into()
H A Dthread.rs180 let new_min_offset = parent_offset.checked_add(length).ok_or(EINVAL)?; in validate_parent_fixup()
189 let target_offset = sg_entry.offset.checked_add(parent_offset).ok_or(EINVAL)?; in validate_parent_fixup()
216 let new_offset = self.offset.checked_add(size).ok_or(EINVAL)?; in claim_next()
849 .checked_add(parent_offset) in translate_object()
898 let offset_end = sg_entry.offset.checked_add(sg_entry.length).ok_or(EINVAL)?; in apply_sg()
913 let target_offset_end = fixup_offset.checked_add(fixup_len).ok_or(EINVAL)?; in apply_sg()
1000 .checked_add(offsets_size) in copy_transaction_data()
1001 .and_then(|sum| sum.checked_add(buffers_size)) in copy_transaction_data()
1002 .and_then(|sum| sum.checked_add(aligned_secctx_size)) in copy_transaction_data()
/linux/rust/proc-macro2/
H A Dfallback.rs1150 self.span.lo.checked_add(start)? in subspan()
1154 self.span.lo.checked_add(start)?.checked_add(1)? in subspan()
1161 self.span.lo.checked_add(end)?.checked_add(1)? in subspan()
1165 self.span.lo.checked_add(end)? in subspan()
/linux/rust/zerocopy/src/
H A Dlayout.rs401 let offset = match preceding_size.checked_add(padding) { in extend()
421 let size = match offset.checked_add(field_size) { in extend()
443 let offset = match offset.checked_add(trailing_offset) { in extend()
500 let size = match unpadded_size.checked_add(padding) { in pad_to_align()
642 addr.checked_add(bytes_len).is_some(), in validate_cast_and_convert_metadata()
2032 let Some(unpadded_size) = size_info.offset.checked_add(trailing_slice_size) else { in prove_requires_dynamic_padding()
H A Dbyteorder.rs1069 fn checked_add(self, rhs: Self) -> Option<Self>; in checked_add() method
1208 fn checked_add(self, rhs: Self) -> Option<Self> { self.checked_add(rhs) }
1218 fn checked_add(self, rhs: Self) -> Option<Self> { Some(self + rhs) }
1540 test!(@binary Add, add[checked_add], AddAssign, add_assign, call_for_all_types); in test_ops_impls()
H A Dlib.rs1009 let without_padding = offset.checked_add(slice_len)?; in size_for_metadata()
1010 without_padding.checked_add(util::padding_needed_for(without_padding, layout.align)) in size_for_metadata()
/linux/rust/zerocopy/src/util/
H A Dmod.rs233 m.checked_add(align.get()).map(|next_mul| next_mul > n).unwrap_or(true)
763 match self.checked_add(rhs) { in unchecked_add()
/linux/rust/kernel/alloc/
H A Dkvec.rs663 let new_cap = core::cmp::max(cap * 2, len.checked_add(additional).ok_or(AllocError)?); in reserve()