From nobody Thu Apr 2 16:38:13 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE95EC6FA82 for ; Thu, 22 Sep 2022 10:54:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230422AbiIVKyN (ORCPT ); Thu, 22 Sep 2022 06:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229554AbiIVKyL (ORCPT ); Thu, 22 Sep 2022 06:54:11 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5BE2D4308 for ; Thu, 22 Sep 2022 03:54:09 -0700 (PDT) Received: from dggpemm500024.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4MYBtN48lnzHqKQ; Thu, 22 Sep 2022 18:51:56 +0800 (CST) Received: from dggpemm500013.china.huawei.com (7.185.36.172) by dggpemm500024.china.huawei.com (7.185.36.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 18:54:06 +0800 Received: from ubuntu1804.huawei.com (10.67.175.36) by dggpemm500013.china.huawei.com (7.185.36.172) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 22 Sep 2022 18:54:06 +0800 From: Chen Zhongjin To: , CC: , , , , , , , Subject: [PATCH -next] kcov: Switch to use list_for_each_entry() helper Date: Thu, 22 Sep 2022 18:50:25 +0800 Message-ID: <20220922105025.119941-1-chenzhongjin@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.175.36] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500013.china.huawei.com (7.185.36.172) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Use list_for_each_entry() helper instead of list_for_each() and list_entry() to simplify code a bit. Signed-off-by: Chen Zhongjin --- kernel/kcov.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/kcov.c b/kernel/kcov.c index e19c84b02452..466d7689de5b 100644 --- a/kernel/kcov.c +++ b/kernel/kcov.c @@ -133,10 +133,8 @@ static struct kcov_remote *kcov_remote_add(struct kcov= *kcov, u64 handle) static struct kcov_remote_area *kcov_remote_area_get(unsigned int size) { struct kcov_remote_area *area; - struct list_head *pos; =20 - list_for_each(pos, &kcov_remote_areas) { - area =3D list_entry(pos, struct kcov_remote_area, list); + list_for_each_entry(pos, &kcov_remote_areas, list) { if (area->size =3D=3D size) { list_del(&area->list); return area; --=20 2.17.1