From patchwork Fri Nov 14 22:12:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 5309841 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F2295C11AC for ; Fri, 14 Nov 2014 22:12:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3B9552015D for ; Fri, 14 Nov 2014 22:12:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6081020149 for ; Fri, 14 Nov 2014 22:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422766AbaKNWM0 (ORCPT ); Fri, 14 Nov 2014 17:12:26 -0500 Received: from mail-ie0-f170.google.com ([209.85.223.170]:49639 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422644AbaKNWMZ (ORCPT ); Fri, 14 Nov 2014 17:12:25 -0500 Received: by mail-ie0-f170.google.com with SMTP id tp5so18916162ieb.29 for ; Fri, 14 Nov 2014 14:12:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-type:content-disposition:user-agent; bh=AkYgD9RWbzAJX2Ld0RrgepOdpLGm7dpWOYLG/vVfpAk=; b=YI4moVcraxs+WBVpQf3nC/ZefD3JAzm8q6TbzHsyT0Mn3fAH9L+GiRXRDmbJft1OED pXUaBKsqrUQupeCZN9wHTYqlZy08vmgrtnx5+L2aJOIW7ehRDA9YSWx0PGDArdgRfmK4 4I98rA6ReajO8RBSGN3COmHbu+I1+5Z7c9tPM0PVZlLbrWa131OledbzSZ6mNiWq/T/8 H4mBCUpGssj8noEss088pY47WjB4Q1XQ9nTKM9OM5V8D7txaxpjctX/fzhu2xCyPT5pW buFE5X2yLP0lFLYZvLpFXioXKF+5FENu3bEFSQLkTdDf2WHGsAUCqqdoqkS5cBVphAHG 7ABQ== X-Gm-Message-State: ALoCoQlLfAuOs3IshyqLj9N3YfRBjKdLCohz4Qe0DzmneP+2X2yUsXltIRVVXo6natkXSCLmcVru X-Received: by 10.42.129.140 with SMTP id q12mr4479746ics.68.1416003144188; Fri, 14 Nov 2014 14:12:24 -0800 (PST) Received: from dtor-ws ([2620:0:1000:1301:8c0e:c406:dbcd:b83b]) by mx.google.com with ESMTPSA id i184sm14988980ioi.33.2014.11.14.14.12.23 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 14 Nov 2014 14:12:23 -0800 (PST) Date: Fri, 14 Nov 2014 14:12:21 -0800 From: Dmitry Torokhov To: "John W. Linville" Cc: Brett Rudley , Arend van Spriel , "Franky (Zhenhui) Lin" , Hante Meuleman , Pieter-Paul Giesberts , linux-wireless@vger.kernel.org, brcm80211-dev-list@broadcom.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] brcmfmac: fix error handling of irq_of_parse_and_map Message-ID: <20141114221221.GA35541@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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=ham 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 Return value of irq_of_parse_and_map() is unsigned int, with 0 indicating failure, so testing for negative result never works. Signed-off-by: Dmitry Torokhov --- Not tested, found by casual code inspection. drivers/net/wireless/brcm80211/brcmfmac/of.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/brcm80211/brcmfmac/of.c b/drivers/net/wireless/brcm80211/brcmfmac/of.c index eb3fce82..c824570 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/of.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/of.c @@ -40,8 +40,8 @@ void brcmf_of_probe(struct brcmf_sdio_dev *sdiodev) return; irq = irq_of_parse_and_map(np, 0); - if (irq < 0) { - brcmf_err("interrupt could not be mapped: err=%d\n", irq); + if (!irq) { + brcmf_err("interrupt could not be mapped\n"); devm_kfree(dev, sdiodev->pdata); return; }