Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932826AbbLRPj2 (ORCPT ); Fri, 18 Dec 2015 10:39:28 -0500 Received: from m50-134.163.com ([123.125.50.134]:34565 "EHLO m50-134.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754131AbbLRPeG (ORCPT ); Fri, 18 Dec 2015 10:34:06 -0500 From: Geliang Tang To: "David S. Miller" Cc: Geliang Tang , linux-x25@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 10/14] lapb: use list_for_each_entry Date: Fri, 18 Dec 2015 23:33:34 +0800 Message-Id: <8052477babbd71d4024331fa804bbf7cb9b60ad1.1450451516.git.geliangtang@163.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: References: In-Reply-To: References: X-CM-TRANSID: DtGowEAZ+UNpJ3RWAuQbAA--.8444S3 X-Coremail-Antispam: 1Uf129KBjvdXoW7GF45GFykWF1kGw4kWFWfKrg_yoW3Crb_Aa s7JFs8Ca1jyrWrWrs0yws3Ar93Jr1vg3Z5ur1xtayDJa4UGa1SkryqyrnxWry7uw4FqFy5 ur1kZryxKw17JjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUU_b17UUUUU== X-Originating-IP: [116.77.150.30] X-CM-SenderInfo: 5jhoxtpqjwt0rj6rljoofrz/1tbiNQrUmVSIK4K+WQAAsg Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1011 Lines: 34 Use list_for_each_entry() instead of list_for_each() to simplify the code. Signed-off-by: Geliang Tang --- net/lapb/lapb_iface.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/net/lapb/lapb_iface.c b/net/lapb/lapb_iface.c index fc60d9d..49abba7 100644 --- a/net/lapb/lapb_iface.c +++ b/net/lapb/lapb_iface.c @@ -86,11 +86,9 @@ static void __lapb_insert_cb(struct lapb_cb *lapb) static struct lapb_cb *__lapb_devtostruct(struct net_device *dev) { - struct list_head *entry; struct lapb_cb *lapb, *use = NULL; - list_for_each(entry, &lapb_list) { - lapb = list_entry(entry, struct lapb_cb, node); + list_for_each_entry(lapb, &lapb_list, node) { if (lapb->dev == dev) { use = lapb; break; -- 2.5.0 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/