Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5750526rwb; Mon, 14 Nov 2022 08:59:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf7WOXukYF82j+/Tdmr3TAd5QHMKbZayh+ZZkeezngJC6ZWHN+36dMs66DCfyNyS+3a8T0rf X-Received: by 2002:aa7:c557:0:b0:464:b8b:f526 with SMTP id s23-20020aa7c557000000b004640b8bf526mr12223272edr.342.1668445156358; Mon, 14 Nov 2022 08:59:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668445156; cv=none; d=google.com; s=arc-20160816; b=qivxKAlmaKEKckWRuUL71Gqm0jG0iMc3X6FuDrsCjZd2veMHqRenHwNI/OSPYhjf+V 9TrrSoa7JhH3pI16XKVa7ozH/7+cLak0RKSRWa+6ZNNux9r1kYeP/9k10mYa/dBh6i76 CQyDu6Pf10IuFd9oyaTqZ7kYNUNQREa8FvP8JAtfVp0u7Cp1wEkBbq5hoGBPxO56uW2p Trp3AotuuR+P0F9oFeF90FuhWW2Nq3QPvo6VWRRoka3Z1X6eRPPG2M8ljLJVSzYbhh0S lu532WR7tUYI9cI56gcdHyjl347kTP8g5aXxw6RYN0+03xUqdZ2b50MBO2oSopjsmP1F QZ6g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=y39UfS6w9d1t5BJ5bHBPZC9Hu5K6BIEJuP0NDm+Ydso=; b=UtFmpheYavR5NCEFG0tNWEMHO7DsjTdheS2dHMzBqTeVU34eyjDZ2TTPVKlveQJjo6 SHrQlbeg0Ebnp/5QU2r4vLWslAVw24/ajBKzQlP6xWxAqAwFd5QRyB/sJmWog+QfRExx sU+xAS3KBwXyhugmYqRVK+1cxKEffZAp/FWqRFNS8Z3rwtRVgeUCtuK3pKFtsuQhI2Ci imaKGUQlorInviDS8tnfn8INPiOu8ukRh+n74HW7sExhJCimqhEZFmeo/o16dzl/m8yr wAVk/5Sgw6MrTkMTZQYzB7EcVmRmptiRpTndW2HKrV/98Xjlax0l+NsRimXhqrBIqhSY 2XlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=EvZaT7ne; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qw36-20020a1709066a2400b0078d4b605b71si8311050ejc.338.2022.11.14.08.58.55; Mon, 14 Nov 2022 08:59:16 -0800 (PST) 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=@intel.com header.s=Intel header.b=EvZaT7ne; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237103AbiKNQWE (ORCPT + 87 others); Mon, 14 Nov 2022 11:22:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236819AbiKNQVw (ORCPT ); Mon, 14 Nov 2022 11:21:52 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14F1F1A3A9; Mon, 14 Nov 2022 08:21:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668442912; x=1699978912; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=I1tXtGfpkBEDqmbmf0YyNkDOosbFpAcq/3pOL4dmk2w=; b=EvZaT7neuLhMi2LQD6KnD+4tfnZ3nkzl2I7zkX7SVgmhMyNN4g/d1wkh JuhvxYrGZMlg7pSxlCjL9QP7tpq84JArPiAXwVyIDDetlTHhXnaKNlsFk eTgEZBasZ1AL7g9C5WDoGBFRnPwqaBJd0DO4IEiuw6KZ0pGpOpXzjWMV8 BoBVvj6j4kUUpnVx8HOMQFae+8dc9hchjxjr3ROhCZ0VHT3O97DDJLqBf FnuM4gcry7klKhiOsbhNTQm6b+LUJw3QTBGXOXnB50hkH3KnK7so2tB5q 5koE+DZWx6Ue1OrSGCM+Noorkl0CKx1G6bA/YhTZCsooytYZTfG1g1M8Y w==; X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="398302933" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="398302933" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2022 08:21:50 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10531"; a="616372367" X-IronPort-AV: E=Sophos;i="5.96,164,1665471600"; d="scan'208";a="616372367" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 14 Nov 2022 08:21:46 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BD50732E; Mon, 14 Nov 2022 18:22:10 +0200 (EET) From: Andy Shevchenko To: Jakob Koschel , Andy Shevchenko , Greg Kroah-Hartman , Mathias Nyman , intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Cc: Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , Tvrtko Ursulin , David Airlie , Daniel Vetter , Kevin Cernekee , Mathias Nyman , Andrew Morton Subject: [PATCH v2 3/4] usb: gadget: udc: bcm63xx: Convert to use list_count() Date: Mon, 14 Nov 2022 18:22:06 +0200 Message-Id: <20221114162207.62559-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221114162207.62559-1-andriy.shevchenko@linux.intel.com> References: <20221114162207.62559-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 The list API now provides the list_count() to help with counting existing nodes in the list. Uilise it. Signed-off-by: Andy Shevchenko --- v2: no change drivers/usb/gadget/udc/bcm63xx_udc.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c index 2cdb07905bde..0762e49e85f8 100644 --- a/drivers/usb/gadget/udc/bcm63xx_udc.c +++ b/drivers/usb/gadget/udc/bcm63xx_udc.c @@ -2172,7 +2172,6 @@ static int bcm63xx_iudma_dbg_show(struct seq_file *s, void *p) for (ch_idx = 0; ch_idx < BCM63XX_NUM_IUDMA; ch_idx++) { struct iudma_ch *iudma = &udc->iudma[ch_idx]; - struct list_head *pos; seq_printf(s, "IUDMA channel %d -- ", ch_idx); switch (iudma_defaults[ch_idx].ep_type) { @@ -2205,14 +2204,10 @@ static int bcm63xx_iudma_dbg_show(struct seq_file *s, void *p) seq_printf(s, " desc: %d/%d used", iudma->n_bds_used, iudma->n_bds); - if (iudma->bep) { - i = 0; - list_for_each(pos, &iudma->bep->queue) - i++; - seq_printf(s, "; %d queued\n", i); - } else { + if (iudma->bep) + seq_printf(s, "; %zu queued\n", list_count(&iudma->bep->queue)); + else seq_printf(s, "\n"); - } for (i = 0; i < iudma->n_bds; i++) { struct bcm_enet_desc *d = &iudma->bd_ring[i]; -- 2.35.1