From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-kernel@vger.kernel.org
Cc: "Rafael J. Wysocki" <rafael@kernel.org>,
Zijun Hu <quic_zijuhu@quicinc.com>,
Andy Shevchenko <andy.shevchenko@gmail.com>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 5/5] driver core: Use 2-argument strscpy()
Date: Wed, 21 Aug 2024 18:48:23 +0300 [thread overview]
Message-ID: <20240821154839.604259-6-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240821154839.604259-1-andriy.shevchenko@linux.intel.com>
From: Andy Shevchenko <andy.shevchenko@gmail.com>
Use 2-argument strscpy(), which is not only shorter but also provides
an additional check that destination buffer is an array.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/base/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 1e5d7f9bc4f4..2a31dc0ed21b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -4867,7 +4867,7 @@ set_dev_info(const struct device *dev, struct dev_printk_info *dev_info)
else
return;
- strscpy(dev_info->subsystem, subsys, sizeof(dev_info->subsystem));
+ strscpy(dev_info->subsystem, subsys);
/*
* Add device identifier DEVICE=:
--
2.43.0.rc1.1336.g36b5255a03ac
next prev parent reply other threads:[~2024-08-21 15:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 15:48 [PATCH v1 0/5] driver core: fw_devlink: Clean up strings and mutex usages Andy Shevchenko
2024-08-21 15:48 ` [PATCH v1 1/5] driver core: Sort headers Andy Shevchenko
2024-08-22 3:30 ` quic_zijuhu
2024-08-22 11:50 ` Andy Shevchenko
2024-08-21 15:48 ` [PATCH v1 2/5] driver core: Use kasprintf() instead of fixed buffer formatting Andy Shevchenko
2024-08-21 15:48 ` [PATCH v1 3/5] driver core: Use guards for simple mutex locks Andy Shevchenko
2024-08-21 15:48 ` [PATCH v1 4/5] driver core: Make use of returned value of dev_err_probe() Andy Shevchenko
2024-08-21 15:48 ` Andy Shevchenko [this message]
2024-08-22 7:39 ` [PATCH v1 0/5] driver core: fw_devlink: Clean up strings and mutex usages 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=20240821154839.604259-6-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy.shevchenko@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=quic_zijuhu@quicinc.com \
--cc=rafael@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.