From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A67B7C4332F for ; Sun, 29 Oct 2023 23:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hnAA1OSJAFggPsFJwPr1NX0STRFLYPV7+6F9vcMKC2c=; b=X5YlXee/Pgyhxa XG35Aur/ffVn340oO0n9V8qEXmBYwa6O6qqNPs7w7Bv2jAyMNB1ePdhhFTMhmaGv3jxY40FcGIGqT anVqKrcb6EH+rOdpUGBcFWA9IrJSmn9zRSZ6ImJ5rB3StAUyTkl8Z8rlhz3KCM0eIBH3G4ZAxtjsA 44LErlbYS4z0PKbvyr+T5w/Iu3xzyBSiOIn5kAFAe3nsulwNVaEiQKyxYxLyV+oSFu9cyj2trXd8m iSzfzuHJDcmpsRso/OrUfESlrOYdh594F3T9VueFcS/pafoTA8KtVjNvmbaIrbO9zRqWlB+pwfptM woSH9AwTCOkq+AONDmuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qxFTw-002IaF-2k; Sun, 29 Oct 2023 23:46:12 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qxFTu-002IZp-13 for linux-arm-kernel@lists.infradead.org; Sun, 29 Oct 2023 23:46:11 +0000 Received: from pendragon.ideasonboard.com (213-243-189-158.bb.dnainternet.fi [213.243.189.158]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id EAA7B83F; Mon, 30 Oct 2023 00:45:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698623154; bh=tud3zNbH7C5LrMzJvG7ZKK47ATz69dzd2aK3sf4w30M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=d72nfp+nAP8csoZO/gAwzz5IugtKdPaV9Y2Bk5dsGWo+u0tju5C08qwLc6VWp84v8 PHhUYdR59Z4CdCEK/jYSuwIyQEesKVBrHvVNp6TRCiMy5fsR/e7OapBR0mhsmK/YxG xb2NbTk4BF9ktB4D91SwWsl5sSo6joO3QqBrVmkQ= Date: Mon, 30 Oct 2023 01:46:15 +0200 From: Laurent Pinchart To: Stefan Wahren Cc: Umang Jain , Greg Kroah-Hartman , Florian Fainelli , Dan Carpenter , Phil Elwell , Dave Stevenson , Kieran Bingham , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org Subject: Re: [PATCH V2 2/3] staging: vchiq_core: Shorten bulk TX/RX pending dump Message-ID: <20231029234615.GI12144@pendragon.ideasonboard.com> References: <20231029124837.119832-1-wahrenst@gmx.net> <20231029124837.119832-3-wahrenst@gmx.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231029124837.119832-3-wahrenst@gmx.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231029_164610_508519_DBA2989C X-CRM114-Status: GOOD ( 16.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Stefan, Thank you for the patch. On Sun, Oct 29, 2023 at 01:48:36PM +0100, Stefan Wahren wrote: > The calculation for the bulk TX/RX pending is complex and > reaches 99 chars per line. So move the size determination > below the pending calculation and get the rid of the > ternary operator. > > Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart > --- > .../interface/vchiq_arm/vchiq_core.c | 19 ++++++++++++------- > 1 file changed, 12 insertions(+), 7 deletions(-) > > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > index 94073f92651a..36c742a2f3b2 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > @@ -3447,7 +3447,7 @@ vchiq_dump_service_state(void *dump_context, struct vchiq_service *service) > struct vchiq_service_quota *quota = > &service->state->service_quotas[service->localport]; > int fourcc = service->base.fourcc; > - int tx_pending, rx_pending; > + int tx_pending, rx_pending, tx_size = 0, rx_size = 0; > > if (service->remoteport != VCHIQ_PORT_FREE) { > int len2 = scnprintf(remoteport, sizeof(remoteport), > @@ -3472,18 +3472,23 @@ vchiq_dump_service_state(void *dump_context, struct vchiq_service *service) > > tx_pending = service->bulk_tx.local_insert - > service->bulk_tx.remote_insert; > + if (tx_pending) { > + unsigned int i = BULK_INDEX(service->bulk_tx.remove); > + > + tx_size = service->bulk_tx.bulks[i].size; > + } > > rx_pending = service->bulk_rx.local_insert - > service->bulk_rx.remote_insert; > + if (rx_pending) { > + unsigned int i = BULK_INDEX(service->bulk_rx.remove); > + > + rx_size = service->bulk_rx.bulks[i].size; > + } > > len = scnprintf(buf, sizeof(buf), > " Bulk: tx_pending=%d (size %d), rx_pending=%d (size %d)", > - tx_pending, > - tx_pending ? > - service->bulk_tx.bulks[BULK_INDEX(service->bulk_tx.remove)].size : > - 0, rx_pending, rx_pending ? > - service->bulk_rx.bulks[BULK_INDEX(service->bulk_rx.remove)].size : > - 0); > + tx_pending, tx_size, rx_pending, rx_size); > > if (VCHIQ_ENABLE_STATS) { > err = vchiq_dump(dump_context, buf, len + 1); -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel