From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: "Xiaowei Song" <songxiaowei@hisilicon.com>,
"Binghui Wang" <wangbinghui@hisilicon.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kw@linux.com>,
"Rob Herring" <robh@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
LKML <linux-kernel@vger.kernel.org>,
kernel-janitors@vger.kernel.org, linux-pci@vger.kernel.org
Subject: Re: [PATCH] PCI: kirin: Use devm_kasprintf()
Date: Tue, 14 Nov 2023 15:06:31 +0200 (EET) [thread overview]
Message-ID: <fa6eb291-1dfc-1f18-aef1-bf8e91d0fd64@linux.intel.com> (raw)
In-Reply-To: <085fc5ac70fc8d73d5da197967e76d18f2ab5208.1699774592.git.christophe.jaillet@wanadoo.fr>
[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]
On Sun, 12 Nov 2023, Christophe JAILLET wrote:
> Use devm_kasprintf() instead of hand writing it.
> This saves the need of an intermediate buffer.
>
> There was also no reason to use the _const() version of devm_kstrdup().
> The string was known be not constant.
was known be -> is known to be
With that fixed,
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> drivers/pci/controller/dwc/pcie-kirin.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controller/dwc/pcie-kirin.c
> index 2ee146767971..d9e3514de0a0 100644
> --- a/drivers/pci/controller/dwc/pcie-kirin.c
> +++ b/drivers/pci/controller/dwc/pcie-kirin.c
> @@ -366,7 +366,6 @@ static int kirin_pcie_get_gpio_enable(struct kirin_pcie *pcie,
> struct platform_device *pdev)
> {
> struct device *dev = &pdev->dev;
> - char name[32];
> int ret, i;
>
> /* This is an optional property */
> @@ -387,9 +386,8 @@ static int kirin_pcie_get_gpio_enable(struct kirin_pcie *pcie,
> if (pcie->gpio_id_clkreq[i] < 0)
> return pcie->gpio_id_clkreq[i];
>
> - sprintf(name, "pcie_clkreq_%d", i);
> - pcie->clkreq_names[i] = devm_kstrdup_const(dev, name,
> - GFP_KERNEL);
> + pcie->clkreq_names[i] = devm_kasprintf(dev, GFP_KERNEL,
> + "pcie_clkreq_%d", i);
> if (!pcie->clkreq_names[i])
> return -ENOMEM;
> }
>
prev parent reply other threads:[~2023-11-14 13:06 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-12 7:37 [PATCH] PCI: kirin: Use devm_kasprintf() Christophe JAILLET
2023-11-13 9:30 ` Serge Semin
2023-11-13 9:55 ` Krzysztof Wilczyński
2023-11-13 19:13 ` Christophe JAILLET
2023-11-14 13:06 ` Ilpo Järvinen [this message]
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=fa6eb291-1dfc-1f18-aef1-bf8e91d0fd64@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=bhelgaas@google.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=kernel-janitors@vger.kernel.org \
--cc=kw@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lpieralisi@kernel.org \
--cc=robh@kernel.org \
--cc=songxiaowei@hisilicon.com \
--cc=wangbinghui@hisilicon.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox