From patchwork Thu Apr 27 13:39:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 88272 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp294538vqo; Thu, 27 Apr 2023 07:08:40 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ760xqiGMTQaJTAWibUyVmbYjSkWKArUHqnjlJerWwh0Bj2W5YzywxNhIzRYlRp5yWFOdMI X-Received: by 2002:a17:90b:3a8e:b0:247:ab52:d5d8 with SMTP id om14-20020a17090b3a8e00b00247ab52d5d8mr1997635pjb.26.1682604519762; Thu, 27 Apr 2023 07:08:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682604519; cv=none; d=google.com; s=arc-20160816; b=KXYKOD1VuKHWYnyb+QGvu0I6R7tTQXxDRoPnTFtgu1plDKl5ntlfslpDEFwk9+2u9v 8HORjlAK/upXVXtb829MeoXq54FpbMWGV7igpPLhhIg762hQl1rqGrxS0mhuuVTa0e3P 8CBZSyvmpX+upMYkH45Xoa3NYTMk4ltavSgNCvO9HA47GcnakL7P27KbeCq57o0MbigC yEriDl1hyeQ60yTqRh8/aKCV6wS+LTJ5TnsA7Qkaad3BLJXRuoDcRow4HtukmBDYDvQ0 6KC58N/goHgXMo0IfZ7pNIX3NL1CujFwtcO4awMTalDBcv+Q5G1ZvmznkuD+6qAImFyP hMEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=xNHjnfO6hqQ3RjIXVzoEC16ztSod8ZRX8nPzacvbSXU=; b=CM2RB651nyPcFceYER97myBcaaq4aaxiW4+e6Pl0n1Xoxd0c0F3VgjuJt8W47yqaLZ xamK1g4pZcnU0l1g6kLJUpNcYGk37/fXNFZhjL6pdjMGuvbtT3G5UWkBITtoQ7Ya0SVY /DhThdpFOpoklv8wCgHWb+y0J5qVzaKpJyx9wcD6UjKBvvNHDAnDi1P/uQ1Pf6vi4HhS bRkxwIkOVBc6YfQtNx3nl129LPnjEBfoIW2psYE+qNNFHKOgGkISTFwQ/pHbfDe7Tqhy yDiS96hUlN3TBbJJ+VQ9RbbGaY7EwpKxTdQHtDHIIJtQFidGTEa0bDf5BkHMmweQ5pQ5 94jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=T6R7lunp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h71-20020a63834a000000b0052584091339si12257313pge.244.2023.04.27.07.08.21; Thu, 27 Apr 2023 07:08:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=T6R7lunp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243466AbjD0NkI (ORCPT + 99 others); Thu, 27 Apr 2023 09:40:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243468AbjD0NkG (ORCPT ); Thu, 27 Apr 2023 09:40:06 -0400 Received: from smtp.smtpout.orange.fr (smtp-26.smtpout.orange.fr [80.12.242.26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 979DDE72 for ; Thu, 27 Apr 2023 06:40:04 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id s1qrpS4bWFuuVs1qrpeFzo; Thu, 27 Apr 2023 15:40:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1682602802; bh=xNHjnfO6hqQ3RjIXVzoEC16ztSod8ZRX8nPzacvbSXU=; h=From:To:Cc:Subject:Date; b=T6R7lunp4aeEdC38rs8pLq+riXSql4dd2rfJn1OPA6zKIP0oGQAEzcJ9RsRw4MKZI JutbsjTMy3/kgcUq3FQ8RbpZhKYeq+teYscvXqMe2A/FvkbmBiLxrKnkVE3oRWOhkT ndCnZXXV6MrOyiSvpGPhP/kfF5FvwA8mI1RCoLDKmlTBT/Es7o+ztiRZs2DLVpdH+i VPW5qZZc+OyAa8zc7pbzEn1zr4qArAGS9wnGxmOa5JhBUCyBEAwSi/w7FFXUkVV4CP ZdGQMo7WxI2gXtnqF9l2GrnvFp4UzKRI/vSjYOLihqhEYlmsfNIpjprkCYMrY/w0F+ e77wdyihPG4nQ== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 27 Apr 2023 15:40:02 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET To: Karsten Keil Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , netdev@vger.kernel.org Subject: [PATCH] mISDN: Use list_count_nodes() Date: Thu, 27 Apr 2023 15:39:48 +0200 Message-Id: <886a6fe86cfc3d787a2e3a5062ce8bd92323ed66.1682602766.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764338716642734958?= X-GMAIL-MSGID: =?utf-8?q?1764338716642734958?= count_list_member() really looks the same as list_count_nodes(), so use the latter instead of hand writing it. The first one return an int and the other a size_t, but that should be fine. It is really unlikely that we get so many parties in a conference. Signed-off-by: Christophe JAILLET --- Un-tested --- drivers/isdn/mISDN/dsp_cmx.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/drivers/isdn/mISDN/dsp_cmx.c b/drivers/isdn/mISDN/dsp_cmx.c index 6d2088fbaf69..357b87592eb4 100644 --- a/drivers/isdn/mISDN/dsp_cmx.c +++ b/drivers/isdn/mISDN/dsp_cmx.c @@ -141,17 +141,6 @@ /*#define CMX_DELAY_DEBUG * gives rx-buffer delay overview */ /*#define CMX_TX_DEBUG * massive read/write on tx-buffer with content */ -static inline int -count_list_member(struct list_head *head) -{ - int cnt = 0; - struct list_head *m; - - list_for_each(m, head) - cnt++; - return cnt; -} - /* * debug cmx memory structure */ @@ -1672,7 +1661,7 @@ dsp_cmx_send(void *arg) mustmix = 0; members = 0; if (conf) { - members = count_list_member(&conf->mlist); + members = list_count_nodes(&conf->mlist); #ifdef CMX_CONF_DEBUG if (conf->software && members > 1) #else @@ -1695,7 +1684,7 @@ dsp_cmx_send(void *arg) /* loop all members that require conference mixing */ list_for_each_entry(conf, &conf_ilist, list) { /* count members and check hardware */ - members = count_list_member(&conf->mlist); + members = list_count_nodes(&conf->mlist); #ifdef CMX_CONF_DEBUG if (conf->software && members > 1) { #else