From patchwork Mon May 30 02:52:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirtika Ruchandani X-Patchwork-Id: 9140163 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29E6960755 for ; Mon, 30 May 2016 02:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1F66720265 for ; Mon, 30 May 2016 02:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 144E128183; Mon, 30 May 2016 02:53:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B35720265 for ; Mon, 30 May 2016 02:53:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753454AbcE3Cw4 (ORCPT ); Sun, 29 May 2016 22:52:56 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:36639 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753188AbcE3Cwz (ORCPT ); Sun, 29 May 2016 22:52:55 -0400 Received: by mail-pf0-f196.google.com with SMTP id 62so8114522pfd.3; Sun, 29 May 2016 19:52:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=F/FJE9lnyP9AkeDPR4xgB0JO7N9ndQ45b6oQDurgQRI=; b=avtdmhUj2Z1FWhs+j9fWF2agA20gjdD5dAdkkY9sg79o57PH9pIV34s7bHuQKHm7gh eb7pBfhm088tZKXfgUp2JnRZq6tFAuXyRpOWYvGJkDaxpbGrvRq/NMnicLkRGGz7yDhl u70QHgYCTckMinEVHjQx/MM8naW3WzzbOX21kpnrS/nLl3TK8iLJRvMvXMy+hPTlP+0T bHoZaipf2tmL8SUEYVUi3WldQ4aktnGWXNfWF59ko5+9IqjIr2SgsXmgUxuAnTgAdUko 3atK4wrS8Od6I19JSSNPXn1qtuV+w4MtVdnAHQG/WJoShzssq7NFBYE9xpSlq7Nf1f3T Eb0g== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=F/FJE9lnyP9AkeDPR4xgB0JO7N9ndQ45b6oQDurgQRI=; b=YK4ba/JrI49JdurQi1erQrHkOK8BrPhkjlD2xtaEptQjGBogNQK8uUdWmkPWE1ywXW DscYzRvUlTu87NseelXlkwhnU/KlriwzS60HgLtcG9iMd98GhsWNdqPOedxbYsWjYRWk UV5ofH/R42QF79I8X2akSk8IagBTr4WsOoUG1NabqDZm1CL/unCzFEATxXuYm8QjVMT2 SMBS+k2CaJxDFj4v98WwP3HiaRAWXXYsuNb3CpGDibC24EGtacso/Dcr/L9S9oFPwhsq HL3C8VzK8u3NOB9istBSDHJgDsJEqQtJZrICAp7BNYofS4ta8ncD5GZWluQwwwHGEOwW d6OQ== X-Gm-Message-State: ALyK8tLj8Z7iZh+ba7QEl+ZKbuKB2TGaA1WojeuaQe+jFJ2g+lNJWfuo8caUWeO6m0Gotg== X-Received: by 10.98.57.138 with SMTP id u10mr42654166pfj.148.1464576774400; Sun, 29 May 2016 19:52:54 -0700 (PDT) Received: from google.com ([2620:0:1000:1301:9988:7148:7bd6:87cc]) by smtp.gmail.com with ESMTPSA id r85sm28459005pfr.48.2016.05.29.19.52.53 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 29 May 2016 19:52:53 -0700 (PDT) Date: Sun, 29 May 2016 19:52:48 -0700 From: Kirtika Ruchandani To: Johannes Berg Cc: linux-wireless@vger.kernel.org, ruchandani.tina@gmail.com, netdev@vger.kernel.org, Julian.Calaby@gmail.com Subject: [PATCH v2 05/10] nl80211: Fix checkpatch.pl NULL comparison warning Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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-Virus-Scanned: ClamAV using ClamSMTP This patch fixes the warning - "comparison to NULL (foo == NULL) could be written as (!foo)" Signed-off-by: Kirtika Ruchandani Reviewed-by: Julian Calaby --- net/wireless/nl80211.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.8.0.rc3.226.g39d4020 -- 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/nl80211.c b/net/wireless/nl80211.c index 945405d..11cbf0b 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -928,7 +928,7 @@ static struct ieee80211_channel *nl80211_get_valid_chan(struct wiphy *wiphy, { struct ieee80211_channel *chan; - if (tb == NULL) + if (!tb) return NULL; chan = ieee80211_get_channel(wiphy, nla_get_u32(tb)); if (!chan || chan->flags & IEEE80211_CHAN_DISABLED) @@ -8575,7 +8575,7 @@ static int nl80211_set_tx_bitrate_mask(struct sk_buff *skb, if (band < 0 || band >= NUM_NL80211_BANDS) return -EINVAL; sband = rdev->wiphy.bands[band]; - if (sband == NULL) + if (!sband) return -EINVAL; err = nla_parse(tb, NL80211_TXRATE_MAX, nla_data(tx_rates), nla_len(tx_rates), nl80211_txattr_policy);