From patchwork Fri Oct 16 04:38:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Cho X-Patchwork-Id: 7410911 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 C66E7BEEA4 for ; Fri, 16 Oct 2015 04:42:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EC9F520986 for ; Fri, 16 Oct 2015 04:42:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E3DE620622 for ; Fri, 16 Oct 2015 04:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753479AbbJPEmE (ORCPT ); Fri, 16 Oct 2015 00:42:04 -0400 Received: from eusmtp01.atmel.com ([212.144.249.242]:52871 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751388AbbJPEmC (ORCPT ); Fri, 16 Oct 2015 00:42:02 -0400 Received: from tony-itx.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Fri, 16 Oct 2015 06:41:55 +0200 From: Tony Cho To: CC: , , , , , , , , Subject: [PATCH V2 38/40] staging: wilc1000: fixes unnecessary variable replacement Date: Fri, 16 Oct 2015 13:38:08 +0900 Message-ID: <1444970290-17609-38-git-send-email-tony.cho@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444970290-17609-1-git-send-email-tony.cho@atmel.com> References: <1444970290-17609-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=-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 From: Leo Kim This patch removes an unnecessary variable use for the errors and returns errors directly without a result variable. Signed-off-by: Leo Kim Signed-off-by: Tony Cho --- drivers/staging/wilc1000/host_interface.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c index 02c9763..08f70d8 100644 --- a/drivers/staging/wilc1000/host_interface.c +++ b/drivers/staging/wilc1000/host_interface.c @@ -3200,9 +3200,8 @@ s32 host_int_add_wep_key_bss_sta(struct host_if_drv *hif_drv, struct host_if_msg msg; if (!hif_drv) { - result = -EFAULT; PRINT_ER("driver is null\n"); - return result; + return -EFAULT; } memset(&msg, 0, sizeof(struct host_if_msg)); @@ -3237,9 +3236,8 @@ s32 host_int_add_wep_key_bss_ap(struct host_if_drv *hif_drv, u8 i; if (!hif_drv) { - result = -EFAULT; PRINT_ER("driver is null\n"); - return result; + return -EFAULT; } memset(&msg, 0, sizeof(struct host_if_msg)); @@ -3279,9 +3277,8 @@ s32 host_int_add_ptk(struct host_if_drv *hif_drv, const u8 *pu8Ptk, u32 i; if (!hif_drv) { - result = -EFAULT; PRINT_ER("driver is null\n"); - return result; + return -EFAULT; } if (pu8RxMic != NULL) u8KeyLen += RX_MIC_KEY_LEN; @@ -3344,9 +3341,8 @@ s32 host_int_add_rx_gtk(struct host_if_drv *hif_drv, const u8 *pu8RxGtk, u8 u8KeyLen = u8GtkKeylen; if (!hif_drv) { - result = -EFAULT; PRINT_ER("driver is null\n"); - return result; + return -EFAULT; } memset(&msg, 0, sizeof(struct host_if_msg)); @@ -3403,9 +3399,8 @@ s32 host_int_set_pmkid_info(struct host_if_drv *hif_drv, struct host_if_pmkid_at if (!hif_drv) { - result = -EFAULT; PRINT_ER("driver is null\n"); - return result; + return -EFAULT; } memset(&msg, 0, sizeof(struct host_if_msg)); @@ -3548,9 +3543,8 @@ s32 host_int_set_join_req(struct host_if_drv *hif_drv, u8 *pu8bssid, enum scan_conn_timer enuScanConnTimer; if (!hif_drv || pfConnectResult == NULL) { - result = -EFAULT; PRINT_ER("Driver is null\n"); - return result; + return -EFAULT; } if (pJoinParams == NULL) { @@ -3610,16 +3604,12 @@ s32 host_int_flush_join_req(struct host_if_drv *hif_drv) s32 result = 0; struct host_if_msg msg; - if (!join_req) { - result = -EFAULT; - return result; - } - + if (!join_req) + return -EFAULT; if (!hif_drv) { - result = -EFAULT; PRINT_ER("Driver is null\n"); - return result; + return -EFAULT; } msg.id = HOST_IF_MSG_FLUSH_CONNECT;