* [PATCH 2/2] bus: arm-ccn: Simplify code
@ 2017-08-27 10:07 Christophe JAILLET
2017-08-28 20:57 ` Scott Branden
2017-08-29 8:50 ` Pawel Moll
0 siblings, 2 replies; 3+ messages in thread
From: Christophe JAILLET @ 2017-08-27 10:07 UTC (permalink / raw)
To: kernel-janitors
Use 'devm_kasprintf()' to simplify the code.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/bus/arm-ccn.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
index c0e851a0a3d7..9b6fac98e992 100644
--- a/drivers/bus/arm-ccn.c
+++ b/drivers/bus/arm-ccn.c
@@ -1268,14 +1268,12 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
if (ccn->dt.id = 0) {
name = "ccn";
} else {
- int len = snprintf(NULL, 0, "ccn_%d", ccn->dt.id);
-
- name = devm_kzalloc(ccn->dev, len + 1, GFP_KERNEL);
+ name = devm_kasprintf(ccn->dev, GFP_KERNEL, "ccn_%d",
+ ccn->dt.id);
if (!name) {
err = -ENOMEM;
goto error_choose_name;
}
- snprintf(name, len + 1, "ccn_%d", ccn->dt.id);
}
/* Perf driver registration */
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] bus: arm-ccn: Simplify code
2017-08-27 10:07 [PATCH 2/2] bus: arm-ccn: Simplify code Christophe JAILLET
@ 2017-08-28 20:57 ` Scott Branden
2017-08-29 8:50 ` Pawel Moll
1 sibling, 0 replies; 3+ messages in thread
From: Scott Branden @ 2017-08-28 20:57 UTC (permalink / raw)
To: kernel-janitors
Change looks good.
On 17-08-27 03:07 AM, Christophe JAILLET wrote:
> Use 'devm_kasprintf()' to simplify the code.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Acked-by: Scott Branden <scott.branden@broadcom.com>
> ---
> drivers/bus/arm-ccn.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c
> index c0e851a0a3d7..9b6fac98e992 100644
> --- a/drivers/bus/arm-ccn.c
> +++ b/drivers/bus/arm-ccn.c
> @@ -1268,14 +1268,12 @@ static int arm_ccn_pmu_init(struct arm_ccn *ccn)
> if (ccn->dt.id = 0) {
> name = "ccn";
> } else {
> - int len = snprintf(NULL, 0, "ccn_%d", ccn->dt.id);
> -
> - name = devm_kzalloc(ccn->dev, len + 1, GFP_KERNEL);
> + name = devm_kasprintf(ccn->dev, GFP_KERNEL, "ccn_%d",
> + ccn->dt.id);
> if (!name) {
> err = -ENOMEM;
> goto error_choose_name;
> }
> - snprintf(name, len + 1, "ccn_%d", ccn->dt.id);
> }
>
> /* Perf driver registration */
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 2/2] bus: arm-ccn: Simplify code
2017-08-27 10:07 [PATCH 2/2] bus: arm-ccn: Simplify code Christophe JAILLET
2017-08-28 20:57 ` Scott Branden
@ 2017-08-29 8:50 ` Pawel Moll
1 sibling, 0 replies; 3+ messages in thread
From: Pawel Moll @ 2017-08-29 8:50 UTC (permalink / raw)
To: kernel-janitors
On Sun, 2017-08-27 at 12:07 +0200, Christophe JAILLET wrote:
> Use 'devm_kasprintf()' to simplify the code.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Fine by me. Will queue it, thanks!
Pawel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-08-29 8:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-27 10:07 [PATCH 2/2] bus: arm-ccn: Simplify code Christophe JAILLET
2017-08-28 20:57 ` Scott Branden
2017-08-29 8:50 ` Pawel Moll
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.