mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [media] drxd: use kzalloc in drxd_attach()
@ 2015-10-01 20:25 Rasmus Villemoes
  0 siblings, 0 replies; only message in thread
From: Rasmus Villemoes @ 2015-10-01 20:25 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Rasmus Villemoes, linux-media, linux-kernel

This saves a little .text and removes the sizeof(...) style
inconsistency. Use sizeof(*state) in accordance with CodingStyle.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/media/dvb-frontends/drxd_hard.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/dvb-frontends/drxd_hard.c b/drivers/media/dvb-frontends/drxd_hard.c
index 34b9441840da..445a15c2714f 100644
--- a/drivers/media/dvb-frontends/drxd_hard.c
+++ b/drivers/media/dvb-frontends/drxd_hard.c
@@ -2950,10 +2950,9 @@ struct dvb_frontend *drxd_attach(const struct drxd_config *config,
 {
 	struct drxd_state *state = NULL;
 
-	state = kmalloc(sizeof(struct drxd_state), GFP_KERNEL);
+	state = kzalloc(sizeof(*state), GFP_KERNEL);
 	if (!state)
 		return NULL;
-	memset(state, 0, sizeof(*state));
 
 	state->ops = drxd_ops;
 	state->dev = dev;
-- 
2.1.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-01 20:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-01 20:25 [PATCH] [media] drxd: use kzalloc in drxd_attach() Rasmus Villemoes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®