Skip to content

Commit

Permalink
Merge pull request linux-kernel-labs#158 from thsmdt/deferred_work
Browse files Browse the repository at this point in the history
Documentation: teaching: labs: deferred_work: Fix example code
  • Loading branch information
valighita authored Mar 11, 2020
2 parents 975e232 + f909737 commit 8ca93d7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Documentation/teaching/labs/deferred_work.rst
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ Workqueues are used to schedule actions to run in process context. The
base unit with which they work is called work. There are two types of
work:

* :c:type:`structure work_struct` - it schedules a task to run at
* :c:type:`struct work_struct` - it schedules a task to run at
a later time
* :c:type:`struct delayed_work` - it schedules a task to run after at
least a given time interval
Expand Down Expand Up @@ -469,7 +469,7 @@ use :c:func:`container_of`:
void my_work_handler(struct work_struct *work)
{
structure my_device_data * my_data;
struct my_device_data * my_data;
my_data = container_of(work, struct my_device_data, my_work);
// ...
Expand Down Expand Up @@ -534,7 +534,7 @@ And to destroy the workqueue call :c:func:`destroy_workqueue`

.. code-block:: c
void destroy_workqueue(structure workqueque_struct *queue);
void destroy_workqueue(struct workqueue_struct *queue);
The next sequence declares and initializes an additional workqueue,
declares and initializes a work item and adds it to the queue:
Expand Down Expand Up @@ -576,7 +576,7 @@ To create a thread kernel, use :c:func:`kthread_create`:
#include <linux/kthread.h>
structure task_struct *kthread_create(int (*threadfn)(void *data),
struct task_struct *kthread_create(int (*threadfn)(void *data),
void *data, const char namefmt[], ...);
* *threadfn* is a function that will be run by the kernel thread
Expand Down Expand Up @@ -646,7 +646,7 @@ common mistakes:
DECLARE_WAIT_QUEUE_HEAD(wq);
// list events to be processed by kernel thread
structure list_head events_list;
struct list_head events_list;
struct spin_lock events_lock;
Expand Down Expand Up @@ -698,8 +698,8 @@ with:
void send_event(struct event *ev)
{
spin_lock(&events_lock);
list_add(&ev->lh, &list_events);
spin_unlock(events_lock);
list_add(&ev->lh, &events_list);
spin_unlock(&events_lock);
wake_up(&wq);
}
Expand Down

0 comments on commit 8ca93d7

Please sign in to comment.