From patchwork Sun Dec 7 01:12:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rickard Strandqvist X-Patchwork-Id: 5450991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CADF6BEEA8 for ; Sun, 7 Dec 2014 01:13:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5BB720142 for ; Sun, 7 Dec 2014 01:13:24 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7AE5D2013D for ; Sun, 7 Dec 2014 01:13:23 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XxQMR-0004h5-EE; Sun, 07 Dec 2014 01:10:07 +0000 Received: from mail-wi0-f170.google.com ([209.85.212.170]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XxQMM-0004CI-UU for linux-arm-kernel@lists.infradead.org; Sun, 07 Dec 2014 01:10:04 +0000 Received: by mail-wi0-f170.google.com with SMTP id bs8so4400474wib.5 for ; Sat, 06 Dec 2014 17:09:40 -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=gHbQ7vGq91Tz9olsCn7Qx9aKs1oaR9+k3xAKglQMJys=; b=kMQY1HMwQjJL6S916b8f30CZPMK6yo8xZL1jTFGS2ZSf4xnRoKwFwKT97v8YDa6I+/ Xf25TaQ6GkpLhuSbkTJMg5QxZXsWRilXTmJyUwzkWPc4HqSy0vnJyrsI4Q09vsQ7hrVp Itl/q/932xmG8Xv39qjWGJDBLG6T7+gEfa82LGTq01zJjfBmSpMvg/Lp9nQ5wS9iDkEX 3osi65CEudms01iSp+T5zv74xZbiY/ISukpvlJ4KHH6xEem1N5/++ZyYpMF3hScKbaij emkLRGDqmVhYJOYRpwliGzPfJ8wBQIhC2x3EzTKJL3wvb0VmYduyA1TXRejmsrGjGYr6 6FIw== X-Gm-Message-State: ALoCoQnx4WLzba3molwErAdgBBNjaKuKGZvZMD9nuQ3fjHqK5RrAVF0/zPa7IQI1EcQwZwFNOFW0 X-Received: by 10.195.11.38 with SMTP id ef6mr34818351wjd.68.1417914580647; Sat, 06 Dec 2014 17:09:40 -0800 (PST) Received: from localhost.localdomain (h-246-111.a218.priv.bahnhof.se. [85.24.246.111]) by mx.google.com with ESMTPSA id e7sm50607374wjx.31.2014.12.06.17.09.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 06 Dec 2014 17:09:39 -0800 (PST) From: Rickard Strandqvist To: David Brown , Daniel Walker Subject: [PATCH] arch: arm: mach-msm: smd.c: Remove some unused functions Date: Sun, 7 Dec 2014 02:12:20 +0100 Message-Id: <1417914740-8390-1-git-send-email-rickard_strandqvist@spectrumdigital.se> X-Mailer: git-send-email 1.7.10.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141206_171003_211181_EA44E9D0 X-CRM114-Status: GOOD ( 14.45 ) X-Spam-Score: -0.7 (/) Cc: Russell King , Rickard Strandqvist , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan Huntsman , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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: smsm_set_sleep_duration() smsm_get_state() smd_wait_until_writable() smd_wait_until_readable() smd_write_atomic() smd_sleep_exit() This was partially found by using a static code analysis program called cppcheck. Signed-off-by: Rickard Strandqvist --- arch/arm/mach-msm/include/mach/msm_smd.h | 9 --- arch/arm/mach-msm/smd.c | 105 ------------------------------ arch/arm/mach-msm/smd_private.h | 2 - 3 files changed, 116 deletions(-) diff --git a/arch/arm/mach-msm/include/mach/msm_smd.h b/arch/arm/mach-msm/include/mach/msm_smd.h index 029463e..48ddef98 100644 --- a/arch/arm/mach-msm/include/mach/msm_smd.h +++ b/arch/arm/mach-msm/include/mach/msm_smd.h @@ -40,7 +40,6 @@ int smd_read(smd_channel_t *ch, void *data, int len); ** it will return the requested length written or an error. */ int smd_write(smd_channel_t *ch, const void *data, int len); -int smd_write_atomic(smd_channel_t *ch, const void *data, int len); int smd_write_avail(smd_channel_t *ch); int smd_read_avail(smd_channel_t *ch); @@ -57,14 +56,6 @@ int smd_cur_packet_size(smd_channel_t *ch); void smd_kick(smd_channel_t *ch); -#if 0 -/* these are interruptable waits which will block you until the specified -** number of bytes are readable or writable. -*/ -int smd_wait_until_readable(smd_channel_t *ch, int bytes); -int smd_wait_until_writable(smd_channel_t *ch, int bytes); -#endif - typedef enum { SMD_PORT_DS = 0, SMD_PORT_DIAG, diff --git a/arch/arm/mach-msm/smd.c b/arch/arm/mach-msm/smd.c index b1588a1..4bc1e71 100644 --- a/arch/arm/mach-msm/smd.c +++ b/arch/arm/mach-msm/smd.c @@ -401,36 +401,6 @@ static inline int smd_need_int(struct smd_channel *ch) return 0; } -void smd_sleep_exit(void) -{ - unsigned long flags; - struct smd_channel *ch; - int need_int = 0; - - spin_lock_irqsave(&smd_lock, flags); - list_for_each_entry(ch, &smd_ch_list_modem, ch_list) { - if (smd_need_int(ch)) { - need_int = 1; - break; - } - } - list_for_each_entry(ch, &smd_ch_list_dsp, ch_list) { - if (smd_need_int(ch)) { - need_int = 1; - break; - } - } - spin_unlock_irqrestore(&smd_lock, flags); - do_smd_probe(); - - if (need_int) { - if (msm_smd_debug_mask & MSM_SMD_DEBUG) - pr_info("smd_sleep_exit need interrupt\n"); - tasklet_schedule(&smd_fake_irq_tasklet); - } -} - - void smd_kick(smd_channel_t *ch) { unsigned long flags; @@ -747,16 +717,6 @@ int smd_write(smd_channel_t *ch, const void *data, int len) return ch->write(ch, data, len); } -int smd_write_atomic(smd_channel_t *ch, const void *data, int len) -{ - unsigned long flags; - int res; - spin_lock_irqsave(&smd_lock, flags); - res = ch->write(ch, data, len); - spin_unlock_irqrestore(&smd_lock, flags); - return res; -} - int smd_read_avail(smd_channel_t *ch) { return ch->read_avail(ch); @@ -767,16 +727,6 @@ int smd_write_avail(smd_channel_t *ch) return ch->write_avail(ch); } -int smd_wait_until_readable(smd_channel_t *ch, int bytes) -{ - return -1; -} - -int smd_wait_until_writable(smd_channel_t *ch, int bytes) -{ - return -1; -} - int smd_cur_packet_size(smd_channel_t *ch) { return ch->current_packet; @@ -875,61 +825,6 @@ int smsm_change_state(enum smsm_state_item item, return 0; } -uint32_t smsm_get_state(enum smsm_state_item item) -{ - unsigned long flags; - uint32_t rv; - - spin_lock_irqsave(&smem_lock, flags); - - rv = readl(smd_info.state + item * 4); - - if (item == SMSM_STATE_MODEM && (rv & SMSM_RESET)) - handle_modem_crash(); - - spin_unlock_irqrestore(&smem_lock, flags); - - return rv; -} - -#ifdef CONFIG_ARCH_MSM_SCORPION - -int smsm_set_sleep_duration(uint32_t delay) -{ - struct msm_dem_slave_data *ptr; - - ptr = smem_find(SMEM_APPS_DEM_SLAVE_DATA, sizeof(*ptr)); - if (ptr == NULL) { - pr_err("smsm_set_sleep_duration \n"); - return -EIO; - } - if (msm_smd_debug_mask & MSM_SMSM_DEBUG) - pr_info("smsm_set_sleep_duration %d -> %d\n", - ptr->sleep_time, delay); - ptr->sleep_time = delay; - return 0; -} - -#else - -int smsm_set_sleep_duration(uint32_t delay) -{ - uint32_t *ptr; - - ptr = smem_find(SMEM_SMSM_SLEEP_DELAY, sizeof(*ptr)); - if (ptr == NULL) { - pr_err("smsm_set_sleep_duration \n"); - return -EIO; - } - if (msm_smd_debug_mask & MSM_SMSM_DEBUG) - pr_info("smsm_set_sleep_duration %d -> %d\n", - *ptr, delay); - *ptr = delay; - return 0; -} - -#endif - int smd_core_init(void) { int r; diff --git a/arch/arm/mach-msm/smd_private.h b/arch/arm/mach-msm/smd_private.h index 727bfe6..702f34e 100644 --- a/arch/arm/mach-msm/smd_private.h +++ b/arch/arm/mach-msm/smd_private.h @@ -148,8 +148,6 @@ enum smsm_state_item { void *smem_alloc(unsigned id, unsigned size); int smsm_change_state(enum smsm_state_item item, uint32_t clear_mask, uint32_t set_mask); -uint32_t smsm_get_state(enum smsm_state_item item); -int smsm_set_sleep_duration(uint32_t delay); void smsm_print_sleep_info(void); #define SMEM_NUM_SMD_CHANNELS 64