From patchwork Tue Jul 28 08:47:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 6880651 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9D369C05AC for ; Tue, 28 Jul 2015 08:48:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9FBE120534 for ; Tue, 28 Jul 2015 08:48:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8D02E20520 for ; Tue, 28 Jul 2015 08:48:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932228AbbG1Isv (ORCPT ); Tue, 28 Jul 2015 04:48:51 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:47980 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755362AbbG1Ist (ORCPT ); Tue, 28 Jul 2015 04:48:49 -0400 Received: from tony-ThinkPad-T420.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Tue, 28 Jul 2015 10:48:46 +0200 From: Tony Cho To: CC: , , , , , , , , , , , Subject: [PATCH 07/21] staging: wilc1000: remove preprocessor conditionals unused Date: Tue, 28 Jul 2015 17:47:26 +0900 Message-ID: <1438073261-28315-8-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1438073261-28315-1-git-send-email-tony.cho@atmel.com> References: <1438073261-28315-1-git-send-email-tony.cho@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 This patch removes unused preprocessor conditionals for the PLAT_AML8726_M3_BACKUP and PLAT_AML8726_M3 which are not used and so dead codes. They are also platform-dependent codes. Signed-off-by: Tony Cho --- drivers/staging/wilc1000/wilc_sdio.c | 174 +---------------------------------- 1 file changed, 1 insertion(+), 173 deletions(-) diff --git a/drivers/staging/wilc1000/wilc_sdio.c b/drivers/staging/wilc1000/wilc_sdio.c index 967df95..ea545c9 100644 --- a/drivers/staging/wilc1000/wilc_sdio.c +++ b/drivers/staging/wilc1000/wilc_sdio.c @@ -13,12 +13,7 @@ #ifdef WILC1000_SINGLE_TRANSFER #define WILC_SDIO_BLOCK_SIZE 256 #else - #if defined(PLAT_AML8726_M3) /* johnny */ - #define WILC_SDIO_BLOCK_SIZE 512 - #define MAX_SEG_SIZE (1 << 12) /* 4096 */ - #else - #define WILC_SDIO_BLOCK_SIZE 512 - #endif +#define WILC_SDIO_BLOCK_SIZE 512 #endif typedef struct { @@ -356,88 +351,6 @@ static int sdio_write(uint32_t addr, uint8_t *buf, uint32_t size) nleft = size % block_size; if (nblk > 0) { - -#if defined(PLAT_AML8726_M3_BACKUP) /* johnny */ - int i; - - for (i = 0; i < nblk; i++) { - cmd.block_mode = 0; /* 1; */ - cmd.increment = 1; - cmd.count = block_size; /* nblk; */ - cmd.buffer = buf; - cmd.block_size = block_size; - if (addr > 0) { - if (!sdio_set_func0_csa_address(addr)) - goto _fail_; - } - if (!g_sdio.sdio_cmd53(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block send...\n", addr); - goto _fail_; - } - - if (addr > 0) - addr += block_size; /* addr += nblk*block_size; */ - - buf += block_size; /* buf += nblk*block_size; */ - } - -#elif defined(PLAT_AML8726_M3) /* johnny */ - - int i; - int rest; - int seg_cnt; - - seg_cnt = (nblk * block_size) / MAX_SEG_SIZE; - rest = (nblk * block_size) & (MAX_SEG_SIZE - 1); - - for (i = 0; i < seg_cnt; i++) { - cmd.block_mode = 1; - cmd.increment = 1; - cmd.count = MAX_SEG_SIZE / block_size; - cmd.buffer = buf; - cmd.block_size = block_size; - - if (addr > 0) { - if (!sdio_set_func0_csa_address(addr)) - goto _fail_; - } - if (!g_sdio.sdio_cmd53(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block send...\n", addr); - goto _fail_; - } - - if (addr > 0) - addr += MAX_SEG_SIZE; - - buf += MAX_SEG_SIZE; - - } - - if (rest > 0) { - cmd.block_mode = 1; - cmd.increment = 1; - cmd.count = rest / block_size; - cmd.buffer = buf; - cmd.block_size = block_size; /* johnny : prevent it from setting unexpected value */ - - if (addr > 0) { - if (!sdio_set_func0_csa_address(addr)) - goto _fail_; - } - if (!g_sdio.sdio_cmd53(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], bytes send...\n", addr); - goto _fail_; - } - - if (addr > 0) - addr += rest; - - buf += rest; - - } - -#else - cmd.block_mode = 1; cmd.increment = 1; cmd.count = nblk; @@ -454,8 +367,6 @@ static int sdio_write(uint32_t addr, uint8_t *buf, uint32_t size) if (addr > 0) addr += nblk * block_size; buf += nblk * block_size; - -#endif /* platform */ } if (nleft > 0) { @@ -582,87 +493,6 @@ static int sdio_read(uint32_t addr, uint8_t *buf, uint32_t size) nleft = size % block_size; if (nblk > 0) { - -#if defined(PLAT_AML8726_M3_BACKUP) /* johnny */ - - int i; - - for (i = 0; i < nblk; i++) { - cmd.block_mode = 0; /* 1; */ - cmd.increment = 1; - cmd.count = block_size; /* nblk; */ - cmd.buffer = buf; - cmd.block_size = block_size; - if (addr > 0) { - if (!sdio_set_func0_csa_address(addr)) - goto _fail_; - } - if (!g_sdio.sdio_cmd53(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block read...\n", addr); - goto _fail_; - } - if (addr > 0) - addr += block_size; /* addr += nblk*block_size; */ - buf += block_size; /* buf += nblk*block_size; */ - } - -#elif defined(PLAT_AML8726_M3) /* johnny */ - - int i; - int rest; - int seg_cnt; - - seg_cnt = (nblk * block_size) / MAX_SEG_SIZE; - rest = (nblk * block_size) & (MAX_SEG_SIZE - 1); - - for (i = 0; i < seg_cnt; i++) { - cmd.block_mode = 1; - cmd.increment = 1; - cmd.count = MAX_SEG_SIZE / block_size; - cmd.buffer = buf; - cmd.block_size = block_size; - - if (addr > 0) { - if (!sdio_set_func0_csa_address(addr)) - goto _fail_; - } - if (!g_sdio.sdio_cmd53(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block read...\n", addr); - goto _fail_; - } - - if (addr > 0) - addr += MAX_SEG_SIZE; - - buf += MAX_SEG_SIZE; - - } - - if (rest > 0) { - cmd.block_mode = 1; - cmd.increment = 1; - cmd.count = rest / block_size; - cmd.buffer = buf; - cmd.block_size = block_size; /* johnny : prevent it from setting unexpected value */ - - if (addr > 0) { - if (!sdio_set_func0_csa_address(addr)) - goto _fail_; - } - if (!g_sdio.sdio_cmd53(&cmd)) { - g_sdio.dPrint(N_ERR, "[wilc sdio]: Failed cmd53 [%x], block read...\n", addr); - goto _fail_; - } - - if (addr > 0) - addr += rest; - - buf += rest; - - } - -#else - cmd.block_mode = 1; cmd.increment = 1; cmd.count = nblk; @@ -679,8 +509,6 @@ static int sdio_read(uint32_t addr, uint8_t *buf, uint32_t size) if (addr > 0) addr += nblk * block_size; buf += nblk * block_size; - -#endif /* platform */ } /* if (nblk > 0) */ if (nleft > 0) {