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


Groups > linux.kernel > #1735168 > unrolled thread

[PATCH 0/3] [media] HD PVR USB: Adjustments for two function implementations

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2017-09-19 20:50 +0200
Last post2017-09-19 20:50 +0200
Articles 2 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/3] [media] HD PVR USB: Adjustments for two function  implementations SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-19 20:50 +0200
    [PATCH 3/3] [media] hdpvr: Return an error code only as a constant in  hdpvr_alloc_buffers() SF Markus Elfring <elfring@users.sourceforge.net> - 2017-09-19 20:50 +0200

#1735168 — [PATCH 0/3] [media] HD PVR USB: Adjustments for two function implementations

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-19 20:50 +0200
Subject[PATCH 0/3] [media] HD PVR USB: Adjustments for two function implementations
Message-ID<urvKO-xs-13@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 19 Sep 2017 20:21:23 +0200

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

Markus Elfring (3):
  Delete three error messages for a failed memory allocation
  Improve a size determination in hdpvr_alloc_buffers()
  Return an error code only as a constant in hdpvr_alloc_buffers()

 drivers/media/usb/hdpvr/hdpvr-core.c  |  8 ++------
 drivers/media/usb/hdpvr/hdpvr-video.c | 11 ++++-------
 2 files changed, 6 insertions(+), 13 deletions(-)

-- 
2.14.1

[toc] | [next] | [standalone]


#1735170 — [PATCH 3/3] [media] hdpvr: Return an error code only as a constant in hdpvr_alloc_buffers()

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2017-09-19 20:50 +0200
Subject[PATCH 3/3] [media] hdpvr: Return an error code only as a constant in hdpvr_alloc_buffers()
Message-ID<urvKP-xs-47@gated-at.bofh.it>
In reply to#1735168
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 19 Sep 2017 19:32:36 +0200

* Return an error code without storing it in an intermediate variable.

* Delete the local variable "retval" which became unnecessary
  with this refactoring.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/media/usb/hdpvr/hdpvr-video.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/media/usb/hdpvr/hdpvr-video.c b/drivers/media/usb/hdpvr/hdpvr-video.c
index f06efcd70c14..2b39834309d2 100644
--- a/drivers/media/usb/hdpvr/hdpvr-video.c
+++ b/drivers/media/usb/hdpvr/hdpvr-video.c
@@ -136,6 +136,5 @@ int hdpvr_free_buffers(struct hdpvr_device *dev)
 int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
 {
 	uint i;
-	int retval = -ENOMEM;
 	u8 *mem;
 	struct hdpvr_buffer *buf;
@@ -181,6 +180,6 @@ int hdpvr_alloc_buffers(struct hdpvr_device *dev, uint count)
 	kfree(buf);
 exit:
 	hdpvr_free_buffers(dev);
-	return retval;
+	return -ENOMEM;
 }
 
-- 
2.14.1

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web