netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] atm: Adjustments for adummy_init()
@ 2017-10-01 19:48 SF Markus Elfring
  2017-10-01 19:49 ` [PATCH 1/2] atm: Delete an error message for a failed memory allocation in adummy_init() SF Markus Elfring
  2017-10-01 19:50 ` [PATCH 2/2] atm: Improve a size determination " SF Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-10-01 19:48 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 1 Oct 2017 21:43:21 +0200

Two update suggestions were taken into account
from static source code analysis.

Markus Elfring (2):
  Delete an error message for a failed memory allocation
  Improve a size determination

 drivers/atm/adummy.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

-- 
2.14.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/2] atm: Delete an error message for a failed memory allocation in adummy_init()
  2017-10-01 19:48 [PATCH 0/2] atm: Adjustments for adummy_init() SF Markus Elfring
@ 2017-10-01 19:49 ` SF Markus Elfring
  2017-10-01 19:50 ` [PATCH 2/2] atm: Improve a size determination " SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-10-01 19:49 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 1 Oct 2017 21:31:32 +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 <elfring@users.sourceforge.net>
---
 drivers/atm/adummy.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index 8d98130ecd40..94b73ddfb731 100644
--- a/drivers/atm/adummy.c
+++ b/drivers/atm/adummy.c
@@ -150,7 +150,6 @@ static int __init adummy_init(void)
 	adummy_dev = kzalloc(sizeof(struct adummy_dev),
 						   GFP_KERNEL);
 	if (!adummy_dev) {
-		printk(KERN_ERR DEV_LABEL ": kzalloc() failed\n");
 		err = -ENOMEM;
 		goto out;
 	}
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] atm: Improve a size determination in adummy_init()
  2017-10-01 19:48 [PATCH 0/2] atm: Adjustments for adummy_init() SF Markus Elfring
  2017-10-01 19:49 ` [PATCH 1/2] atm: Delete an error message for a failed memory allocation in adummy_init() SF Markus Elfring
@ 2017-10-01 19:50 ` SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-10-01 19:50 UTC (permalink / raw)
  To: linux-atm-general, netdev, Chas Williams; +Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 1 Oct 2017 21:35:18 +0200

Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/atm/adummy.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/atm/adummy.c b/drivers/atm/adummy.c
index 94b73ddfb731..1ef2d8ee8d67 100644
--- a/drivers/atm/adummy.c
+++ b/drivers/atm/adummy.c
@@ -146,9 +146,7 @@ static int __init adummy_init(void)
 	int err = 0;
 
 	printk(KERN_ERR "adummy: version %s\n", DRV_VERSION);
-
-	adummy_dev = kzalloc(sizeof(struct adummy_dev),
-						   GFP_KERNEL);
+	adummy_dev = kzalloc(sizeof(*adummy_dev), GFP_KERNEL);
 	if (!adummy_dev) {
 		err = -ENOMEM;
 		goto out;
-- 
2.14.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-10-01 19:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-01 19:48 [PATCH 0/2] atm: Adjustments for adummy_init() SF Markus Elfring
2017-10-01 19:49 ` [PATCH 1/2] atm: Delete an error message for a failed memory allocation in adummy_init() SF Markus Elfring
2017-10-01 19:50 ` [PATCH 2/2] atm: Improve a size determination " SF Markus Elfring

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).