From patchwork Mon Sep 10 12:45:54 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: 1432081 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1DA974025E for ; Mon, 10 Sep 2012 12:46:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757826Ab2IJMqK (ORCPT ); Mon, 10 Sep 2012 08:46:10 -0400 Received: from mail-we0-f174.google.com ([74.125.82.174]:39488 "EHLO mail-we0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757690Ab2IJMqI (ORCPT ); Mon, 10 Sep 2012 08:46:08 -0400 Received: by weyx8 with SMTP id x8so1246114wey.19 for ; Mon, 10 Sep 2012 05:46:05 -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; bh=zPlVnhTFp6CeejMwnhCklpGZJ8qMjJFdLxwuUGRX3uM=; b=svyMBRrGluXiBwrj2M3+bhCSrBTI2z5qqpHiUD8PcI6M/nW9NZBVpthAVyifiEzlWG D7b2+XNDfnVb4G27RW4RntPDABO8o3+VHqMGXgBUnoATyNS9DBhRNJjbTjycawml6R5z uGiV2RLQqv4aXA1tyT+Wn19tIocfDrd9ZTKk7CHh/VwPQnqY9hZXp8cQnUR+VfeRlSDR ZX8s6OW4SVffZagXcD5RuoxrGkeezDpItZEO5WStM2nHyecwOZoQZziUKQxOyx1nYtfC 9ghmleTlQ0Btn5/7XM931vhaAQc53IM5G3TyrDz1miDnx/uE52rG++mMndMFCUEhjarM zoKQ== Received: by 10.180.97.135 with SMTP id ea7mr17011827wib.11.1347281165702; Mon, 10 Sep 2012 05:46:05 -0700 (PDT) Received: from localhost.localdomain ([132.227.100.38]) by mx.google.com with ESMTPS id l6sm17032349wiz.4.2012.09.10.05.46.04 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 10 Sep 2012 05:46:05 -0700 (PDT) From: Peter Senna Tschudin To: Mauro Carvalho Chehab Cc: kernel-janitors@vger.kernel.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c: Replace kmemdup for kstrdup Date: Mon, 10 Sep 2012 14:45:54 +0200 Message-Id: <1347281154-29515-1-git-send-email-peter.senna@gmail.com> X-Mailer: git-send-email 1.7.11.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org From: Peter Senna Tschudin Replace kmemdup for kstrdup and cleaning up the code. Signed-off-by: Peter Senna Tschudin --- It depends on the patch http://patchwork.linuxtv.org/patch/14231/ tmp/cx25821-video-upstream-ch2.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c b/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c index 273df94..b663dac 100644 --- a/drivers/media/pci/cx25821/cx25821-video-upstream-ch2.c +++ b/tmp/cx25821-video-upstream-ch2.c @@ -707,7 +707,6 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, int err = 0; int data_frame_size = 0; int risc_buffer_size = 0; - int str_length = 0; if (dev->_is_running_ch2) { pr_info("Video Channel is still running so return!\n"); @@ -743,24 +742,16 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select, risc_buffer_size = dev->_isNTSC_ch2 ? NTSC_RISC_BUF_SIZE : PAL_RISC_BUF_SIZE; - if (dev->input_filename_ch2) { - str_length = strlen(dev->input_filename_ch2); - dev->_filename_ch2 = kmemdup(dev->input_filename_ch2, - str_length + 1, GFP_KERNEL); - - if (!dev->_filename_ch2) { - err = -ENOENT; - goto error; - } - } else { - str_length = strlen(dev->_defaultname_ch2); - dev->_filename_ch2 = kmemdup(dev->_defaultname_ch2, - str_length + 1, GFP_KERNEL); + if (dev->input_filename_ch2) + dev->_filename_ch2 = kstrdup(dev->input_filename_ch2, + GFP_KERNEL); + else + dev->_filename_ch2 = kstrdup(dev->_defaultname_ch2, + GFP_KERNEL); - if (!dev->_filename_ch2) { - err = -ENOENT; - goto error; - } + if (!dev->_filename_ch2) { + err = -ENOENT; + goto error; } /* Default if filename is empty string */