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


Groups > linux.kernel > #1733738

[PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions

From SF Markus Elfring <elfring@users.sourceforge.net>
Newsgroups linux.kernel
Subject [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions
Date 2017-09-18 10:20 +0200
Message-ID <uqZrB-3BU-29@gated-at.bofh.it> (permalink)
References <uqZrA-3BU-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Markus Elfring <elfring@users.sourceforge.net>
Date: Mon, 18 Sep 2017 09:36:33 +0200

Replace the specification of data structures by variable references
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>
---
 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
index d0fbf0b0b1cb..f0b225ee4515 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -279,5 +279,5 @@ static int dvb_usb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
 	if (d->props->get_stream_config) {
 		memcpy(&stream_props, &adap->props->stream,
-				sizeof(struct usb_data_stream_properties));
+		       sizeof(stream_props));
 		ret = d->props->get_stream_config(adap->fe[adap->active_fe],
 				&adap->ts_type, &stream_props);
@@ -919,5 +919,5 @@ int dvb_usbv2_probe(struct usb_interface *intf,
 		goto err;
 	}
 
-	d = kzalloc(sizeof(struct dvb_usb_device), GFP_KERNEL);
+	d = kzalloc(sizeof(*d), GFP_KERNEL);
 	if (!d) {
-- 
2.14.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 0/2] [media] dvb_usb_core: Adjustments for two function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-18 10:20 +0200
  [PATCH 1/2] [media] dvb_usb_core: Delete two error messages for a  failed memory allocation in dvb_usbv2_probe() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-18 10:20 +0200
  [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two  functions SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-18 10:20 +0200

csiph-web