From patchwork Thu Nov 15 03:07:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stanislav Yakovlev X-Patchwork-Id: 1744151 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 6EBB43FC64 for ; Wed, 14 Nov 2012 22:01:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933124Ab2KNWBu (ORCPT ); Wed, 14 Nov 2012 17:01:50 -0500 Received: from mail-lb0-f174.google.com ([209.85.217.174]:60636 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933119Ab2KNWBt (ORCPT ); Wed, 14 Nov 2012 17:01:49 -0500 Received: by mail-lb0-f174.google.com with SMTP id gp3so826471lbb.19 for ; Wed, 14 Nov 2012 14:01:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=BsW53icI3+ZBeIXJhqOScHtWdeT2HydOTynrpDT9B8o=; b=XMcxQO/9Mc9473d8XrT28PBcbNGi56coGSiZf9Mi98Bu+vdGAmPnfseqM3zD+GqdDg sj35qS3PXdCyrvn0KdyK4ypPjcjk+fWZDsKUSFojvxy5QK+qMjuuuxtUDAt9gT9gTlqj +tDpyIx4JVctrK6seR2J2woak3rxe54r2KhQUK3h7MTICQtd+IcvI3gwBXpYYR1dmAWW ReHtBjJnmnVvsMmk7VSQYJekas4HT6Z94u9G8Xx9r/f2zpa+MJrGHWoq6SZz0DG3bCPo ClOW8rbqZ3PAjvo1LBIXDqZMpuMeb0gMYMzR+agnvO7WXb3/CXWSH9U/WO9Z5LnmFD0a pvvg== Received: by 10.152.105.68 with SMTP id gk4mr26046087lab.48.1352930507880; Wed, 14 Nov 2012 14:01:47 -0800 (PST) Received: from localhost.localdomain ([89.23.194.117]) by mx.google.com with ESMTPS id pz9sm5509214lab.11.2012.11.14.14.01.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 14 Nov 2012 14:01:47 -0800 (PST) From: Stanislav Yakovlev To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, Stanislav Yakovlev Subject: [PATCH] net/wireless: ipw2x00: remove unreachable code Date: Thu, 15 Nov 2012 03:07:47 +0000 Message-Id: <1352948867-548-1-git-send-email-stas.yakovlev@gmail.com> X-Mailer: git-send-email 1.7.11.7 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Remove unnecessary if statements because libipw_set_geo always returns success. Also change function's return value from int to void. Signed-off-by: Stanislav Yakovlev --- drivers/net/wireless/ipw2x00/ipw2100.c | 5 +---- drivers/net/wireless/ipw2x00/ipw2200.c | 5 +---- drivers/net/wireless/ipw2x00/libipw.h | 2 +- drivers/net/wireless/ipw2x00/libipw_geo.c | 3 +-- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/net/wireless/ipw2x00/ipw2100.c b/drivers/net/wireless/ipw2x00/ipw2100.c index 29b8fa1..46938bc 100644 --- a/drivers/net/wireless/ipw2x00/ipw2100.c +++ b/drivers/net/wireless/ipw2x00/ipw2100.c @@ -1788,10 +1788,7 @@ static int ipw2100_up(struct ipw2100_priv *priv, int deferred) } /* Initialize the geo */ - if (libipw_set_geo(priv->ieee, &ipw_geos[0])) { - printk(KERN_WARNING DRV_NAME "Could not set geo\n"); - return 0; - } + libipw_set_geo(priv->ieee, &ipw_geos[0]); priv->ieee->freq_band = LIBIPW_24GHZ_BAND; lock = LOCK_NONE; diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c index 768bf61..fea96b5 100644 --- a/drivers/net/wireless/ipw2x00/ipw2200.c +++ b/drivers/net/wireless/ipw2x00/ipw2200.c @@ -11322,10 +11322,7 @@ static int ipw_up(struct ipw_priv *priv) priv->eeprom[EEPROM_COUNTRY_CODE + 2]); j = 0; } - if (libipw_set_geo(priv->ieee, &ipw_geos[j])) { - IPW_WARNING("Could not set geography."); - return 0; - } + libipw_set_geo(priv->ieee, &ipw_geos[j]); if (priv->status & STATUS_RF_KILL_SW) { IPW_WARNING("Radio disabled by module parameter.\n"); diff --git a/drivers/net/wireless/ipw2x00/libipw.h b/drivers/net/wireless/ipw2x00/libipw.h index 0b22fb4..6eede52 100644 --- a/drivers/net/wireless/ipw2x00/libipw.h +++ b/drivers/net/wireless/ipw2x00/libipw.h @@ -978,7 +978,7 @@ extern void libipw_network_reset(struct libipw_network *network); /* libipw_geo.c */ extern const struct libipw_geo *libipw_get_geo(struct libipw_device *ieee); -extern int libipw_set_geo(struct libipw_device *ieee, +extern void libipw_set_geo(struct libipw_device *ieee, const struct libipw_geo *geo); extern int libipw_is_valid_channel(struct libipw_device *ieee, diff --git a/drivers/net/wireless/ipw2x00/libipw_geo.c b/drivers/net/wireless/ipw2x00/libipw_geo.c index c9fe3c9..218f2a3 100644 --- a/drivers/net/wireless/ipw2x00/libipw_geo.c +++ b/drivers/net/wireless/ipw2x00/libipw_geo.c @@ -132,7 +132,7 @@ u8 libipw_freq_to_channel(struct libipw_device * ieee, u32 freq) return 0; } -int libipw_set_geo(struct libipw_device *ieee, +void libipw_set_geo(struct libipw_device *ieee, const struct libipw_geo *geo) { memcpy(ieee->geo.name, geo->name, 3); @@ -143,7 +143,6 @@ int libipw_set_geo(struct libipw_device *ieee, sizeof(struct libipw_channel)); memcpy(ieee->geo.a, geo->a, ieee->geo.a_channels * sizeof(struct libipw_channel)); - return 0; } const struct libipw_geo *libipw_get_geo(struct libipw_device *ieee)