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 A058DC4332F for ; Sun, 29 Oct 2023 23:45:11 +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=f6iHYAuku+E745Ty2oFgJHN8Vn2g1ktNgNrvICZyFNk=; b=2kgI8BnErc1YAo bV7dPgfK/jJRAHzuRLCHJ/Rr9eMTcEmwLahU2fpYTo+zGiRVKYywf+X9mOdtoa1U+opEyMvi+9klt vnQQsmH3RmwVN4KEGaqxr/LAjYAMNjNXk7NCJRJcTXbkfhK44YSVwNRUUkwxqs8snlvQRhZscMtZi CR6sRiQusqTxMDneyXrCwbNs+4R53+ezgiKZTQfmzrSesj/8KX92BIXgaxyNuLdRvWcGL5stFZptx gbLNrJQ9vWrncNZ+baw8SWOhhRx37nHRPqG9e8ExEMWAb29PD/znk0aDAL4pPRSSnl5VXF2DPjVnk 1FvDiinrS4Bl9u1Jl2WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qxFSV-002ISd-05; Sun, 29 Oct 2023 23:44:43 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qxFSR-002IS7-1e for linux-arm-kernel@lists.infradead.org; Sun, 29 Oct 2023 23:44:41 +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 053B083F; Mon, 30 Oct 2023 00:44:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1698623060; bh=5kHJo1bcTjk4PEua+5BhlwYXe0nsOaz88S+sHX3FDaw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HbLXaHTQiMSf3+V1gVIeK+6/L+wnmPf5yQX8ShKh9UvIho00PtcVql+5iioPSSkoP NLTitB4Llu0oMCD9VpXbU7xsQUH32YVtv+8Se9b6Zg1WZPDtYOCOPZ0kWMCRUBDTjI gCu25P0dK9B5zhX5kJTNlPUk6jAZCM8FrjepwixM= Date: Mon, 30 Oct 2023 01:44:41 +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 1/3] staging: vchiq_core: Make vchiq_dump_service_state static Message-ID: <20231029234441.GH12144@pendragon.ideasonboard.com> References: <20231029124837.119832-1-wahrenst@gmx.net> <20231029124837.119832-2-wahrenst@gmx.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231029124837.119832-2-wahrenst@gmx.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231029_164439_713921_3226E4FF X-CRM114-Status: GOOD ( 21.90 ) 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:35PM +0100, Stefan Wahren wrote: > The function vchiq_dump_service_state() is only used by vchiq_dump_state() > within vchiq_core.c. So move the definition of vchiq_dump_state() below > vchiq_dump_service_state() in order to make it static. > > Suggested-by: Laurent Pinchart > Signed-off-by: Stefan Wahren I don't remember suggesting this, but that's fine, it looks like a good change :-) Reviewed-by: Laurent Pinchart > --- > .../interface/vchiq_arm/vchiq_core.c | 169 +++++++++--------- > .../interface/vchiq_arm/vchiq_core.h | 3 - > 2 files changed, 85 insertions(+), 87 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 39b857da2d42..94073f92651a 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c > @@ -3428,90 +3428,8 @@ vchiq_dump_shared_state(void *dump_context, struct vchiq_state *state, > return 0; > } > > -int vchiq_dump_state(void *dump_context, struct vchiq_state *state) > -{ > - char buf[80]; > - int len; > - int i; > - int err; > - > - len = scnprintf(buf, sizeof(buf), "State %d: %s", state->id, > - conn_state_names[state->conn_state]); > - err = vchiq_dump(dump_context, buf, len + 1); > - if (err) > - return err; > - > - len = scnprintf(buf, sizeof(buf), " tx_pos=%x(@%pK), rx_pos=%x(@%pK)", > - state->local->tx_pos, > - state->tx_data + (state->local_tx_pos & VCHIQ_SLOT_MASK), > - state->rx_pos, > - state->rx_data + (state->rx_pos & VCHIQ_SLOT_MASK)); > - err = vchiq_dump(dump_context, buf, len + 1); > - if (err) > - return err; > - > - len = scnprintf(buf, sizeof(buf), " Version: %d (min %d)", > - VCHIQ_VERSION, VCHIQ_VERSION_MIN); > - err = vchiq_dump(dump_context, buf, len + 1); > - if (err) > - return err; > - > - if (VCHIQ_ENABLE_STATS) { > - len = scnprintf(buf, sizeof(buf), > - " Stats: ctrl_tx_count=%d, ctrl_rx_count=%d, error_count=%d", > - state->stats.ctrl_tx_count, state->stats.ctrl_rx_count, > - state->stats.error_count); > - err = vchiq_dump(dump_context, buf, len + 1); > - if (err) > - return err; > - } > - > - len = scnprintf(buf, sizeof(buf), > - " Slots: %d available (%d data), %d recyclable, %d stalls (%d data)", > - ((state->slot_queue_available * VCHIQ_SLOT_SIZE) - > - state->local_tx_pos) / VCHIQ_SLOT_SIZE, > - state->data_quota - state->data_use_count, > - state->local->slot_queue_recycle - state->slot_queue_available, > - state->stats.slot_stalls, state->stats.data_stalls); > - err = vchiq_dump(dump_context, buf, len + 1); > - if (err) > - return err; > - > - err = vchiq_dump_platform_state(dump_context); > - if (err) > - return err; > - > - err = vchiq_dump_shared_state(dump_context, > - state, > - state->local, > - "Local"); > - if (err) > - return err; > - err = vchiq_dump_shared_state(dump_context, > - state, > - state->remote, > - "Remote"); > - if (err) > - return err; > - > - err = vchiq_dump_platform_instances(dump_context); > - if (err) > - return err; > - > - for (i = 0; i < state->unused_service; i++) { > - struct vchiq_service *service = find_service_by_port(state, i); > - > - if (service) { > - err = vchiq_dump_service_state(dump_context, service); > - vchiq_service_put(service); > - if (err) > - return err; > - } > - } > - return 0; > -} > - > -int vchiq_dump_service_state(void *dump_context, struct vchiq_service *service) > +static int > +vchiq_dump_service_state(void *dump_context, struct vchiq_service *service) > { > char buf[80]; > int len; > @@ -3606,6 +3524,89 @@ int vchiq_dump_service_state(void *dump_context, struct vchiq_service *service) > return err; > } > > +int vchiq_dump_state(void *dump_context, struct vchiq_state *state) > +{ > + char buf[80]; > + int len; > + int i; > + int err; > + > + len = scnprintf(buf, sizeof(buf), "State %d: %s", state->id, > + conn_state_names[state->conn_state]); > + err = vchiq_dump(dump_context, buf, len + 1); > + if (err) > + return err; > + > + len = scnprintf(buf, sizeof(buf), " tx_pos=%x(@%pK), rx_pos=%x(@%pK)", > + state->local->tx_pos, > + state->tx_data + (state->local_tx_pos & VCHIQ_SLOT_MASK), > + state->rx_pos, > + state->rx_data + (state->rx_pos & VCHIQ_SLOT_MASK)); > + err = vchiq_dump(dump_context, buf, len + 1); > + if (err) > + return err; > + > + len = scnprintf(buf, sizeof(buf), " Version: %d (min %d)", > + VCHIQ_VERSION, VCHIQ_VERSION_MIN); > + err = vchiq_dump(dump_context, buf, len + 1); > + if (err) > + return err; > + > + if (VCHIQ_ENABLE_STATS) { > + len = scnprintf(buf, sizeof(buf), > + " Stats: ctrl_tx_count=%d, ctrl_rx_count=%d, error_count=%d", > + state->stats.ctrl_tx_count, state->stats.ctrl_rx_count, > + state->stats.error_count); > + err = vchiq_dump(dump_context, buf, len + 1); > + if (err) > + return err; > + } > + > + len = scnprintf(buf, sizeof(buf), > + " Slots: %d available (%d data), %d recyclable, %d stalls (%d data)", > + ((state->slot_queue_available * VCHIQ_SLOT_SIZE) - > + state->local_tx_pos) / VCHIQ_SLOT_SIZE, > + state->data_quota - state->data_use_count, > + state->local->slot_queue_recycle - state->slot_queue_available, > + state->stats.slot_stalls, state->stats.data_stalls); > + err = vchiq_dump(dump_context, buf, len + 1); > + if (err) > + return err; > + > + err = vchiq_dump_platform_state(dump_context); > + if (err) > + return err; > + > + err = vchiq_dump_shared_state(dump_context, > + state, > + state->local, > + "Local"); > + if (err) > + return err; > + err = vchiq_dump_shared_state(dump_context, > + state, > + state->remote, > + "Remote"); > + if (err) > + return err; > + > + err = vchiq_dump_platform_instances(dump_context); > + if (err) > + return err; > + > + for (i = 0; i < state->unused_service; i++) { > + struct vchiq_service *service = find_service_by_port(state, i); > + > + if (service) { > + err = vchiq_dump_service_state(dump_context, service); > + vchiq_service_put(service); > + if (err) > + return err; > + } > + } > + return 0; > +} > + > int vchiq_send_remote_use(struct vchiq_state *state) > { > if (state->conn_state == VCHIQ_CONNSTATE_DISCONNECTED) > diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h > index 161358db457c..ea8d58844775 100644 > --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h > +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h > @@ -507,9 +507,6 @@ vchiq_bulk_transfer(struct vchiq_instance *instance, unsigned int handle, void * > extern int > vchiq_dump_state(void *dump_context, struct vchiq_state *state); > > -extern int > -vchiq_dump_service_state(void *dump_context, struct vchiq_service *service); > - > extern void > vchiq_loud_error_header(void); > -- Regards, Laurent Pinchart _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel