mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] [media] dvb_usb_core: Adjustments for two function implementations
@ 2017-09-18  8:12 SF Markus Elfring
  2017-09-18  8:13 ` [PATCH 1/2] [media] dvb_usb_core: Delete two error messages for a failed memory allocation in dvb_usbv2_probe() SF Markus Elfring
  2017-09-18  8:14 ` [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions SF Markus Elfring
  0 siblings, 2 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-18  8:12 UTC (permalink / raw)
  To: linux-media, Antti Palosaari, Mauro Carvalho Chehab; +Cc: LKML, kernel-janitors

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

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

Markus Elfring (2):
  Delete two error messages for a failed memory allocation in dvb_usbv2_probe()
  Improve a size determination in two functions

 drivers/media/usb/dvb-usb-v2/dvb_usb_core.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

-- 
2.14.1

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

* [PATCH 1/2] [media] dvb_usb_core: Delete two error messages for a failed memory allocation in dvb_usbv2_probe()
  2017-09-18  8:12 [PATCH 0/2] [media] dvb_usb_core: Adjustments for two function implementations SF Markus Elfring
@ 2017-09-18  8:13 ` SF Markus Elfring
  2017-09-18  8:14 ` [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-18  8:13 UTC (permalink / raw)
  To: linux-media, Antti Palosaari, Mauro Carvalho Chehab; +Cc: LKML, kernel-janitors

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

Omit extra messages 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/media/usb/dvb-usb-v2/dvb_usb_core.c | 3 ---
 1 file changed, 3 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 096bb75a24e5..d0fbf0b0b1cb 100644
--- a/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
+++ b/drivers/media/usb/dvb-usb-v2/dvb_usb_core.c
@@ -923,5 +923,4 @@ int dvb_usbv2_probe(struct usb_interface *intf,
 	if (!d) {
-		dev_err(&udev->dev, "%s: kzalloc() failed\n", KBUILD_MODNAME);
 		ret = -ENOMEM;
 		goto err;
 	}
@@ -946,6 +945,4 @@ int dvb_usbv2_probe(struct usb_interface *intf,
 		if (!d->priv) {
-			dev_err(&d->udev->dev, "%s: kzalloc() failed\n",
-					KBUILD_MODNAME);
 			ret = -ENOMEM;
 			goto err_free_all;
 		}
-- 
2.14.1

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

* [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions
  2017-09-18  8:12 [PATCH 0/2] [media] dvb_usb_core: Adjustments for two function implementations SF Markus Elfring
  2017-09-18  8:13 ` [PATCH 1/2] [media] dvb_usb_core: Delete two error messages for a failed memory allocation in dvb_usbv2_probe() SF Markus Elfring
@ 2017-09-18  8:14 ` SF Markus Elfring
  1 sibling, 0 replies; 3+ messages in thread
From: SF Markus Elfring @ 2017-09-18  8:14 UTC (permalink / raw)
  To: linux-media, Antti Palosaari, Mauro Carvalho Chehab; +Cc: LKML, kernel-janitors

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

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

end of thread, other threads:[~2017-09-18  8:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-18  8:12 [PATCH 0/2] [media] dvb_usb_core: Adjustments for two function implementations SF Markus Elfring
2017-09-18  8:13 ` [PATCH 1/2] [media] dvb_usb_core: Delete two error messages for a failed memory allocation in dvb_usbv2_probe() SF Markus Elfring
2017-09-18  8:14 ` [PATCH 2/2] [media] dvb_usb_core: Improve a size determination in two functions 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

Powered by JetHome