| /linux/rust/kernel/num/ |
| H A D | bounded.rs | 39 fn fits_within<T: Integer>(value: T, num_bits: u32) -> bool { in fits_within() argument 40 fits_within!(value, T, num_bits) in fits_within() 230 pub struct Bounded<T: Integer, const N: u32>(T); 276 impl<T, const N: u32> Bounded<T, N> 278 T: Integer, 287 const fn __new(value: T) -> Self { in __new() 293 assert!(N <= T::BITS); in __new() 329 pub fn try_new(value: T) -> Option<Self> { in try_new() 367 pub fn from_expr(expr: T) -> Self { in from_expr() 387 pub fn get(self) -> T { in get() argument [all …]
|
| /linux/tools/debugging/ |
| H A D | kernel-chktaint | 48 T=$taint 55 if [ `expr $T % 2` -eq 0 ]; then 62 T=`expr $T / 2` 63 if [ `expr $T % 2` -eq 0 ]; then 70 T=`expr $T / 2` 71 if [ `expr $T % 2` -eq 0 ]; then 78 T=`expr $T / [all...] |
| /linux/drivers/net/wireguard/selftest/ |
| H A D | counter.c | 24 #define T(n, v) do { \ in wg_packet_counter_selftest() macro 34 /* 1 */ T(0, true); in wg_packet_counter_selftest() 35 /* 2 */ T(1, true); in wg_packet_counter_selftest() 36 /* 3 */ T(1, false); in wg_packet_counter_selftest() 37 /* 4 */ T(9, true); in wg_packet_counter_selftest() 38 /* 5 */ T(8, true); in wg_packet_counter_selftest() 39 /* 6 */ T(7, true); in wg_packet_counter_selftest() 40 /* 7 */ T(7, false); in wg_packet_counter_selftest() 41 /* 8 */ T(T_LIM, true); in wg_packet_counter_selftest() 42 /* 9 */ T(T_LIM - 1, true); in wg_packet_counter_selftest() [all …]
|
| /linux/rust/kernel/alloc/ |
| H A D | kbox.rs | 81 pub struct Box<#[cfg_attr(CONFIG_RUSTC_HAS_COERCE_POINTEE, pointee)] T: ?Sized, A: Allocator>( 82 NonNull<T>, 89 impl<T, U, A> core::ops::CoerceUnsized<Box<U, A>> for Box<T, A> 91 T: ?Sized + core::marker::Unsize<U>, 100 impl<T, U, A> core::ops::DispatchFromDyn<Box<U, A>> for Box<T, A> 102 T: ?Sized + core::marker::Unsize<U>, 118 pub type KBox<T> = Box<T, super::allocator::Kmalloc>; 130 pub type VBox<T> = Box<T, super::allocator::Vmalloc>; 142 pub type KVBox<T> = Box<T, super::allocator::KVmalloc>; 146 unsafe impl<T, A: Allocator> ZeroableOption for Box<T, A> {} [all …]
|
| H A D | kvec.rs | 104 pub struct Vec<T, A: Allocator> { 105 ptr: NonNull<T>, 110 layout: ArrayLayout<T>, 126 pub type KVec<T> = Vec<T, Kmalloc>; 139 pub type VVec<T> = Vec<T, Vmalloc>; 152 pub type KVVec<T> = Vec<T, KVmalloc>; 155 unsafe impl<T, A> Send for Vec<T, A> 157 T: Send, 163 unsafe impl<T, A> Sync for Vec<T, A> 165 T: Sync, [all …]
|
| /linux/rust/syn/ |
| H A D | punctuated.rs | 49 pub struct Punctuated<T, P> { 50 inner: Vec<(T, P)>, 51 last: Option<Box<T>>, 54 impl<T, P> Punctuated<T, P> { 78 pub fn first(&self) -> Option<&T> { in first() argument 83 pub fn first_mut(&mut self) -> Option<&mut T> { in first_mut() argument 88 pub fn last(&self) -> Option<&T> { in last() argument 93 pub fn last_mut(&mut self) -> Option<&mut T> { in last_mut() argument 98 pub fn get(&self, index: usize) -> Option<&T> { in get() argument 109 pub fn get_mut(&mut self, index: usize) -> Option<&mut T> { in get_mut() argument [all …]
|
| H A D | drops.rs | 10 pub(crate) struct NoDrop<T: ?Sized>(ManuallyDrop<T>); 12 impl<T> NoDrop<T> { 13 pub(crate) fn new(value: T) -> Self in new() 15 T: TrivialDrop, in new() 21 impl<T: ?Sized> Deref for NoDrop<T> { 22 type Target = T; 28 impl<T: ?Sized> DerefMut for NoDrop<T> { 36 impl<T> TrivialDrop for iter::Empty<T> {} 37 impl<T> TrivialDrop for slice::Iter<'_, T> {} 38 impl<T> TrivialDrop for slice::IterMut<'_, T> {} [all …]
|
| /linux/tools/perf/tests/ |
| H A D | kmod-path.c | 44 #define T(path, an, k, c, n) \ macro 53 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); in test__kmod_path__parse() 54 T("/xxxx/xxxx/x-x.ko", false , true, 0 , NULL ); in test__kmod_path__parse() 55 T("/xxxx/xxxx/x-x.ko", true , true, 0 , "[x_x]"); in test__kmod_path__parse() 56 T("/xxxx/xxxx/x-x.ko", false , true, 0 , NULL ); in test__kmod_path__parse() 63 T("/xxxx/xxxx/x.ko.gz", true , true, 1 , "[x]"); in test__kmod_path__parse() 64 T("/xxxx/xxxx/x.ko.gz", false , true, 1 , NULL ); in test__kmod_path__parse() 65 T("/xxxx/xxxx/x.ko.gz", true , true, 1 , "[x]"); in test__kmod_path__parse() 66 T("/xxxx/xxxx/x.ko.gz", false , true, 1 , NULL ); in test__kmod_path__parse() 72 T("/xxxx/xxxx/x.gz", true , false, 1 , "x.gz"); in test__kmod_path__parse() [all …]
|
| /linux/rust/pin-init/src/ |
| H A D | lib.rs | 1057 pub unsafe trait PinInit<T: ?Sized, E = Infallible>: Sized { 1066 unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E>; in __pinned_init() 1086 fn pin_chain<F>(self, f: F) -> ChainPinInit<Self, F, T, E> in pin_chain() argument 1088 F: FnOnce(Pin<&mut T>) -> Result<(), E>, in pin_chain() 1095 pub struct ChainPinInit<I, F, T: ?Sized, E>(I, F, __internal::Invariant<(E, T)>); 1101 unsafe impl<T: ?Sized, E, I, F> PinInit<T, E> for ChainPinInit<I, F, T, E> 1103 I: PinInit<T, E>, 1104 F: FnOnce(Pin<&mut T>) -> Result<(), E>, 1106 unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E> { in __pinned_init() 1156 pub unsafe trait Init<T: ?Sized, E = Infallible>: PinInit<T, E> { [all …]
|
| H A D | __internal.rs | 17 pub(crate) type Invariant<T> = PhantomData<fn(*mut T) -> *mut T>; 23 pub(crate) struct InitClosure<F, T: ?Sized, E>(pub(crate) F, pub(crate) Invariant<(E, T)>); 27 unsafe impl<T: ?Sized, F, E> Init<T, E> for InitClosure<F, T, E> 29 F: FnOnce(*mut T) -> Result<(), E>, 32 unsafe fn __init(self, slot: *mut T) -> Result<(), E> { in __init() 39 unsafe impl<T: ?Sized, F, E> PinInit<T, E> for InitClosure<F, T, E> 41 F: FnOnce(*mut T) -> Result<(), E>, 44 unsafe fn __pinned_init(self, slot: *mut T) -> Result<(), E> { in __pinned_init() 109 pub struct AllData<T: ?Sized>(Invariant<T>); 111 impl<T: ?Sized> Clone for AllData<T> { [all …]
|
| /linux/rust/kernel/sync/ |
| H A D | atomic.rs | 52 pub struct Atomic<T: AtomicType>(AtomicRepr<T::Repr>); 55 unsafe impl<T: AtomicType> Sync for Atomic<T> {} 130 const fn into_repr<T: AtomicType>(v: T) -> T::Repr { in into_repr() 140 const unsafe fn from_repr<T: AtomicType>(r: T::Repr) -> T { in from_repr() argument 145 impl<T: AtomicType> Atomic<T> { 147 pub const fn new(v: T) -> Self { in new() 207 pub unsafe fn from_ptr<'a>(ptr: *mut T) -> &'a Self in from_ptr() 209 T: Sync, in from_ptr() 228 pub const fn as_ptr(&self) -> *mut T { in as_ptr() argument 238 pub fn get_mut(&mut self) -> &mut T { in get_mut() argument [all …]
|
| H A D | lock.rs | 106 pub struct Lock<T: ?Sized, B: Backend> { 119 pub(crate) data: UnsafeCell<T>, 123 unsafe impl<T: ?Sized + Send, B: Backend> Send for Lock<T, B> {} 127 unsafe impl<T: ?Sized + Send, B: Backend> Sync for Lock<T, B> {} 129 impl<T, B: Backend> Lock<T, B> { 132 t: impl PinInit<T>, in new() argument 170 impl<T: ?Sized, B: Backend> Lock<T, B> { 172 pub fn lock(&self) -> Guard<'_, T, B> { in lock() argument 185 pub fn try_lock(&self) -> Option<Guard<'_, T, B>> { in try_lock() argument 198 pub struct Guard<'a, T: ?Sized, B: Backend> { [all …]
|
| /linux/rust/kernel/ |
| H A D | debugfs.rs | 74 fn create_file<'a, T, E: 'a>( in create_file() argument 77 data: impl PinInit<T, E> + 'a, in create_file() argument 78 file_ops: &'static FileOps<T>, in create_file() argument 79 ) -> impl PinInit<File<T>, E> + 'a in create_file() argument 81 T: Sync + 'static, in create_file() 83 let scope = Scope::<T>::new(data, move |data| { in create_file() 144 pub fn read_only_file<'a, T, E: 'a>( in read_only_file() argument 147 data: impl PinInit<T, E> + 'a, in read_only_file() argument 148 ) -> impl PinInit<File<T>, E> + 'a in read_only_file() argument 150 T: Writer + Send + Sync + 'static, in read_only_file() [all …]
|
| H A D | list.rs | 263 pub struct List<T: ?Sized + ListItem<ID>, const ID: u64 = 0> { 265 _ty: PhantomData<ListArc<T, ID>>, 270 unsafe impl<T, const ID: u64> Send for List<T, ID> 272 ListArc<T, ID>: Send, 273 T: ?Sized + ListItem<ID>, 278 unsafe impl<T, const ID: u64> Sync for List<T, ID> 280 ListArc<T, ID>: Sync, 281 T: ?Sized + ListItem<ID>, 420 pub struct ListLinksSelfPtr<T: ?Sized, const ID: u64 = 0> { 427 self_ptr: Opaque<*const T>, [all …]
|
| H A D | types.rs | 220 pub struct ScopeGuard<T, F: FnOnce(T)>(Option<(T, F)>); 222 impl<T, F: FnOnce(T)> ScopeGuard<T, F> { 224 pub fn new_with_data(data: T, cleanup_func: F) -> Self { in new_with_data() argument 230 pub fn dismiss(mut self) -> T { in dismiss() argument 244 impl<T, F: FnOnce(T)> Deref for ScopeGuard<T, F> { 245 type Target = T; 247 fn deref(&self) -> &T { in deref() argument 253 impl<T, F: FnOnce(T)> DerefMut for ScopeGuard<T, F> { 254 fn deref_mut(&mut self) -> &mut T { in deref_mut() argument 260 impl<T, F: FnOnce(T)> Drop for ScopeGuard<T, F> { [all …]
|
| H A D | maple_tree.rs | 29 pub struct MapleTree<T: ForeignOwnable> { 32 _p: PhantomData<T>, 40 pub struct MapleTreeAlloc<T: ForeignOwnable> { 42 tree: MapleTree<T>, 46 impl<T: ForeignOwnable> core::ops::Deref for MapleTreeAlloc<T> { 47 type Target = MapleTree<T>; 50 fn deref(&self) -> &MapleTree<T> { in deref() argument 76 impl<T: ForeignOwnable> MapleTree<T> { 121 pub fn insert(&self, index: usize, value: T, gfp: Flags) -> Result<(), InsertError<T>> { in insert() argument 169 pub fn insert_range<R>(&self, range: R, value: T, gfp: Flags) -> Result<(), InsertError<T>> in insert_range() argument [all …]
|
| H A D | xarray.rs | 56 pub struct XArray<T: ForeignOwnable> { 59 _p: PhantomData<T>, 63 impl<T: ForeignOwnable> PinnedDrop for XArray<T> { 71 drop(unsafe { T::from_foreign(ptr) }) in drop() 87 impl<T: ForeignOwnable> XArray<T> { 122 pub fn try_lock(&self) -> Option<Guard<'_, T>> { in try_lock() argument 135 pub fn lock(&self) -> Guard<'_, T> { in lock() argument 150 pub struct Guard<'a, T: ForeignOwnable> { 151 xa: &'a XArray<T>, 155 impl<T: ForeignOwnable> Drop for Guard<'_, T> { [all …]
|
| /linux/rust/kernel/debugfs/ |
| H A D | file_ops.rs | 22 pub(super) struct FileOps<T> { 27 _phantom: PhantomData<T>, 30 impl<T> FileOps<T> { 51 impl<T: Adapter> FileOps<T> { 52 pub(super) const fn adapt(&self) -> &FileOps<T::Inner> { in adapt() 59 impl<T> Deref for FileOps<T> { 67 struct WriterAdapter<T>(T); 69 impl<'a, T: Writer> fmt::Display for WriterAdapter<&'a T> { 82 unsafe extern "C" fn writer_open<T: Writer + Sync>( in writer_open() 94 unsafe { bindings::single_open(file, Some(writer_act::<T>), data) } in writer_open() [all …]
|
| H A D | traits.rs | 32 impl<T: Writer> Writer for Mutex<T> { 38 impl<T: fmt::Debug> Writer for T { implementation 59 impl<T: AsBytes> BinaryWriter for T { implementation 70 impl<T: BinaryWriter> BinaryWriter for Mutex<T> { 83 impl<T, A> BinaryWriter for Box<T, A> 85 T: BinaryWriter, 98 impl<T, A> BinaryWriter for Pin<Box<T, A>> 100 T: BinaryWriter, 113 impl<T> BinaryWriter for Arc<T> 115 T: BinaryWriter, [all …]
|
| /linux/rust/proc-macro2/ |
| H A D | rcvec.rs | 9 pub(crate) struct RcVec<T> { 10 inner: Rc<Vec<T>>, 13 pub(crate) struct RcVecBuilder<T> { 14 inner: Vec<T>, 17 pub(crate) struct RcVecMut<'a, T> { 18 inner: &'a mut Vec<T>, 22 pub(crate) struct RcVecIntoIter<T> { 23 inner: vec::IntoIter<T>, 26 impl<T> RcVec<T> { 35 pub(crate) fn iter(&self) -> slice::Iter<T> { in iter() argument [all …]
|
| /linux/rust/kernel/list/ |
| H A D | arc.rs | 163 pub struct ListArc<T, const ID: u64 = 0> 165 T: ListArcSafe<ID> + ?Sized, 167 arc: Arc<T>, 170 impl<T: ListArcSafe<ID>, const ID: u64> ListArc<T, ID> { 173 pub fn new(contents: T, flags: Flags) -> Result<Self, AllocError> { in new() argument 183 pub fn pin_init<E>(init: impl PinInit<T, E>, flags: Flags) -> Result<Self, E> in pin_init() argument 194 pub fn init<E>(init: impl Init<T, E>, flags: Flags) -> Result<Self, E> in init() argument 202 impl<T, const ID: u64> From<UniqueArc<T>> for ListArc<T, ID> 204 T: ListArcSafe<ID> + ?Sized, 208 fn from(unique: UniqueArc<T>) -> Self { in from() [all …]
|
| /linux/drivers/comedi/drivers/tests/ |
| H A D | ni_routes_test.c | 310 const struct ni_route_tables *T = &private.routing_tables; in test_ni_route_to_register() local 313 unittest(ni_route_to_register(O(0), O(0), T) < 0, in test_ni_route_to_register() 315 unittest(ni_route_to_register(O(1), O(0), T) == 1, in test_ni_route_to_register() 317 unittest(ni_route_to_register(O(6), O(5), T) == 6, in test_ni_route_to_register() 319 unittest(ni_route_to_register(O(8), O(9), T) == 8, in test_ni_route_to_register() 323 unittest(ni_route_to_register(rgout0_src0, TRIGGER_LINE(0), T) == 0, in test_ni_route_to_register() 325 unittest(ni_route_to_register(rgout0_src0, TRIGGER_LINE(1), T) == 0, in test_ni_route_to_register() 327 unittest(ni_route_to_register(rgout0_src1, TRIGGER_LINE(2), T) == 1, in test_ni_route_to_register() 329 unittest(ni_route_to_register(rgout0_src1, TRIGGER_LINE(3), T) == 1, in test_ni_route_to_register() 332 unittest(ni_route_to_register(brd0_src0, TRIGGER_LINE(4), T) == in test_ni_route_to_register() [all …]
|
| /linux/tools/testing/selftests/rcutorture/bin/ |
| H A D | torture.sh | 264 T="`mktemp -d ${TMPDIR-/tmp}/torture.sh.XXXXXX`" 265 trap 'rm -rf $T' 0 2 267 echo " --- " $scriptname $args | tee -a $T/log 268 echo " --- Results directory: " $ds | tee -a $T/log 276 echo " --- Everything disabled, so explicit --do-normal overridden" | tee -a $T/log 289 echo " --- Zero time for rcutorture, disabling" | tee -a $T/log 301 echo " --- Zero time for locktorture, disabling" | tee -a $T/log 313 echo " --- Zero time for scftorture, disabling" | tee -a $T/log 324 touch $T/failures 325 touch $T/successe [all...] |
| /linux/scripts/ |
| H A D | decodecode | 14 rm -f $T $T.s $T.o $T.oo $T.aa $T.dis 25 T=`mktemp` || die "cannot create temp file" 51 rm $T 215 touch $T.oo 221 echo All code >> $T.oo 222 echo ======== >> $T.oo 224 echo -n " .$type 0x" > $T.s 226 echo $beforemark | sed -e 's/ /,0x/g; s/[<>()]//g' >> $T.s 228 disas $T $pc_sub 230 cat $T.dis >> $T.oo [all …]
|
| /linux/rust/quote/ |
| H A D | runtime.rs | 77 impl<T: Iterator> RepIteratorExt for T {} implementation 96 impl<T: ToTokens + ?Sized> RepToTokensExt for T {} implementation 107 impl<'q, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &T { implementation 108 type Iter = T::Iter; 111 <T as RepAsIteratorExt>::quote_into_iter(*self) in quote_into_iter() 115 impl<'q, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &mut T { implementation 116 type Iter = T::Iter; 119 <T as RepAsIteratorExt>::quote_into_iter(*self) in quote_into_iter() 123 impl<'q, T: 'q> RepAsIteratorExt<'q> for [T] { implementation 124 type Iter = slice::Iter<'q, T>; [all …]
|