From patchwork Mon Sep 17 14:43:26 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Perches X-Patchwork-Id: 1467751 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 671F5DF2D8 for ; Mon, 17 Sep 2012 14:43:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756417Ab2IQOn2 (ORCPT ); Mon, 17 Sep 2012 10:43:28 -0400 Received: from perches-mx.perches.com ([206.117.179.246]:48790 "EHLO labridge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755501Ab2IQOn2 (ORCPT ); Mon, 17 Sep 2012 10:43:28 -0400 Received: from [173.51.221.202] (account joe@perches.com HELO [192.168.1.154]) by labridge.com (CommuniGate Pro SMTP 5.0.14) with ESMTPA id 19620521; Mon, 17 Sep 2012 07:43:27 -0700 Message-ID: <1347893006.2050.2.camel@joe2Laptop> Subject: Re: [PATCH] wireless: remove unreachable code From: Joe Perches To: Alan Cox Cc: johannes@sipsolutions.net, linux-wireless@vger.kernel.org Date: Mon, 17 Sep 2012 07:43:26 -0700 In-Reply-To: <20120917105354.30097.45595.stgit@localhost.localdomain> References: <20120917105354.30097.45595.stgit@localhost.localdomain> X-Mailer: Evolution 3.2.2- Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 2012-09-17 at 11:54 +0100, Alan Cox wrote: > From: Alan Cox > > The only case where intersected_rd can become non NULL is within an if. All > paths from that if return, so the end chunk has therefore squawked its > last and is no more. It might be better to move the declaration into the if brace too --- net/wireless/reg.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 1ad04e5..7985ab2 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c @@ -2192,7 +2192,6 @@ static void print_regdomain_info(const struct ieee80211_regdomain *rd) /* Takes ownership of rd only if it doesn't fail */ static int __set_regdom(const struct ieee80211_regdomain *rd) { - const struct ieee80211_regdomain *intersected_rd = NULL; struct cfg80211_registered_device *rdev = NULL; struct wiphy *request_wiphy; /* Some basic sanity checks first */ @@ -2282,6 +2281,7 @@ static int __set_regdom(const struct ieee80211_regdomain *rd) /* Intersection requires a bit more work */ if (last_request->initiator != NL80211_REGDOM_SET_BY_COUNTRY_IE) { + const struct ieee80211_regdomain *intersected_rd; intersected_rd = regdom_intersect(rd, cfg80211_regdomain); if (!intersected_rd)