@@ -119,13 +119,9 @@ macro_rules! init_work_item_adapter {
119
119
///
120
120
/// ```
121
121
/// # use kernel::{spawn_work_item, workqueue};
122
- ///
123
- /// # fn example() -> Result {
124
122
/// spawn_work_item!(workqueue::system(), || pr_info!("Hello from a work item\n"))?;
125
- /// # Ok(())
126
- /// # }
127
123
///
128
- /// # example().unwrap( )
124
+ /// # Ok::<(), Error>(() )
129
125
/// ```
130
126
///
131
127
/// The following example is used to create a work item and enqueue it several times. We note that
@@ -152,7 +148,6 @@ macro_rules! init_work_item_adapter {
152
148
/// }
153
149
/// });
154
150
///
155
- /// # fn example() -> Result {
156
151
/// let e = UniqueArc::try_new(Example {
157
152
/// count: AtomicU32::new(0),
158
153
/// // SAFETY: `work` is initialised below.
@@ -163,10 +158,8 @@ macro_rules! init_work_item_adapter {
163
158
///
164
159
/// // Queue the first time.
165
160
/// workqueue::system().enqueue(e.into());
166
- /// # Ok(())
167
- /// # }
168
161
///
169
- /// # example().unwrap( )
162
+ /// # Ok::<(), Error>(() )
170
163
/// ```
171
164
///
172
165
/// The following example has two different work items in the same struct, which allows it to be
@@ -187,7 +180,6 @@ macro_rules! init_work_item_adapter {
187
180
/// struct SecondAdapter;
188
181
/// kernel::impl_work_adapter!(SecondAdapter, Example, work2, |_| pr_info!("Second work\n"));
189
182
///
190
- /// # fn example() -> Result {
191
183
/// let e = UniqueArc::try_new(Example {
192
184
/// // SAFETY: `work1` is initialised below.
193
185
/// work1: unsafe { Work::new() },
@@ -203,10 +195,8 @@ macro_rules! init_work_item_adapter {
203
195
/// // Enqueue the two different work items.
204
196
/// workqueue::system().enqueue(e.clone());
205
197
/// workqueue::system().enqueue_adapter::<SecondAdapter>(e);
206
- /// # Ok(())
207
- /// # }
208
198
///
209
- /// # example().unwrap( )
199
+ /// # Ok::<(), Error>(() )
210
200
/// ```
211
201
#[ repr( transparent) ]
212
202
pub struct Queue ( Opaque < bindings:: workqueue_struct > ) ;
0 commit comments