From patchwork Thu Feb 4 09:24:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Glen Lee X-Patchwork-Id: 8215451 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 EEFFD9F3CD for ; Thu, 4 Feb 2016 09:31:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0B39C2038F for ; Thu, 4 Feb 2016 09:31:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0F87420390 for ; Thu, 4 Feb 2016 09:31:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753162AbcBDJbC (ORCPT ); Thu, 4 Feb 2016 04:31:02 -0500 Received: from eusmtp01.atmel.com ([212.144.249.242]:58454 "EHLO eusmtp01.atmel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753742AbcBDJa7 (ORCPT ); Thu, 4 Feb 2016 04:30:59 -0500 Received: from glen-ubuntu.corp.atmel.com (10.161.101.13) by eusmtp01.atmel.com (10.161.101.30) with Microsoft SMTP Server id 14.3.235.1; Thu, 4 Feb 2016 10:30:52 +0100 From: Glen Lee To: CC: , , , , , , , , Subject: [PATCH RESEND 41/70] staging: wilc1000: linux_mon.c: replaces PRINT_ER with netdev_err Date: Thu, 4 Feb 2016 18:24:02 +0900 Message-ID: <1454577871-667-2-git-send-email-glen.lee@atmel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1454577871-667-1-git-send-email-glen.lee@atmel.com> References: <1454577871-667-1-git-send-email-glen.lee@atmel.com> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 From: Leo Kim This patches replaces PRINT_ER with netdev_err. Removes unnecessary debug logs as well. Signed-off-by: Leo Kim --- drivers/staging/wilc1000/linux_mon.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c index e9bb0ec..f0a94e5 100644 --- a/drivers/staging/wilc1000/linux_mon.c +++ b/drivers/staging/wilc1000/linux_mon.c @@ -157,10 +157,8 @@ 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) { - PRINT_D(HOSTAPD_DBG, "ERROR: dev == NULL\n"); + if (!dev) return -EFAULT; - } netif_stop_queue(dev); mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC); @@ -205,17 +203,12 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, return -EFAULT; mon_priv = netdev_priv(wilc_wfi_mon); - - if (!mon_priv) { - PRINT_ER("Monitor interface private structure is NULL\n"); + if (!mon_priv) return -EFAULT; - } - rtap_len = ieee80211_get_radiotap_len(skb->data); - if (skb->len < rtap_len) { - PRINT_ER("Error in radiotap header\n"); + if (skb->len < rtap_len) return -1; - } + /* skip the radiotap header */ PRINT_INFO(HOSTAPD_DBG, "Radiotap len: %d\n", rtap_len); @@ -273,7 +266,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb, /* if source address and bssid fields are equal>>Mac header */ /*send it to mgmt frames handler */ if (!(memcmp(srcAdd, bssid, 6))) { - mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); + ret = mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len); + if (ret) + netdev_err(dev, "fail to mgmt tx\n"); dev_kfree_skb(skb); } else { ret = wilc_mac_xmit(skb, mon_priv->real_ndev); @@ -307,11 +302,8 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi } wilc_wfi_mon = alloc_etherdev(sizeof(struct WILC_WFI_mon_priv)); - if (!wilc_wfi_mon) { - PRINT_ER("failed to allocate memory\n"); + if (!wilc_wfi_mon) return NULL; - } - wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP; strncpy(wilc_wfi_mon->name, name, IFNAMSIZ); wilc_wfi_mon->name[IFNAMSIZ - 1] = 0; @@ -319,14 +311,12 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi ret = register_netdevice(wilc_wfi_mon); if (ret) { - PRINT_ER(" register_netdevice failed (%d)\n", ret); + netdev_err(real_dev, "register_netdevice failed\n"); return NULL; } priv = netdev_priv(wilc_wfi_mon); - if (!priv) { - PRINT_ER("private structure is NULL\n"); + if (!priv) return NULL; - } priv->real_ndev = real_dev;