From patchwork Sat Dec 20 22:35:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5523321 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 77CA49F326 for ; Sat, 20 Dec 2014 22:32:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8254A20172 for ; Sat, 20 Dec 2014 22:32:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 86E9020155 for ; Sat, 20 Dec 2014 22:32:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751818AbaLTWcc (ORCPT ); Sat, 20 Dec 2014 17:32:32 -0500 Received: from mail-wg0-f53.google.com ([74.125.82.53]:35389 "EHLO mail-wg0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751187AbaLTWcb (ORCPT ); Sat, 20 Dec 2014 17:32:31 -0500 Received: by mail-wg0-f53.google.com with SMTP id l18so3974287wgh.26 for ; Sat, 20 Dec 2014 14:32:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iznzIrhfDRj+YfMz9TKO8aq/JTU+kb8f+50dRYLkJic=; b=iM2KSFLIFEblSSqi6T27DjDfT/mgW+jLO3KPLtU518/Yqc/CJYWtRVxRKWQRQ2nt36 mD+xlp3L2Fmi3h4AIbG6NYu1tDj0sRxbuxrK5/Mc+8m7U3dKkbXwfPi6yerSuAwA8yLJ d14NI6uqtddR9AgegXm1nr0vxtuFHH6NgPOck8WMI57S/B4ED5rl3CT38yvgoXxLzCrI DC7gjkM+3YP16xPgU6HTyE98BJeM6l4pOYa86RU3nif8ZPjnVnf7C5MTSLnpdqUzWJAw VyhCpxrA2BbDLtP90Yir5EBbUbWR9OFxStI70lWeE4Hme5MpB4H+gtJnBocAThT90TKl pYwA== X-Gm-Message-State: ALoCoQnSOWnk/6V/i52GrSkIAkaRvA+cEzSdTiu4sNMv8XnZ0wOUu7Ktk1kqQP+6ow9O8fJGQlY2 X-Received: by 10.194.121.167 with SMTP id ll7mr26710888wjb.26.1419114750136; Sat, 20 Dec 2014 14:32:30 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id jp3sm7356465wid.9.2014.12.20.14.32.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Dec 2014 14:32:29 -0800 (PST) From: Rickard Strandqvist To: Andy Walls , Mauro Carvalho Chehab Cc: Rickard Strandqvist , ivtv-devel@ivtvdriver.org, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] media: pci: cx18: cx18-alsa-mixer.c: Remove some unused functions Date: Sat, 20 Dec 2014 23:35:17 +0100 Message-Id: <1419114917-12029-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Removes some functions that are not used anywhere: snd_cx18_mixer_tv_vol_get() snd_cx18_mixer_tv_vol_info() snd_cx18_mixer_tv_vol_put() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- drivers/media/pci/cx18/cx18-alsa-mixer.c | 62 ------------------------------ 1 file changed, 62 deletions(-) diff --git a/drivers/media/pci/cx18/cx18-alsa-mixer.c b/drivers/media/pci/cx18/cx18-alsa-mixer.c index 341bddc..e7b0a1f 100644 --- a/drivers/media/pci/cx18/cx18-alsa-mixer.c +++ b/drivers/media/pci/cx18/cx18-alsa-mixer.c @@ -69,68 +69,6 @@ static inline int cx18_av_vol_to_dB(int v) return (v >> 9) - 119; } -static int snd_cx18_mixer_tv_vol_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER; - uinfo->count = 1; - /* We're already translating values, just keep this control in dB */ - uinfo->value.integer.min = -96; - uinfo->value.integer.max = 8; - uinfo->value.integer.step = 1; - return 0; -} - -static int snd_cx18_mixer_tv_vol_get(struct snd_kcontrol *kctl, - struct snd_ctl_elem_value *uctl) -{ - struct snd_cx18_card *cxsc = snd_kcontrol_chip(kctl); - struct cx18 *cx = to_cx18(cxsc->v4l2_dev); - struct v4l2_control vctrl; - int ret; - - vctrl.id = V4L2_CID_AUDIO_VOLUME; - vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); - - snd_cx18_lock(cxsc); - ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl); - snd_cx18_unlock(cxsc); - - if (!ret) - uctl->value.integer.value[0] = cx18_av_vol_to_dB(vctrl.value); - return ret; -} - -static int snd_cx18_mixer_tv_vol_put(struct snd_kcontrol *kctl, - struct snd_ctl_elem_value *uctl) -{ - struct snd_cx18_card *cxsc = snd_kcontrol_chip(kctl); - struct cx18 *cx = to_cx18(cxsc->v4l2_dev); - struct v4l2_control vctrl; - int ret; - - vctrl.id = V4L2_CID_AUDIO_VOLUME; - vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); - - snd_cx18_lock(cxsc); - - /* Fetch current state */ - ret = v4l2_subdev_call(cx->sd_av, core, g_ctrl, &vctrl); - - if (ret || - (cx18_av_vol_to_dB(vctrl.value) != uctl->value.integer.value[0])) { - - /* Set, if needed */ - vctrl.value = dB_to_cx18_av_vol(uctl->value.integer.value[0]); - ret = v4l2_subdev_call(cx->sd_av, core, s_ctrl, &vctrl); - if (!ret) - ret = 1; /* Indicate control was changed w/o error */ - } - snd_cx18_unlock(cxsc); - - return ret; -} - /* This is a bit of overkill, the slider is already in dB internally */ static DECLARE_TLV_DB_SCALE(snd_cx18_mixer_tv_vol_db_scale, -9600, 100, 0);