Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1625959 > unrolled thread
| Started by | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| First post | 2017-04-19 11:10 +0200 |
| Last post | 2017-04-21 15:20 +0200 |
| Articles | 9 — 5 participants |
Back to article view | Back to linux.kernel
[PATCH 0/2] n2rng: Fine-tuning for n2rng_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-19 11:10 +0200
[PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-19 11:20 +0200
Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() Shannon Nelson <shannon.nelson@oracle.com> - 2017-04-19 17:30 +0200
Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() Herbert Xu <herbert@gondor.apana.org.au> - 2017-04-21 13:40 +0200
Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() Joe Perches <joe@perches.com> - 2017-04-21 20:40 +0200
Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() David Miller <davem@davemloft.net> - 2017-04-21 20:40 +0200
[PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-04-19 11:20 +0200
Re: [PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe() Shannon Nelson <shannon.nelson@oracle.com> - 2017-04-19 17:30 +0200
Re: [PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe() Herbert Xu <herbert@gondor.apana.org.au> - 2017-04-21 15:20 +0200
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-19 11:10 +0200 |
| Subject | [PATCH 0/2] n2rng: Fine-tuning for n2rng_probe() |
| Message-ID | <txTMD-1zl-49@gated-at.bofh.it> |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 19 Apr 2017 11:00:11 +0200 Two update suggestions were taken into account from static source code analysis. Markus Elfring (2): Use devm_kcalloc() Combine substrings for two messages drivers/char/hw_random/n2-drv.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) -- 2.12.2
[toc] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-19 11:20 +0200 |
| Subject | [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() |
| Message-ID | <txTWh-1CP-5@gated-at.bofh.it> |
| In reply to | #1625959 |
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Wed, 19 Apr 2017 10:50:04 +0200
The script "checkpatch.pl" pointed information out like the following.
WARNING: quoted string split across lines
Thus fix the affected source code places.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/char/hw_random/n2-drv.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
index 92dd4e925315..f3e67c768101 100644
--- a/drivers/char/hw_random/n2-drv.c
+++ b/drivers/char/hw_random/n2-drv.c
@@ -723,16 +723,16 @@ static int n2rng_probe(struct platform_device *op)
if (sun4v_hvapi_register(HV_GRP_RNG,
np->hvapi_major,
&np->hvapi_minor)) {
- dev_err(&op->dev, "Cannot register suitable "
- "HVAPI version.\n");
+ dev_err(&op->dev,
+ "Cannot register suitable HVAPI version.\n");
goto out;
}
}
if (np->flags & N2RNG_FLAG_MULTI) {
if (np->hvapi_major < 2) {
- dev_err(&op->dev, "multi-unit-capable RNG requires "
- "HVAPI major version 2 or later, got %lu\n",
+ dev_err(&op->dev,
+ "multi-unit-capable RNG requires HVAPI major version 2 or later, got %lu\n",
np->hvapi_major);
goto out_hvapi_unregister;
}
--
2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Shannon Nelson <shannon.nelson@oracle.com> |
|---|---|
| Date | 2017-04-19 17:30 +0200 |
| Subject | Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() |
| Message-ID | <txZIo-56L-69@gated-at.bofh.it> |
| In reply to | #1625966 |
On 4/19/2017 2:11 AM, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Wed, 19 Apr 2017 10:50:04 +0200
>
> The script "checkpatch.pl" pointed information out like the following.
>
> WARNING: quoted string split across lines
>
> Thus fix the affected source code places.
>
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Thanks Markus.
Acked-by: Shannon Nelson <shannon.nelson@oracle.com>
> ---
> drivers/char/hw_random/n2-drv.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
> index 92dd4e925315..f3e67c768101 100644
> --- a/drivers/char/hw_random/n2-drv.c
> +++ b/drivers/char/hw_random/n2-drv.c
> @@ -723,16 +723,16 @@ static int n2rng_probe(struct platform_device *op)
> if (sun4v_hvapi_register(HV_GRP_RNG,
> np->hvapi_major,
> &np->hvapi_minor)) {
> - dev_err(&op->dev, "Cannot register suitable "
> - "HVAPI version.\n");
> + dev_err(&op->dev,
> + "Cannot register suitable HVAPI version.\n");
> goto out;
> }
> }
>
> if (np->flags & N2RNG_FLAG_MULTI) {
> if (np->hvapi_major < 2) {
> - dev_err(&op->dev, "multi-unit-capable RNG requires "
> - "HVAPI major version 2 or later, got %lu\n",
> + dev_err(&op->dev,
> + "multi-unit-capable RNG requires HVAPI major version 2 or later, got %lu\n",
> np->hvapi_major);
> goto out_hvapi_unregister;
> }
>
[toc] | [prev] | [next] | [standalone]
| From | Herbert Xu <herbert@gondor.apana.org.au> |
|---|---|
| Date | 2017-04-21 13:40 +0200 |
| Subject | Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() |
| Message-ID | <tyF4R-5fu-3@gated-at.bofh.it> |
| In reply to | #1625966 |
On Wed, Apr 19, 2017 at 11:11:35AM +0200, SF Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Wed, 19 Apr 2017 10:50:04 +0200 > > The script "checkpatch.pl" pointed information out like the following. > > WARNING: quoted string split across lines > > Thus fix the affected source code places. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> This patch doesn't seem to add any value so I'm not taking it. Please don't send patches based purely on a checkpatch complaint. Thanks, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[toc] | [prev] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2017-04-21 20:40 +0200 |
| Subject | Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() |
| Message-ID | <tyLDk-LM-33@gated-at.bofh.it> |
| In reply to | #1628161 |
On Fri, 2017-04-21 at 19:36 +0800, Herbert Xu wrote:
> On Wed, Apr 19, 2017 at 11:11:35AM +0200, SF Markus Elfring wrote:
> > From: Markus Elfring <elfring@users.sourceforge.net>
> > Date: Wed, 19 Apr 2017 10:50:04 +0200
> >
> > The script "checkpatch.pl" pointed information out like the following.
> >
> > WARNING: quoted string split across lines
> >
> > Thus fix the affected source code places.
> >
> > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
>
> This patch doesn't seem to add any value so I'm not taking it.
Your choice.
The general reason to merge strings is in CodingStyle
2) Breaking long lines and strings
[]
never break user-visible strings such as
printk messages, because that breaks the ability to grep for them.
[toc] | [prev] | [next] | [standalone]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2017-04-21 20:40 +0200 |
| Subject | Re: [PATCH 2/2] n2rng: Combine substrings for two messages in n2rng_probe() |
| Message-ID | <tyLDm-LM-69@gated-at.bofh.it> |
| In reply to | #1628161 |
From: Herbert Xu <herbert@gondor.apana.org.au> Date: Fri, 21 Apr 2017 19:36:41 +0800 > On Wed, Apr 19, 2017 at 11:11:35AM +0200, SF Markus Elfring wrote: >> From: Markus Elfring <elfring@users.sourceforge.net> >> Date: Wed, 19 Apr 2017 10:50:04 +0200 >> >> The script "checkpatch.pl" pointed information out like the following. >> >> WARNING: quoted string split across lines >> >> Thus fix the affected source code places. >> >> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> > > This patch doesn't seem to add any value so I'm not taking it. > > Please don't send patches based purely on a checkpatch complaint. Thank you Herbert.
[toc] | [prev] | [next] | [standalone]
| From | SF Markus Elfring <elfring@users.sourceforge.net> |
|---|---|
| Date | 2017-04-19 11:20 +0200 |
| Subject | [PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe() |
| Message-ID | <txTWi-1CP-21@gated-at.bofh.it> |
| In reply to | #1625959 |
From: Markus Elfring <elfring@users.sourceforge.net> Date: Wed, 19 Apr 2017 10:30:47 +0200 * A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "devm_kcalloc". * Replace the specification of a data structure by a pointer dereference to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> --- drivers/char/hw_random/n2-drv.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c index 31cbdbbaebfc..92dd4e925315 100644 --- a/drivers/char/hw_random/n2-drv.c +++ b/drivers/char/hw_random/n2-drv.c @@ -748,9 +748,7 @@ static int n2rng_probe(struct platform_device *op) dev_info(&op->dev, "Registered RNG HVAPI major %lu minor %lu\n", np->hvapi_major, np->hvapi_minor); - - np->units = devm_kzalloc(&op->dev, - sizeof(struct n2rng_unit) * np->num_units, + np->units = devm_kcalloc(&op->dev, np->num_units, sizeof(*np->units), GFP_KERNEL); err = -ENOMEM; if (!np->units) -- 2.12.2
[toc] | [prev] | [next] | [standalone]
| From | Shannon Nelson <shannon.nelson@oracle.com> |
|---|---|
| Date | 2017-04-19 17:30 +0200 |
| Subject | Re: [PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe() |
| Message-ID | <txZIp-56L-85@gated-at.bofh.it> |
| In reply to | #1625968 |
On 4/19/2017 2:10 AM, SF Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Wed, 19 Apr 2017 10:30:47 +0200 > > * A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "devm_kcalloc". > > * Replace the specification of a data structure by a pointer dereference > to make the corresponding size determination a bit safer according to > the Linux coding style convention. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Thanks Markus. Acked-by: Shannon Nelson <shannon.nelson@oracle.com> > --- > drivers/char/hw_random/n2-drv.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c > index 31cbdbbaebfc..92dd4e925315 100644 > --- a/drivers/char/hw_random/n2-drv.c > +++ b/drivers/char/hw_random/n2-drv.c > @@ -748,9 +748,7 @@ static int n2rng_probe(struct platform_device *op) > > dev_info(&op->dev, "Registered RNG HVAPI major %lu minor %lu\n", > np->hvapi_major, np->hvapi_minor); > - > - np->units = devm_kzalloc(&op->dev, > - sizeof(struct n2rng_unit) * np->num_units, > + np->units = devm_kcalloc(&op->dev, np->num_units, sizeof(*np->units), > GFP_KERNEL); > err = -ENOMEM; > if (!np->units) >
[toc] | [prev] | [next] | [standalone]
| From | Herbert Xu <herbert@gondor.apana.org.au> |
|---|---|
| Date | 2017-04-21 15:20 +0200 |
| Subject | Re: [PATCH 1/2] n2rng: Use devm_kcalloc() in n2rng_probe() |
| Message-ID | <tyGDF-6gr-35@gated-at.bofh.it> |
| In reply to | #1625968 |
On Wed, Apr 19, 2017 at 11:10:07AM +0200, SF Markus Elfring wrote: > From: Markus Elfring <elfring@users.sourceforge.net> > Date: Wed, 19 Apr 2017 10:30:47 +0200 > > * A multiplication for the size determination of a memory allocation > indicated that an array data structure should be processed. > Thus use the corresponding function "devm_kcalloc". > > * Replace the specification of a data structure by a pointer dereference > to make the corresponding size determination a bit safer according to > the Linux coding style convention. > > Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Patch applied. Thanks. -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web