From patchwork Mon Feb 1 12:26:41 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chaehyun Lim X-Patchwork-Id: 8178621 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 720E79F4DD for ; Mon, 1 Feb 2016 12:27:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 88EAF203E5 for ; Mon, 1 Feb 2016 12:27:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 939C1203C4 for ; Mon, 1 Feb 2016 12:27:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932174AbcBAM1P (ORCPT ); Mon, 1 Feb 2016 07:27:15 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:36334 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932143AbcBAM1N (ORCPT ); Mon, 1 Feb 2016 07:27:13 -0500 Received: by mail-pf0-f193.google.com with SMTP id n128so7472373pfn.3 for ; Mon, 01 Feb 2016 04:27:13 -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:in-reply-to:references; bh=9Wqz2gaL/FQaFwM5hU/VlpFPVud1D+b9N7dBh/old8Q=; b=RxmUmJASi3MLq6Kbg+14JFtC4I1FcfXoQQRF1sQh9IuR0Gm13om4VXwF5Ux/e9h/cr Ib2rFy7DlLYa/4gKurCsRbs8ucUCsfnZjx4VcCx4otKBW6twtCi/jBFwegT+2r/Yi1jC b+Mw+nKAZpwbD+GXoEb/mRriMKrWMuft5H0DJ0NdXUEKqNK52I8OL0t3+sAwOlJqRl2+ kp8rrqgMvFRf8+mBxIrkceqMdhXplE4WYlJI+Yix6FPz7gUJIYmiCM30Js9RjWYzjb9x uA16sKgPYLc320HNKceabwazcLkPqLYi5dRmmqVIIHwHI5BjmVD1xtepAy+gAlq0Kby4 9siA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9Wqz2gaL/FQaFwM5hU/VlpFPVud1D+b9N7dBh/old8Q=; b=BNc7HQmfjGo2yZPV9sk55DOQhGuXHEJ7xCzJus/KLhKpGoIZS2lHF8l6TFgoA9w5Ls nvXYsF67D6h8gulO3ZPAVGk9dX/YxWzuzGhmL67XaPmQMi/Q+FgJEWXmqKf1LwMXcnTy nuhP4oFrDNLpw7Rs/6hzTaCSHm9queOnGeGt0wniOJZH6z6bayS6kcC1KhcsYq+i4IGS zQf2m+qHktSe6kl+VMMhub2DzjrZNfnEBY5ANWV+Ky9bwjH+cirDNS9vuNYneXtHtuin DiFl3tZ439r5x5M0mMdU2Qo5gHgtIz8Io4NRBJc9Rx+V1BqWdaXRz+CNl8At5zHe6wJt WuGg== X-Gm-Message-State: AG10YOSx42KE3G3R7+SJnNnfK2Jz4WPaP+UMGoyDVwK33eTgBmGM2+gYGTLDc7VZo1NU/Q== X-Received: by 10.98.70.80 with SMTP id t77mr16903854pfa.107.1454329632786; Mon, 01 Feb 2016 04:27:12 -0800 (PST) Received: from localhost.localdomain ([218.233.16.2]) by smtp.gmail.com with ESMTPSA id y86sm42992851pfa.26.2016.02.01.04.27.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 01 Feb 2016 04:27:12 -0800 (PST) From: Chaehyun Lim To: gregkh@linuxfoundation.org Cc: johnny.kim@atmel.com, austin.shin@atmel.com, chris.park@atmel.com, tony.cho@atmel.com, glen.lee@atmel.com, leo.kim@atmel.com, linux-wireless@vger.kernel.org, devel@driverdev.osuosl.org, Chaehyun Lim Subject: [PATCH 05/11] staging: wilc1000: linux_mon: fix NULL comparison style Date: Mon, 1 Feb 2016 21:26:41 +0900 Message-Id: <1454329607-9486-5-git-send-email-chaehyun.lim@gmail.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1454329607-9486-1-git-send-email-chaehyun.lim@gmail.com> References: <1454329607-9486-1-git-send-email-chaehyun.lim@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BRBL_LASTEXT,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This patch fixes NULL comparsion style found by checkpatch.pl CHECK: Comparison to NULL could be written "!wilc_wfi_mon" CHECK: Comparison to NULL could be written "!skb" CHECK: Comparison to NULL could be written "!skb" CHECK: Comparison to NULL could be written "!dev" CHECK: Comparison to NULL could be written "!mgmt_tx" CHECK: Comparison to NULL could be written "!mgmt_tx->buff" CHECK: Comparison to NULL could be written "!wilc_wfi_mon" CHECK: Comparison to NULL could be written "!mon_priv" CHECK: Comparison to NULL could be written "!priv" CHECK: Comparison to NULL could be written "wilc_wfi_mon" Signed-off-by: Chaehyun Lim --- drivers/staging/wilc1000/linux_mon.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index 398fdea..7b9cc02 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -54,7 +54,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) PRINT_INFO(HOSTAPD_DBG, "In monitor interface receive function\n"); - if (wilc_wfi_mon == NULL) + if (!wilc_wfi_mon) return; if (!netif_running(wilc_wfi_mon)) { @@ -73,7 +73,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) /* hostapd callback mgmt frame */ skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_cb_hdr)); - if (skb == NULL) { + if (!skb) { PRINT_INFO(HOSTAPD_DBG, "Monitor if : No memory to allocate skb"); return; } @@ -103,7 +103,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size) } else { skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_hdr)); - if (skb == NULL) { + if (!skb) { PRINT_INFO(HOSTAPD_DBG, "Monitor if : No memory to allocate skb"); return; } @@ -156,20 +156,20 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len) { struct tx_complete_mon_data *mgmt_tx = NULL; - if (dev == NULL) { + if (!dev) { PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n"); return -EFAULT; } netif_stop_queue(dev); mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC); - if (mgmt_tx == NULL) { + if (!mgmt_tx) { PRINT_ER("Failed to allocate memory for mgmt_tx structure\n"); return -EFAULT; } mgmt_tx->buff = kmalloc(len, GFP_ATOMIC); - if (mgmt_tx->buff == NULL) { + if (!mgmt_tx->buff) { PRINT_ER("Failed to allocate memory for mgmt_tx buff\n"); kfree(mgmt_tx); return -EFAULT; @@ -203,12 +203,12 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, struct sk_buff *skb2; struct wilc_wfi_radiotap_cb_hdr *cb_hdr; - if (wilc_wfi_mon == NULL) + if (!wilc_wfi_mon) return -EFAULT; mon_priv = netdev_priv(wilc_wfi_mon); - if (mon_priv == NULL) { + if (!mon_priv) { PRINT_ER("Monitor interface private structure is NULL\n"); return -EFAULT; } @@ -324,7 +324,7 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi return NULL; } priv = netdev_priv(wilc_wfi_mon); - if (priv == NULL) { + if (!priv) { PRINT_ER("private structure is NULL\n"); return NULL; } @@ -347,7 +347,7 @@ int WILC_WFI_deinit_mon_interface(void) { bool rollback_lock = false; - if (wilc_wfi_mon != NULL) { + if (wilc_wfi_mon) { PRINT_D(HOSTAPD_DBG, "In Deinit monitor interface\n"); PRINT_D(HOSTAPD_DBG, "RTNL is being locked\n"); if (rtnl_is_locked()) {