From: Peter Senna Tschudin <peter.senna@gmail.com>
To: mchehab@infradead.org
Cc: leonidsbox@gmail.com, peter.senna@gmail.com, thomas@m3y3r.de,
hans.verkuil@cisco.com, linux-media@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] cx25821: Replace kmemdup for kstrdup and clean up
Date: Mon, 17 Sep 2012 10:04:57 +0200 [thread overview]
Message-ID: <1347869098-2236-2-git-send-email-peter.senna@gmail.com> (raw)
In-Reply-To: <1347869098-2236-1-git-send-email-peter.senna@gmail.com>
Replace kmemdup for kstrdup and cleanup related code.
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
---
drivers/media/pci/cx25821/cx25821-audio-upstream.c | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/media/pci/cx25821/cx25821-audio-upstream.c b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
index 49a28ae..1cc797e 100644
--- a/drivers/media/pci/cx25821/cx25821-audio-upstream.c
+++ b/drivers/media/pci/cx25821/cx25821-audio-upstream.c
@@ -701,7 +701,6 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
{
struct sram_channel *sram_ch;
int err = 0;
- int str_length = 0;
if (dev->_audio_is_running) {
pr_warn("Audio Channel is still running so return!\n");
@@ -730,9 +729,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
_line_size = AUDIO_LINE_SIZE;
if (dev->input_audiofilename) {
- str_length = strlen(dev->input_audiofilename);
- dev->_audiofilename = kmemdup(dev->input_audiofilename,
- str_length + 1, GFP_KERNEL);
+ dev->_audiofilename = kstrdup(dev->input_audiofilename,
+ GFP_KERNEL);
if (!dev->_audiofilename) {
err = -ENOMEM;
@@ -743,9 +741,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
if (strcmp(dev->input_audiofilename, "") == 0)
dev->_audiofilename = "/root/audioGOOD.wav";
} else {
- str_length = strlen(_defaultAudioName);
- dev->_audiofilename = kmemdup(_defaultAudioName,
- str_length + 1, GFP_KERNEL);
+ dev->_audiofilename = kstrdup(_defaultAudioName,
+ GFP_KERNEL);
if (!dev->_audiofilename) {
err = -ENOMEM;
--
1.7.11.4
next prev parent reply other threads:[~2012-09-17 8:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-17 8:04 [PATCH 1/3] cx25821: fix error return code and clean up Peter Senna Tschudin
2012-09-17 8:04 ` Peter Senna Tschudin [this message]
2012-09-17 8:04 ` [PATCH 3/3] cx25821: Cleanup filename assignment code Peter Senna Tschudin
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=1347869098-2236-2-git-send-email-peter.senna@gmail.com \
--to=peter.senna@gmail.com \
--cc=hans.verkuil@cisco.com \
--cc=leonidsbox@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=thomas@m3y3r.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.