]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
media: cx18: Replace custom implementation of list_entry_is_head()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 28 May 2025 11:32:04 +0000 (14:32 +0300)
committerHans Verkuil <hverkuil@xs4all.nl>
Tue, 17 Jun 2025 08:35:15 +0000 (10:35 +0200)
Besides list_entry_is_past_end() is the same as list_entry_is_head(),
it's implemented in the list namespace. Fix both of the issue by replacing
the custom version with list_entry_is_head() calls.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/pci/cx18/cx18-driver.h
drivers/media/pci/cx18/cx18-fileops.c
drivers/media/pci/cx18/cx18-ioctl.c

index af05bde758165e9c08a622c484c1c1808543052a..485ca9747c4c1c4a78c7bb2cd998927b075d44e9 100644 (file)
@@ -271,18 +271,6 @@ struct cx18_options {
 #define CX18_SLICED_TYPE_WSS_625        (5)
 #define CX18_SLICED_TYPE_VPS            (7)
 
-/**
- * list_entry_is_past_end - check if a previous loop cursor is off list end
- * @pos:       the type * previously used as a loop cursor.
- * @head:      the head for your list.
- * @member:    the name of the list_head within the struct.
- *
- * Check if the entry's list_head is the head of the list, thus it's not a
- * real entry but was the loop cursor that walked past the end
- */
-#define list_entry_is_past_end(pos, head, member) \
-       (&pos->member == (head))
-
 struct cx18_vb2_buffer {
        /* Common video buffer sub-system struct */
        struct vb2_v4l2_buffer vb;
index 315577d71d95e7dd69b12f5e6fca493ff3ea1a98..cefa91b37f890c8b27d932b832c05ac158eae216 100644 (file)
@@ -371,7 +371,7 @@ static size_t cx18_copy_mdl_to_user(struct cx18_stream *s,
                mdl->curr_buf = list_first_entry(&mdl->buf_list,
                                                 struct cx18_buffer, list);
 
-       if (list_entry_is_past_end(mdl->curr_buf, &mdl->buf_list, list)) {
+       if (list_entry_is_head(mdl->curr_buf, &mdl->buf_list, list)) {
                /*
                 * For some reason we've exhausted the buffers, but the MDL
                 * object still said some data was unread.
index 1817b9ed042c5dc64fe14dd4bb5250bed492bb14..9a1512b1ccaafd991c0422616a0d7b3e6c7c49cc 100644 (file)
@@ -764,7 +764,7 @@ static int cx18_process_idx_data(struct cx18_stream *s, struct cx18_mdl *mdl,
                mdl->curr_buf = list_first_entry(&mdl->buf_list,
                                                 struct cx18_buffer, list);
 
-       if (list_entry_is_past_end(mdl->curr_buf, &mdl->buf_list, list)) {
+       if (list_entry_is_head(mdl->curr_buf, &mdl->buf_list, list)) {
                /*
                 * For some reason we've exhausted the buffers, but the MDL
                 * object still said some data was unread.