From: SF Markus Elfring <elfring@users.sourceforge.net>
To: linux-media@vger.kernel.org,
Andrew Morton <akpm@linux-foundation.org>,
Arvind Yadav <arvind.yadav.cs@gmail.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Jonathan Sims <jonathan.625266@earthlink.net>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Masahiro Yamada <yamada.masahiro@socionext.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH 3/3] [media] hdpvr: Return an error code only as a constant in hdpvr_alloc_buffers()
Date: Tue, 19 Sep 2017 20:47:39 +0200 [thread overview]
Message-ID: <0be95f0b-cc0e-27cc-5ec1-b5bc1bc48496@users.sourceforge.net> (raw)
In-Reply-To: <82d14066-5816-111c-9d21-f6a439e559c1@users.sourceforge.net>
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
prev parent reply other threads:[~2017-09-19 18:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 18:44 [PATCH 0/3] [media] HD PVR USB: Adjustments for two function implementations SF Markus Elfring
2017-09-19 18:45 ` [PATCH 1/3] [media] hdpvr: Delete three error messages for a failed memory allocation SF Markus Elfring
2017-09-19 18:46 ` [PATCH 2/3] [media] hdpvr: Improve a size determination in hdpvr_alloc_buffers() SF Markus Elfring
2017-09-19 18:47 ` SF Markus Elfring [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0be95f0b-cc0e-27cc-5ec1-b5bc1bc48496@users.sourceforge.net \
--to=elfring@users.sourceforge.net \
--cc=akpm@linux-foundation.org \
--cc=arvind.yadav.cs@gmail.com \
--cc=hverkuil@xs4all.nl \
--cc=jonathan.625266@earthlink.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=yamada.masahiro@socionext.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).