All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thorsten Blum <thorsten.blum@linux.dev>
To: Yoshinori Sato <ysato@users.sourceforge.jp>,
	Rich Felker <dalias@libc.org>,
	John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Cc: Thorsten Blum <thorsten.blum@linux.dev>,
	linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 3/3] sh: dma: drop redundant size argument from strscpy in request_dma
Date: Mon, 20 Apr 2026 17:10:00 +0200	[thread overview]
Message-ID: <20260420150958.17072-7-thorsten.blum@linux.dev> (raw)
In-Reply-To: <20260420150958.17072-5-thorsten.blum@linux.dev>

The strscpy() size argument is optional if the destination buffer has a
fixed length. Use the two-argument version of strscpy() to copy 'dev_id'
to simplify the code.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
---
 arch/sh/drivers/dma/dma-api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/sh/drivers/dma/dma-api.c b/arch/sh/drivers/dma/dma-api.c
index 87e5a8928873..15e2c10c9805 100644
--- a/arch/sh/drivers/dma/dma-api.c
+++ b/arch/sh/drivers/dma/dma-api.c
@@ -96,7 +96,7 @@ int request_dma(unsigned int chan, const char *dev_id)
 	if (atomic_xchg(&channel->busy, 1))
 		return -EBUSY;
 
-	strscpy(channel->dev_id, dev_id, sizeof(channel->dev_id));
+	strscpy(channel->dev_id, dev_id);
 
 	if (info->ops->request) {
 		result = info->ops->request(channel);

  parent reply	other threads:[~2026-04-20 15:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 15:09 [PATCH 1/3] sh: dma-sysfs: use sysfs_emit{_at} in show functions Thorsten Blum
2026-04-20 15:09 ` [PATCH 2/3] sh: dma-sysfs: use strscpy in dma_store_dev_id Thorsten Blum
2026-04-21  7:04   ` Geert Uytterhoeven
2026-04-20 15:10 ` Thorsten Blum [this message]
2026-04-21  7:05   ` [PATCH 3/3] sh: dma: drop redundant size argument from strscpy in request_dma Geert Uytterhoeven
2026-04-22  6:57 ` [PATCH 1/3] sh: dma-sysfs: use sysfs_emit{_at} in show functions Geert Uytterhoeven
  -- strict thread matches above, loose matches on Subject: below --
2026-05-18 17:10 Thorsten Blum
2026-05-18 17:10 ` [PATCH 3/3] sh: dma: drop redundant size argument from strscpy in request_dma Thorsten Blum

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=20260420150958.17072-7-thorsten.blum@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 \
    --cc=ysato@users.sourceforge.jp \
    /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.