From: SF Markus Elfring <hidden> Date: 2017-08-27 19:25:40
From: Markus Elfring <redacted>
Date: Sun, 27 Aug 2017 21:18:37 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>
---
drivers/connector/cn_queue.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
From: Waskiewicz Jr, Peter <hidden> Date: 2017-08-27 23:16:09
On 8/27/17 3:26 PM, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Sun, 27 Aug 2017 21:18:37 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Did coccinelle trip on the message or the fact you weren't returning NULL?
From: Dan Carpenter <hidden> Date: 2017-08-28 06:06:19
On Sun, Aug 27, 2017 at 11:16:06PM +0000, Waskiewicz Jr, Peter wrote:
On 8/27/17 3:26 PM, SF Markus Elfring wrote:
quoted
From: Markus Elfring <redacted>
Date: Sun, 27 Aug 2017 21:18:37 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Did coccinelle trip on the message or the fact you weren't returning NULL?
You've misread the patch somehow. The existing code has a NULL return
and it's preserved in Markus's patch. This sort of patch is to fix a
checkpatch.pl warning. The error message from this kzalloc() isn't going
to get printed because it's a small allocation and small allocations
always succeed in current kernels. But probably the main reason
checkpatch complains is that kmalloc() already prints a stack trace and
a bunch of other information so the printk doesn't add anyting.
Removing it saves a little memory.
I'm mostly a fan of running checkpatch on new patches or staging and not
on old code...
regards,
dan carpenter
From: SF Markus Elfring <hidden> Date: 2017-08-28 07:09:38
Did coccinelle trip on the message
I suggest to reconsider this implementation detail with the combination
of a function call like “kzalloc”.
A script for the semantic patch language can point various update candidates
out according to a source code search pattern which is similar to “OOM_MESSAGE”
in the script “checkpatch.pl”.
or the fact you weren't returning NULL?
How does this concern fit to my update suggestion?
Regards,
Markus
From: Waskiewicz Jr, Peter <hidden> Date: 2017-08-28 14:05:18
On 8/28/17 2:06 AM, Dan Carpenter wrote:
On Sun, Aug 27, 2017 at 11:16:06PM +0000, Waskiewicz Jr, Peter wrote:
quoted
On 8/27/17 3:26 PM, SF Markus Elfring wrote:
quoted
From: Markus Elfring <redacted>
Date: Sun, 27 Aug 2017 21:18:37 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Did coccinelle trip on the message or the fact you weren't returning NULL?
You've misread the patch somehow. The existing code has a NULL return
and it's preserved in Markus's patch. This sort of patch is to fix a
checkpatch.pl warning. The error message from this kzalloc() isn't going
to get printed because it's a small allocation and small allocations
always succeed in current kernels. But probably the main reason
checkpatch complains is that kmalloc() already prints a stack trace and
a bunch of other information so the printk doesn't add anyting.
Removing it saves a little memory.
I'm mostly a fan of running checkpatch on new patches or staging and not
on old code...
And this is what I get for reading the patch with a crappy
mailer...thanks Doubtlook.
Sorry for the noise.
Hi everyone
27.08.2017, 22:25, "SF Markus Elfring" [off-list ref]:
From: Markus Elfring <redacted>
Date: Sun, 27 Aug 2017 21:18:37 +0200
Omit an extra message for a memory allocation failure in this function.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <redacted>
Looks good to me, thanks Markus.
There is virtually zero useful information in this print if we are in the situation, when kernel can not allocate
a few bytes to run connector queue.
Acked-by: Evgeniy Polyakov <redacted>
kernel-janitors@ please queue this patch up