From patchwork Mon Sep 17 08:04:57 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Senna Tschudin X-Patchwork-Id: 1465911 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id CA69EDFFFF for ; Mon, 17 Sep 2012 08:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754773Ab2IQIFQ (ORCPT ); Mon, 17 Sep 2012 04:05:16 -0400 Received: from mail-wi0-f172.google.com ([209.85.212.172]:62259 "EHLO mail-wi0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754515Ab2IQIFN (ORCPT ); Mon, 17 Sep 2012 04:05:13 -0400 Received: by wibhi8 with SMTP id hi8so2244689wib.1 for ; Mon, 17 Sep 2012 01:05:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=COcfca9YR82P5k8Y7lJb01+LmKN8M76Bv507GKA0oQY=; b=r+acRebz7dHRHhET6sWWgkvqwzDYiFR2S9Zx2GDzZKpMYooP11++QS6Jk2l9rl7H2G EFios6m9QXRFCBmai76KWf8TUw3zxPeQs48YRd4/srQcd0i/tN10lSh2oCmtalbl3yIL nz8SL+KF9foCzsJJ0JscygVPQx5r0/vzt5bwntTxJOX6UmbkaSexm1A/rIwnMRj8VUHt gsb4uplviQeD4eMX1tQpRXPGxPyJmpVG+gEe9oB0be4HQCIW3bO3HUD+XDIzIJ2CYJgw t8zh4B/t9Jfk3+0D870NmJQuekSkaDz/tlXiZCEd9+wYKic7b8G9nBoVfrsm8jZc4Y95 d1fg== Received: by 10.216.207.73 with SMTP id m51mr1145894weo.116.1347869112265; Mon, 17 Sep 2012 01:05:12 -0700 (PDT) Received: from ace.home.fr (ppeter.rsr.lip6.fr. [132.227.76.16]) by mx.google.com with ESMTPS id o2sm24216119wiz.11.2012.09.17.01.05.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 17 Sep 2012 01:05:11 -0700 (PDT) From: Peter Senna Tschudin 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 Message-Id: <1347869098-2236-2-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1347869098-2236-1-git-send-email-peter.senna@gmail.com> References: <1347869098-2236-1-git-send-email-peter.senna@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Replace kmemdup for kstrdup and cleanup related code. Signed-off-by: Peter Senna Tschudin --- 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;