All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Rich Felker <dalias@libc.org>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] sh: dma: use str_plural helper in register_dmac
Date: Thu, 4 Jun 2026 13:47:19 +0200	[thread overview]
Message-ID: <aiFlx8arTja5SVbC@linux.dev> (raw)
In-Reply-To: <20260604113442.1303771-3-thorsten.blum@linux.dev>

Please note that this patch requires the following to apply cleanly:
https://lore.kernel.org/lkml/20260510161012.108731-4-thorsten.blum@linux.dev/

On Thu, Jun 04, 2026 at 01:34:42PM +0200, Thorsten Blum wrote:
> Replace the manual ternary "s" pluralization with str_plural() to
> simplify the code. This also corrects the "0 channels" case.
> 
> Use pr_info() while at it.
> 
> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
> ---
>  arch/sh/drivers/dma/dma-api.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
> index 31b614358270..7c8ee3a0bdf9 100644
> --- a/arch/sh/drivers/dma/dma-api.c
> +++ b/arch/sh/drivers/dma/dma-api.c
> @@ -17,6 +17,7 @@
>  #include <linux/sched.h>
>  #include <linux/slab.h>
>  #include <linux/string.h>
> +#include <linux/string_choices.h>
>  #include <asm/dma.h>
>  
>  DEFINE_SPINLOCK(dma_spin_lock);
> @@ -200,8 +201,8 @@ int register_dmac(struct dma_info *info)
>  
>  	INIT_LIST_HEAD(&info->list);
>  
> -	printk(KERN_INFO "DMA: Registering %s handler (%d channel%s).\n",
> -	       info->name, info->nr_channels, info->nr_channels > 1 ? "s" : "");
> +	pr_info("DMA: Registering %s handler (%d channel%s).\n",
> +		info->name, info->nr_channels, str_plural(info->nr_channels));
>  
>  	BUG_ON((info->flags & DMAC_CHANNELS_CONFIGURED) && !info->channels);
>  

  reply	other threads:[~2026-06-04 11:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04 11:34 [PATCH] sh: dma: use str_plural helper in register_dmac Thorsten Blum
2026-06-04 11:47 ` Thorsten Blum [this message]
2026-06-04 12:12 ` Geert Uytterhoeven

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=aiFlx8arTja5SVbC@linux.dev \
    --to=thorsten.blum@linux.dev \
    --cc=dalias@libc.org \
    --cc=glaubitz@physik.fu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    /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: link
Be 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.