From patchwork Sun Jan 11 15:43:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5606401 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 590209F357 for ; Sun, 11 Jan 2015 15:40:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5E4E82063D for ; Sun, 11 Jan 2015 15:40:15 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1F4962051D for ; Sun, 11 Jan 2015 15:40:14 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id EC3A9260431; Sun, 11 Jan 2015 16:40:12 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id C886B2603A5; Sun, 11 Jan 2015 16:40:05 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id E085926040D; Sun, 11 Jan 2015 16:40:03 +0100 (CET) Received: from mail-wg0-f46.google.com (mail-wg0-f46.google.com [74.125.82.46]) by alsa0.perex.cz (Postfix) with ESMTP id C2FFF260320 for ; Sun, 11 Jan 2015 16:39:56 +0100 (CET) Received: by mail-wg0-f46.google.com with SMTP id x13so15488212wgg.5 for ; Sun, 11 Jan 2015 07:39:56 -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=bPuaN2orJPe/0eh1ohgs42a8SlCtJi1bJ82Z59cKTCU=; b=XIZWbhGRyZaocSWmON6KBgro/J8xPIymiV6SVpGSjGCLigXjIFoebAS0yeoyaLL4l0 SWccm9XxBZsVXOja/GvFpRuV8SE4qfcUdDTSKxoFocKoH1YAk0z5QGhxbo9uRRiP2lHu 1AunvDv1tBReFqItpP8b1teZjCbLvHCcUKP9C/QOggcVC6WeDsGkJBJaXh/Syo9NdVyx bBlUVTRiafnt0hIBf+I4gOlRm0KYW93QWJAzpH1jEUBb8hhio+70x4HJ6DOGFA/Hml2B qiVIOKpWoLoAw0XgNwOJDlMHVx1mJ9UXOh58O/w+r9j+ilkvOQ70uzL3g8u3PCDWzc/0 22qQ== X-Gm-Message-State: ALoCoQmucHsGOJ1zxlh/PAe/hfXxGYXs0gr/724GvYIVl3AE6klFdxwr99nuTKZpwzYb5pc7QGoG X-Received: by 10.194.200.1 with SMTP id jo1mr11515262wjc.64.1420990796548; Sun, 11 Jan 2015 07:39:56 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id ep9sm6582130wid.3.2015.01.11.07.39.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Jan 2015 07:39:55 -0800 (PST) From: Rickard Strandqvist To: Jaroslav Kysela , Takashi Iwai Date: Sun, 11 Jan 2015 16:43:02 +0100 Message-Id: <1420990982-20187-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 Cc: alsa-devel@alsa-project.org, Rickard Strandqvist , linux-kernel@vger.kernel.org, Josh Triplett , Rashika Kheria , Maxime Ripard Subject: [alsa-devel] [PATCH] ALSA: lx6464es: lx_core: Remove some unused functions X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Removes some functions that are not used anywhere: lx_buffer_cancel() lx_buffer_free() lx_stream_sample_position() lx_stream_state() lx_pipe_sample_count() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- sound/pci/lx6464es/lx_core.c | 107 ------------------------------------------ sound/pci/lx6464es/lx_core.h | 10 ---- 2 files changed, 117 deletions(-) diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c index f3d6202..5621cd7 100644 --- a/sound/pci/lx6464es/lx_core.c +++ b/sound/pci/lx6464es/lx_core.c @@ -582,33 +582,6 @@ int lx_pipe_pause(struct lx6464es *chip, u32 pipe, int is_capture) } -int lx_pipe_sample_count(struct lx6464es *chip, u32 pipe, int is_capture, - u64 *rsample_count) -{ - int err; - u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); - - mutex_lock(&chip->msg_lock); - lx_message_init(&chip->rmh, CMD_0A_GET_PIPE_SPL_COUNT); - - chip->rmh.cmd[0] |= pipe_cmd; - chip->rmh.stat_len = 2; /* need all words here! */ - - err = lx_message_send_atomic(chip, &chip->rmh); /* don't sleep! */ - - if (err != 0) - dev_err(chip->card->dev, - "could not query pipe's sample count\n"); - else { - *rsample_count = ((u64)(chip->rmh.stat[0] & MASK_SPL_COUNT_HI) - << 24) /* hi part */ - + chip->rmh.stat[1]; /* lo part */ - } - - mutex_unlock(&chip->msg_lock); - return err; -} - int lx_pipe_state(struct lx6464es *chip, u32 pipe, int is_capture, u16 *rstate) { int err; @@ -714,46 +687,6 @@ int lx_stream_set_format(struct lx6464es *chip, struct snd_pcm_runtime *runtime, return err; } -int lx_stream_state(struct lx6464es *chip, u32 pipe, int is_capture, - int *rstate) -{ - int err; - u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); - - mutex_lock(&chip->msg_lock); - lx_message_init(&chip->rmh, CMD_0E_GET_STREAM_SPL_COUNT); - - chip->rmh.cmd[0] |= pipe_cmd; - - err = lx_message_send_atomic(chip, &chip->rmh); - - *rstate = (chip->rmh.stat[0] & SF_START) ? START_STATE : PAUSE_STATE; - - mutex_unlock(&chip->msg_lock); - return err; -} - -int lx_stream_sample_position(struct lx6464es *chip, u32 pipe, int is_capture, - u64 *r_bytepos) -{ - int err; - u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); - - mutex_lock(&chip->msg_lock); - lx_message_init(&chip->rmh, CMD_0E_GET_STREAM_SPL_COUNT); - - chip->rmh.cmd[0] |= pipe_cmd; - - err = lx_message_send_atomic(chip, &chip->rmh); - - *r_bytepos = ((u64) (chip->rmh.stat[0] & MASK_SPL_COUNT_HI) - << 32) /* hi part */ - + chip->rmh.stat[1]; /* lo part */ - - mutex_unlock(&chip->msg_lock); - return err; -} - /* low-level buffer handling */ int lx_buffer_give(struct lx6464es *chip, u32 pipe, int is_capture, u32 buffer_size, u32 buf_address_lo, u32 buf_address_hi, @@ -803,46 +736,6 @@ int lx_buffer_give(struct lx6464es *chip, u32 pipe, int is_capture, return err; } -int lx_buffer_free(struct lx6464es *chip, u32 pipe, int is_capture, - u32 *r_buffer_size) -{ - int err; - u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); - - mutex_lock(&chip->msg_lock); - lx_message_init(&chip->rmh, CMD_11_CANCEL_BUFFER); - - chip->rmh.cmd[0] |= pipe_cmd; - chip->rmh.cmd[0] |= MASK_BUFFER_ID; /* ask for the current buffer: the - * microblaze will seek for it */ - - err = lx_message_send_atomic(chip, &chip->rmh); - - if (err == 0) - *r_buffer_size = chip->rmh.stat[0] & MASK_DATA_SIZE; - - mutex_unlock(&chip->msg_lock); - return err; -} - -int lx_buffer_cancel(struct lx6464es *chip, u32 pipe, int is_capture, - u32 buffer_index) -{ - int err; - u32 pipe_cmd = PIPE_INFO_TO_CMD(is_capture, pipe); - - mutex_lock(&chip->msg_lock); - lx_message_init(&chip->rmh, CMD_11_CANCEL_BUFFER); - - chip->rmh.cmd[0] |= pipe_cmd; - chip->rmh.cmd[0] |= buffer_index; - - err = lx_message_send_atomic(chip, &chip->rmh); - - mutex_unlock(&chip->msg_lock); - return err; -} - /* low-level gain/peak handling * diff --git a/sound/pci/lx6464es/lx_core.h b/sound/pci/lx6464es/lx_core.h index 0cc140c..f95ed1b 100644 --- a/sound/pci/lx6464es/lx_core.h +++ b/sound/pci/lx6464es/lx_core.h @@ -120,8 +120,6 @@ int lx_dsp_get_mac(struct lx6464es *chip); int lx_pipe_allocate(struct lx6464es *chip, u32 pipe, int is_capture, int channels); int lx_pipe_release(struct lx6464es *chip, u32 pipe, int is_capture); -int lx_pipe_sample_count(struct lx6464es *chip, u32 pipe, int is_capture, - u64 *rsample_count); int lx_pipe_state(struct lx6464es *chip, u32 pipe, int is_capture, u16 *rstate); int lx_pipe_stop(struct lx6464es *chip, u32 pipe, int is_capture); int lx_pipe_start(struct lx6464es *chip, u32 pipe, int is_capture); @@ -133,10 +131,6 @@ int lx_pipe_wait_for_idle(struct lx6464es *chip, u32 pipe, int is_capture); /* low-level stream handling */ int lx_stream_set_format(struct lx6464es *chip, struct snd_pcm_runtime *runtime, u32 pipe, int is_capture); -int lx_stream_state(struct lx6464es *chip, u32 pipe, int is_capture, - int *rstate); -int lx_stream_sample_position(struct lx6464es *chip, u32 pipe, int is_capture, - u64 *r_bytepos); int lx_stream_set_state(struct lx6464es *chip, u32 pipe, int is_capture, enum stream_state_t state); @@ -168,10 +162,6 @@ int lx_buffer_ask(struct lx6464es *chip, u32 pipe, int is_capture, int lx_buffer_give(struct lx6464es *chip, u32 pipe, int is_capture, u32 buffer_size, u32 buf_address_lo, u32 buf_address_hi, u32 *r_buffer_index); -int lx_buffer_free(struct lx6464es *chip, u32 pipe, int is_capture, - u32 *r_buffer_size); -int lx_buffer_cancel(struct lx6464es *chip, u32 pipe, int is_capture, - u32 buffer_index); /* low-level gain/peak handling */ int lx_level_unmute(struct lx6464es *chip, int is_capture, int unmute);