Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1641423 > unrolled thread

[PATCH 2/2] ipack: Improve a size determination in ipack_bus_register()

Started bySamuel Iglesias Gonsálvez <siglesias@igalia.com>
First post2017-05-15 11:10 +0200
Last post2017-05-15 11:10 +0200
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 2/2] ipack: Improve a size determination in ipack_bus_register() Samuel Iglesias Gonsálvez          <siglesias@igalia.com> - 2017-05-15 11:10 +0200

#1641423 — [PATCH 2/2] ipack: Improve a size determination in ipack_bus_register()

FromSamuel Iglesias Gonsálvez <siglesias@igalia.com>
Date2017-05-15 11:10 +0200
Subject[PATCH 2/2] ipack: Improve a size determination in ipack_bus_register()
Message-ID<tHkaT-67d-43@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>

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.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Acked-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
---
 drivers/ipack/ipack.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ipack/ipack.c b/drivers/ipack/ipack.c
index 575c4f29e0f7..a1e07a77d4e6 100644
--- a/drivers/ipack/ipack.c
+++ b/drivers/ipack/ipack.c
@@ -212,7 +212,7 @@ struct ipack_bus_device *ipack_bus_register(struct device *parent, int slots,
 	int bus_nr;
 	struct ipack_bus_device *bus;
 
-	bus = kzalloc(sizeof(struct ipack_bus_device), GFP_KERNEL);
+	bus = kzalloc(sizeof(*bus), GFP_KERNEL);
 	if (!bus)
 		return NULL;
 
-- 
2.11.0

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web