fs: dlm: use list_first_entry marco
authorAlexander Aring <aahringo@redhat.com>
Thu, 27 Oct 2022 20:45:17 +0000 (16:45 -0400)
committerDavid Teigland <teigland@redhat.com>
Tue, 8 Nov 2022 18:59:41 +0000 (12:59 -0600)
Instead of using list_entry() this patch moves to using the
list_first_entry() macro.

Signed-off-by: Alexander Aring <aahringo@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/user.c

index c5d27bc..6a5de09 100644 (file)
@@ -857,7 +857,7 @@ static ssize_t device_read(struct file *file, char __user *buf, size_t count,
           without removing lkb_cb_list; so empty lkb_cb_list is always
           consistent with empty lkb_callbacks */
 
-       lkb = list_entry(proc->asts.next, struct dlm_lkb, lkb_cb_list);
+       lkb = list_first_entry(&proc->asts, struct dlm_lkb, lkb_cb_list);
 
        /* rem_lkb_callback sets a new lkb_last_cast */
        old_mode = lkb->lkb_last_cast.mode;