[PATCH 2/2] [media] c8sectpfe: Improve two size determinations in c8sectpfe_frontend_attach()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 15 Sep 2017 17:30:38 +0200

Replace the specification of data structures by pointer dereferences
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@xxxxxxxxxxxxxxxxxxxxx>
---
 drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
index 1b23b188cd65..c3b09a9e30ec 100644
--- a/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
+++ b/drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
@@ -164,12 +164,10 @@ int c8sectpfe_frontend_attach(struct dvb_frontend **fe,
 		tda18212 = devm_kzalloc(c8sectpfe->device,
-					sizeof(struct tda18212_config),
+					sizeof(*tda18212),
 					GFP_KERNEL);
 		if (!tda18212)
 			return -ENOMEM;
 
-		memcpy(tda18212, &tda18212_conf,
-			sizeof(struct tda18212_config));
-
+		memcpy(tda18212, &tda18212_conf, sizeof(*tda18212));
 		tda18212->fe = (*fe);
 
 		tda18212_info.platform_data = tda18212;
-- 
2.14.1

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux