* [PATCH] usb: fhci: use list_first_entry() instead of list_entry()
@ 2020-02-23 14:35 qiwuchen55
2020-02-23 17:53 ` kbuild test robot
0 siblings, 1 reply; 2+ messages in thread
From: qiwuchen55 @ 2020-02-23 14:35 UTC (permalink / raw)
To: gregkh; +Cc: linux-usb, chenqiwu
From: chenqiwu <chenqiwu@xiaomi.com>
To make the intention clearer, use list_first_entry() instead of
list_entry().
Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
---
drivers/usb/host/fhci-mem.c | 8 ++++----
drivers/usb/host/fhci-q.c | 24 ++++++++++++------------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/usb/host/fhci-mem.c b/drivers/usb/host/fhci-mem.c
index 658aedc..058cf7b 100644
--- a/drivers/usb/host/fhci-mem.c
+++ b/drivers/usb/host/fhci-mem.c
@@ -39,8 +39,8 @@ static struct td *get_empty_td(struct fhci_hcd *fhci)
struct td *td;
if (!list_empty(&fhci->empty_tds)) {
- td = list_entry(fhci->empty_tds.next, struct td, node);
- list_del(fhci->empty_tds.next);
+ td = list_fisrt_entry(fhci->empty_tds, struct td, node);
+ list_del(td->node);
} else {
td = kmalloc(sizeof(*td), GFP_ATOMIC);
if (!td)
@@ -63,8 +63,8 @@ struct ed *fhci_get_empty_ed(struct fhci_hcd *fhci)
struct ed *ed;
if (!list_empty(&fhci->empty_eds)) {
- ed = list_entry(fhci->empty_eds.next, struct ed, node);
- list_del(fhci->empty_eds.next);
+ ed = list_first_entry(fhci->empty_eds, struct ed, node);
+ list_del(ed->node);
} else {
ed = kmalloc(sizeof(*ed), GFP_ATOMIC);
if (!ed)
diff --git a/drivers/usb/host/fhci-q.c b/drivers/usb/host/fhci-q.c
index 669c2405..3673731 100644
--- a/drivers/usb/host/fhci-q.c
+++ b/drivers/usb/host/fhci-q.c
@@ -72,7 +72,7 @@ static struct td *peek_td_from_ed(struct ed *ed)
struct td *td;
if (!list_empty(&ed->td_list))
- td = list_entry(ed->td_list.next, struct td, node);
+ td = list_first_entry(ed->td_list, struct td, node);
else
td = NULL;
@@ -84,8 +84,8 @@ struct td *fhci_remove_td_from_frame(struct fhci_time_frame *frame)
struct td *td;
if (!list_empty(&frame->tds_list)) {
- td = list_entry(frame->tds_list.next, struct td, frame_lh);
- list_del_init(frame->tds_list.next);
+ td = list_first_entry(frame->tds_list, struct td, frame_lh);
+ list_del_init(td->frame_lh);
} else
td = NULL;
@@ -97,7 +97,7 @@ struct td *fhci_peek_td_from_frame(struct fhci_time_frame *frame)
struct td *td;
if (!list_empty(&frame->tds_list))
- td = list_entry(frame->tds_list.next, struct td, frame_lh);
+ td = list_first_entry(frame->tds_list, struct td, frame_lh);
else
td = NULL;
@@ -109,13 +109,13 @@ struct td *fhci_remove_td_from_ed(struct ed *ed)
struct td *td;
if (!list_empty(&ed->td_list)) {
- td = list_entry(ed->td_list.next, struct td, node);
- list_del_init(ed->td_list.next);
+ td = list_first_entry(ed->td_list, struct td, node);
+ list_del_init(td->node);
/* if this TD was the ED's head, find next TD */
if (!list_empty(&ed->td_list))
- ed->td_head = list_entry(ed->td_list.next, struct td,
- node);
+ ed->td_head = list_first_entry(ed->td_list, struct td,
+ node);
else
ed->td_head = NULL;
} else
@@ -129,8 +129,8 @@ struct td *fhci_remove_td_from_done_list(struct fhci_controller_list *p_list)
struct td *td;
if (!list_empty(&p_list->done_list)) {
- td = list_entry(p_list->done_list.next, struct td, node);
- list_del_init(p_list->done_list.next);
+ td = list_first_entry(p_list->done_list, struct td, node);
+ list_del_init(td->node);
} else
td = NULL;
@@ -146,7 +146,7 @@ void fhci_move_td_from_ed_to_done_list(struct fhci_usb *usb, struct ed *ed)
/* If this TD was the ED's head,find next TD */
if (!list_empty(&ed->td_list))
- ed->td_head = list_entry(ed->td_list.next, struct td, node);
+ ed->td_head = list_first_entry(ed->td_list, struct td, node);
else {
ed->td_head = NULL;
ed->state = FHCI_ED_SKIP;
@@ -171,7 +171,7 @@ static void free_urb_priv(struct fhci_hcd *fhci, struct urb *urb)
/* if this TD was the ED's head,find the next TD */
if (!list_empty(&ed->td_list))
- ed->td_head = list_entry(ed->td_list.next, struct td, node);
+ ed->td_head = list_first_entry(ed->td_list, struct td, node);
else
ed->td_head = NULL;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] usb: fhci: use list_first_entry() instead of list_entry()
2020-02-23 14:35 [PATCH] usb: fhci: use list_first_entry() instead of list_entry() qiwuchen55
@ 2020-02-23 17:53 ` kbuild test robot
0 siblings, 0 replies; 2+ messages in thread
From: kbuild test robot @ 2020-02-23 17:53 UTC (permalink / raw)
To: qiwuchen55; +Cc: kbuild-all, gregkh, linux-usb, chenqiwu
[-- Attachment #1: Type: text/plain, Size: 27506 bytes --]
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on usb/usb-testing]
[also build test ERROR on balbi-usb/next peter.chen-usb/ci-for-usb-next v5.6-rc2 next-20200221]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/qiwuchen55-gmail-com/usb-fhci-use-list_first_entry-instead-of-list_entry/20200223-232202
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
config: powerpc-allyesconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.5.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=powerpc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All error/warnings (new ones prefixed by >>):
In file included from drivers/usb/host/fhci-q.c:14:0:
drivers/usb/host/fhci-q.c: In function 'peek_td_from_ed':
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
>> drivers/usb/host/fhci-q.c:75:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
>> drivers/usb/host/fhci-q.c:75:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
!__same_type(*(ptr), void), \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
>> drivers/usb/host/fhci-q.c:75:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
In file included from drivers/usb/host/fhci-q.c:14:0:
drivers/usb/host/fhci-q.c: In function 'fhci_remove_td_from_frame':
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:87:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(frame->tds_list, struct td, frame_lh);
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:87:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(frame->tds_list, struct td, frame_lh);
^~~~~~~~~~~~~~~~
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
!__same_type(*(ptr), void), \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:87:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(frame->tds_list, struct td, frame_lh);
^~~~~~~~~~~~~~~~
>> drivers/usb/host/fhci-q.c:88:17: error: incompatible type for argument 1 of 'list_del_init'
list_del_init(td->frame_lh);
^~
In file included from include/linux/preempt.h:11:0,
from include/linux/spinlock.h:51,
from drivers/usb/host/fhci-q.c:16:
include/linux/list.h:202:20: note: expected 'struct list_head *' but argument is of type 'struct list_head'
static inline void list_del_init(struct list_head *entry)
^~~~~~~~~~~~~
In file included from drivers/usb/host/fhci-q.c:14:0:
drivers/usb/host/fhci-q.c: In function 'fhci_peek_td_from_frame':
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:100:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(frame->tds_list, struct td, frame_lh);
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:100:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(frame->tds_list, struct td, frame_lh);
^~~~~~~~~~~~~~~~
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
!__same_type(*(ptr), void), \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:100:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(frame->tds_list, struct td, frame_lh);
^~~~~~~~~~~~~~~~
In file included from drivers/usb/host/fhci-q.c:14:0:
drivers/usb/host/fhci-q.c: In function 'fhci_remove_td_from_ed':
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:112:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:112:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
!__same_type(*(ptr), void), \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:112:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
drivers/usb/host/fhci-q.c:113:17: error: incompatible type for argument 1 of 'list_del_init'
list_del_init(td->node);
^~
In file included from include/linux/preempt.h:11:0,
from include/linux/spinlock.h:51,
from drivers/usb/host/fhci-q.c:16:
include/linux/list.h:202:20: note: expected 'struct list_head *' but argument is of type 'struct list_head'
static inline void list_del_init(struct list_head *entry)
^~~~~~~~~~~~~
In file included from drivers/usb/host/fhci-q.c:14:0:
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:117:18: note: in expansion of macro 'list_first_entry'
ed->td_head = list_first_entry(ed->td_list, struct td,
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:117:18: note: in expansion of macro 'list_first_entry'
ed->td_head = list_first_entry(ed->td_list, struct td,
^~~~~~~~~~~~~~~~
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
!__same_type(*(ptr), void), \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:117:18: note: in expansion of macro 'list_first_entry'
ed->td_head = list_first_entry(ed->td_list, struct td,
^~~~~~~~~~~~~~~~
In file included from drivers/usb/host/fhci-q.c:14:0:
drivers/usb/host/fhci-q.c: In function 'fhci_remove_td_from_done_list':
>> include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:132:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(p_list->done_list, struct td, node);
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:987:20: note: in expansion of macro '__same_type'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:132:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(p_list->done_list, struct td, node);
^~~~~~~~~~~~~~~~
include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
^~~~~~~~~~~~~~~~~~~
include/linux/build_bug.h:39:37: note: in expansion of macro 'compiletime_assert'
#define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
^~~~~~~~~~~~~~~~~~
include/linux/kernel.h:987:2: note: in expansion of macro 'BUILD_BUG_ON_MSG'
BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) && \
^~~~~~~~~~~~~~~~
include/linux/kernel.h:988:6: note: in expansion of macro '__same_type'
!__same_type(*(ptr), void), \
^~~~~~~~~~~
include/linux/list.h:493:2: note: in expansion of macro 'container_of'
container_of(ptr, type, member)
^~~~~~~~~~~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:132:8: note: in expansion of macro 'list_first_entry'
td = list_first_entry(p_list->done_list, struct td, node);
^~~~~~~~~~~~~~~~
drivers/usb/host/fhci-q.c:133:17: error: incompatible type for argument 1 of 'list_del_init'
list_del_init(td->node);
^~
In file included from include/linux/preempt.h:11:0,
from include/linux/spinlock.h:51,
from drivers/usb/host/fhci-q.c:16:
include/linux/list.h:202:20: note: expected 'struct list_head *' but argument is of type 'struct list_head'
static inline void list_del_init(struct list_head *entry)
^~~~~~~~~~~~~
In file included from drivers/usb/host/fhci-q.c:14:0:
drivers/usb/host/fhci-q.c: In function 'fhci_move_td_from_ed_to_done_list':
include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/kernel.h:986:26: note: in definition of macro 'container_of'
void *__mptr = (void *)(ptr); \
^~~
include/linux/list.h:504:2: note: in expansion of macro 'list_entry'
list_entry((ptr)->next, type, member)
^~~~~~~~~~
drivers/usb/host/fhci-q.c:149:17: note: in expansion of macro 'list_first_entry'
ed->td_head = list_first_entry(ed->td_list, struct td, node);
^~~~~~~~~~~~~~~~
In file included from include/linux/kernel.h:11:0,
from drivers/usb/host/fhci-q.c:14:
include/linux/list.h:504:18: error: invalid type argument of '->' (have 'struct list_head')
list_entry((ptr)->next, type, member)
^
include/linux/compiler.h:330:9: note: in definition of macro '__compiletime_assert'
if (!(condition)) \
^~~~~~~~~
include/linux/compiler.h:350:2: note: in expansion of macro '_compiletime_assert'
_compiletime_assert(condition, msg, __compiletime_assert_, __LINE__)
..
vim +/list_del_init +88 drivers/usb/host/fhci-q.c
69
70 static struct td *peek_td_from_ed(struct ed *ed)
71 {
72 struct td *td;
73
74 if (!list_empty(&ed->td_list))
> 75 td = list_first_entry(ed->td_list, struct td, node);
76 else
77 td = NULL;
78
79 return td;
80 }
81
82 struct td *fhci_remove_td_from_frame(struct fhci_time_frame *frame)
83 {
84 struct td *td;
85
86 if (!list_empty(&frame->tds_list)) {
87 td = list_first_entry(frame->tds_list, struct td, frame_lh);
> 88 list_del_init(td->frame_lh);
89 } else
90 td = NULL;
91
92 return td;
93 }
94
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 64816 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-02-23 17:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-23 14:35 [PATCH] usb: fhci: use list_first_entry() instead of list_entry() qiwuchen55
2020-02-23 17:53 ` kbuild test robot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox