summaryrefslogtreecommitdiffstats
path: root/net/bluetooth/cmtp/capi.c
diff options
context:
space:
mode:
authorGeliang Tang <geliangtang@163.com>2015-12-18 16:33:25 +0100
committerMarcel Holtmann <marcel@holtmann.org>2015-12-20 08:11:10 +0100
commit7eb7404f7ee4bf59cb034897ab678aba2755c5e0 (patch)
tree8a8d4ed999773f5b208bb0ca0771971e900fc5e9 /net/bluetooth/cmtp/capi.c
parenttcp: diag: add support for request sockets to tcp_abort() (diff)
downloadlinux-7eb7404f7ee4bf59cb034897ab678aba2755c5e0.tar.xz
linux-7eb7404f7ee4bf59cb034897ab678aba2755c5e0.zip
Bluetooth: use list_for_each_entry*
Use list_for_each_entry*() instead of list_for_each*() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@163.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/cmtp/capi.c')
-rw-r--r--net/bluetooth/cmtp/capi.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/net/bluetooth/cmtp/capi.c b/net/bluetooth/cmtp/capi.c
index 9a50338772f3..46ac686c8911 100644
--- a/net/bluetooth/cmtp/capi.c
+++ b/net/bluetooth/cmtp/capi.c
@@ -100,10 +100,8 @@ static void cmtp_application_del(struct cmtp_session *session, struct cmtp_appli
static struct cmtp_application *cmtp_application_get(struct cmtp_session *session, int pattern, __u16 value)
{
struct cmtp_application *app;
- struct list_head *p;
- list_for_each(p, &session->applications) {
- app = list_entry(p, struct cmtp_application, list);
+ list_for_each_entry(app, &session->applications, list) {
switch (pattern) {
case CMTP_MSGNUM:
if (app->msgnum == value)
@@ -511,14 +509,12 @@ static int cmtp_proc_show(struct seq_file *m, void *v)
struct capi_ctr *ctrl = m->private;
struct cmtp_session *session = ctrl->driverdata;
struct cmtp_application *app;
- struct list_head *p;
seq_printf(m, "%s\n\n", cmtp_procinfo(ctrl));
seq_printf(m, "addr %s\n", session->name);
seq_printf(m, "ctrl %d\n", session->num);
- list_for_each(p, &session->applications) {
- app = list_entry(p, struct cmtp_application, list);
+ list_for_each_entry(app, &session->applications, list) {
seq_printf(m, "appl %d -> %d\n", app->appl, app->mapping);
}