From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> To: Stefan Wahren <wahrenst@gmx.net> Cc: Umang Jain <umang.jain@ideasonboard.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Florian Fainelli <florian.fainelli@broadcom.com>, Dan Carpenter <dan.carpenter@linaro.org>, Phil Elwell <phil@raspberrypi.com>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Kieran Bingham <kieran.bingham@ideasonboard.com>, 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 Date: Mon, 30 Oct 2023 01:44:41 +0200 [thread overview] Message-ID: <20231029234441.GH12144@pendragon.ideasonboard.com> (raw) In-Reply-To: <20231029124837.119832-2-wahrenst@gmx.net> 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 <laurent.pinchart@ideasonboard.com> > Signed-off-by: Stefan Wahren <wahrenst@gmx.net> I don't remember suggesting this, but that's fine, it looks like a good change :-) Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > .../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
WARNING: multiple messages have this Message-ID (diff)
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com> To: Stefan Wahren <wahrenst@gmx.net> Cc: Umang Jain <umang.jain@ideasonboard.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Florian Fainelli <florian.fainelli@broadcom.com>, Dan Carpenter <dan.carpenter@linaro.org>, Phil Elwell <phil@raspberrypi.com>, Dave Stevenson <dave.stevenson@raspberrypi.com>, Kieran Bingham <kieran.bingham@ideasonboard.com>, 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 Date: Mon, 30 Oct 2023 01:44:41 +0200 [thread overview] Message-ID: <20231029234441.GH12144@pendragon.ideasonboard.com> (raw) In-Reply-To: <20231029124837.119832-2-wahrenst@gmx.net> 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 <laurent.pinchart@ideasonboard.com> > Signed-off-by: Stefan Wahren <wahrenst@gmx.net> I don't remember suggesting this, but that's fine, it looks like a good change :-) Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > .../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
next prev parent reply other threads:[~2023-10-29 23:44 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-10-29 12:48 [PATCH V2 0/3] staging: vchiq_arm: move state dump to debugfs Stefan Wahren 2023-10-29 12:48 ` Stefan Wahren 2023-10-29 12:48 ` [PATCH V2 1/3] staging: vchiq_core: Make vchiq_dump_service_state static Stefan Wahren 2023-10-29 12:48 ` Stefan Wahren 2023-10-29 23:44 ` Laurent Pinchart [this message] 2023-10-29 23:44 ` Laurent Pinchart 2023-10-29 12:48 ` [PATCH V2 2/3] staging: vchiq_core: Shorten bulk TX/RX pending dump Stefan Wahren 2023-10-29 12:48 ` Stefan Wahren 2023-10-29 23:46 ` Laurent Pinchart 2023-10-29 23:46 ` Laurent Pinchart 2023-10-29 12:48 ` [PATCH V2 3/3] staging: vchiq_arm: move state dump to debugfs Stefan Wahren 2023-10-29 12:48 ` Stefan Wahren 2023-10-29 15:03 ` Ricardo B. Marliere 2023-10-29 15:03 ` Ricardo B. Marliere 2023-11-22 12:17 ` [PATCH V2 0/3] " Stefan Wahren 2023-11-22 12:17 ` Stefan Wahren 2023-11-22 12:23 ` Greg Kroah-Hartman 2023-11-22 12:23 ` Greg Kroah-Hartman
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20231029234441.GH12144@pendragon.ideasonboard.com \ --to=laurent.pinchart@ideasonboard.com \ --cc=dan.carpenter@linaro.org \ --cc=dave.stevenson@raspberrypi.com \ --cc=florian.fainelli@broadcom.com \ --cc=gregkh@linuxfoundation.org \ --cc=kieran.bingham@ideasonboard.com \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-media@vger.kernel.org \ --cc=linux-staging@lists.linux.dev \ --cc=phil@raspberrypi.com \ --cc=umang.jain@ideasonboard.com \ --cc=wahrenst@gmx.net \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.