[PATCH 23/53] pds_core: Simplify a create*_workqueue() call

Bart Van Assche posted 53 patches 1 year, 5 months ago
Only 52 patches received!
[PATCH 23/53] pds_core: Simplify a create*_workqueue() call
Posted by Bart Van Assche 1 year, 5 months ago
Pass a format string to create*_workqueue2() instead of formatting the
workqueue name before create*_workqueue() is called.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/net/ethernet/amd/pds_core/main.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c
index 660268ff9562..e2e49656c111 100644
--- a/drivers/net/ethernet/amd/pds_core/main.c
+++ b/drivers/net/ethernet/amd/pds_core/main.c
@@ -213,12 +213,9 @@ static const struct devlink_param pdsc_dl_params[] = {
 			      pdsc_dl_enable_validate),
 };
 
-#define PDSC_WQ_NAME_LEN 24
-
 static int pdsc_init_pf(struct pdsc *pdsc)
 {
 	struct devlink_health_reporter *hr;
-	char wq_name[PDSC_WQ_NAME_LEN];
 	struct devlink *dl;
 	int err;
 
@@ -236,8 +233,8 @@ static int pdsc_init_pf(struct pdsc *pdsc)
 		goto err_out_release_regions;
 
 	/* General workqueue and timer, but don't start timer yet */
-	snprintf(wq_name, sizeof(wq_name), "%s.%d", PDS_CORE_DRV_NAME, pdsc->uid);
-	pdsc->wq = create_singlethread_workqueue(wq_name);
+	pdsc->wq = create_singlethread_workqueue2("%s.%d", PDS_CORE_DRV_NAME,
+						  pdsc->uid);
 	INIT_WORK(&pdsc->health_work, pdsc_health_thread);
 	INIT_WORK(&pdsc->pci_reset_work, pdsc_pci_reset_thread);
 	timer_setup(&pdsc->wdtimer, pdsc_wdtimer_cb, 0);
Re: [PATCH 23/53] pds_core: Simplify a create*_workqueue() call
Posted by Brett Creeley 1 year, 5 months ago

On 6/30/2024 3:26 PM, Bart Van Assche wrote:
> Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding.
> 
> 
> Pass a format string to create*_workqueue2() instead of formatting the
> workqueue name before create*_workqueue() is called.
> 
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   drivers/net/ethernet/amd/pds_core/main.c | 7 ++-----
>   1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amd/pds_core/main.c b/drivers/net/ethernet/amd/pds_core/main.c
> index 660268ff9562..e2e49656c111 100644
> --- a/drivers/net/ethernet/amd/pds_core/main.c
> +++ b/drivers/net/ethernet/amd/pds_core/main.c
> @@ -213,12 +213,9 @@ static const struct devlink_param pdsc_dl_params[] = {
>                                pdsc_dl_enable_validate),
>   };
> 
> -#define PDSC_WQ_NAME_LEN 24
> -
>   static int pdsc_init_pf(struct pdsc *pdsc)
>   {
>          struct devlink_health_reporter *hr;
> -       char wq_name[PDSC_WQ_NAME_LEN];
>          struct devlink *dl;
>          int err;
> 
> @@ -236,8 +233,8 @@ static int pdsc_init_pf(struct pdsc *pdsc)
>                  goto err_out_release_regions;
> 
>          /* General workqueue and timer, but don't start timer yet */
> -       snprintf(wq_name, sizeof(wq_name), "%s.%d", PDS_CORE_DRV_NAME, pdsc->uid);
> -       pdsc->wq = create_singlethread_workqueue(wq_name);
> +       pdsc->wq = create_singlethread_workqueue2("%s.%d", PDS_CORE_DRV_NAME,
> +                                                 pdsc->uid);

LGTM. Thanks.

Reviewed-by: Brett Creeley <brett.creeley@amd.com>

BTW, I don't actually see patch 53/53 that renames *workqueue2() -> 
*workqueue(). Am I missing something here? It's mentioned in the cover 
letter, but I don't see it on the series thread.

Brett

>          INIT_WORK(&pdsc->health_work, pdsc_health_thread);
>          INIT_WORK(&pdsc->pci_reset_work, pdsc_pci_reset_thread);
>          timer_setup(&pdsc->wdtimer, pdsc_wdtimer_cb, 0);
Re: [PATCH 23/53] pds_core: Simplify a create*_workqueue() call
Posted by Bart Van Assche 1 year, 5 months ago
On 7/1/24 11:49 AM, Brett Creeley wrote:
> LGTM. Thanks.
> 
> Reviewed-by: Brett Creeley <brett.creeley@amd.com>
> 
> BTW, I don't actually see patch 53/53 that renames *workqueue2() ->
> *workqueue(). Am I missing something here? It's mentioned in the
> cover letter, but I don't see it on the series thread.
Hi Brett,

I don't see patch 53/53 either on Lore. Maybe I hit an outgoing mail
limit when I sent out this patch series.

Note: as one can see from Tejun's reply to the cover letter I will have
to rework this patch series so I'm not sure whether it's useful that I
make patch 53/53 available now.

Thanks,

Bart.