All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed))
@ 2016-02-01 12:26 Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 02/11] staging: wilc1000: linux_mon: remove blank lines after open brace '{' Chaehyun Lim
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch fixes the following checkpatch warning:
WARNING: __packed is preferred over __attribute__((packed))

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index e550027..284dfb0 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -15,14 +15,14 @@
 struct wilc_wfi_radiotap_hdr {
 	struct ieee80211_radiotap_header hdr;
 	u8 rate;
-} __attribute__((packed));
+} __packed;
 
 struct wilc_wfi_radiotap_cb_hdr {
 	struct ieee80211_radiotap_header hdr;
 	u8 rate;
 	u8 dump;
 	u16 tx_flags;
-} __attribute__((packed));
+} __packed;
 
 static struct net_device *wilc_wfi_mon; /* global monitor netdev */
 
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 02/11] staging: wilc1000: linux_mon: remove blank lines after open brace '{'
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 03/11] staging: wilc1000: linux_mon: remove blank line before a close brace '}' Chaehyun Lim
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch remove blank lines after open brace found by checkpatch.pl
CHECK: Blank lines aren't necessary after an open brace '{'

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 284dfb0..73c8113 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -71,7 +71,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 	pkt_offset = GET_PKT_OFFSET(header);
 
 	if (pkt_offset & IS_MANAGMEMENT_CALLBACK) {
-
 		/* hostapd callback mgmt frame */
 
 		skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_cb_hdr));
@@ -103,7 +102,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 		}
 
 	} else {
-
 		skb = dev_alloc_skb(size + sizeof(struct wilc_wfi_radiotap_hdr));
 
 		if (skb == NULL) {
@@ -145,7 +143,6 @@ struct tx_complete_mon_data {
 
 static void mgmt_tx_complete(void *priv, int status)
 {
-
 	struct tx_complete_mon_data *pv_data = (struct tx_complete_mon_data *)priv;
 	u8 *buf =  pv_data->buff;
 
@@ -316,8 +313,6 @@ static const struct net_device_ops wilc_wfi_netdev_ops = {
  */
 struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev)
 {
-
-
 	u32 ret = 0;
 	struct WILC_WFI_mon_priv *priv;
 
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 03/11] staging: wilc1000: linux_mon: remove blank line before a close brace '}'
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 02/11] staging: wilc1000: linux_mon: remove blank lines after open brace '{' Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 04/11] staging: wilc1000: linux_mon: remove multiple blank lines Chaehyun Lim
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes blank lines before a close brace found by
checkpatch.pl
CHECK: Blank lines aren't necessary before a close brace '}'

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 73c8113..bd0b17e 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -119,7 +119,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 				(1 << IEEE80211_RADIOTAP_RATE);                   /* | */
 		PRINT_INFO(HOSTAPD_DBG, "Presentflags %d\n", hdr->hdr.it_present);
 		hdr->rate = 5; /* txrate->bitrate / 5; */
-
 	}
 
 
@@ -132,8 +131,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 	memset(skb->cb, 0, sizeof(skb->cb));
 
 	netif_rx(skb);
-
-
 }
 
 struct tx_complete_mon_data {
@@ -183,7 +180,6 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
 		PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
 		kfree(mgmt_tx);
 		return -EFAULT;
-
 	}
 
 	mgmt_tx->size = len;
@@ -325,7 +321,6 @@ struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_devi
 	if (!wilc_wfi_mon) {
 		PRINT_ER("failed to allocate memory\n");
 		return NULL;
-
 	}
 
 	wilc_wfi_mon->type = ARPHRD_IEEE80211_RADIOTAP;
@@ -379,5 +374,4 @@ int WILC_WFI_deinit_mon_interface(void)
 		wilc_wfi_mon = NULL;
 	}
 	return 0;
-
 }
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 04/11] staging: wilc1000: linux_mon: remove multiple blank lines
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 02/11] staging: wilc1000: linux_mon: remove blank lines after open brace '{' Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 03/11] staging: wilc1000: linux_mon: remove blank line before a close brace '}' Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 05/11] staging: wilc1000: linux_mon: fix NULL comparison style Chaehyun Lim
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes multiple blank lines found by checkpatch.pl
CHECK: Please don't use multiple blank lines

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 10 ----------
 1 file changed, 10 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index bd0b17e..398fdea 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -11,7 +11,6 @@
 #include "wilc_wlan_if.h"
 #include "wilc_wlan.h"
 
-
 struct wilc_wfi_radiotap_hdr {
 	struct ieee80211_radiotap_header hdr;
 	u8 rate;
@@ -121,8 +120,6 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 		hdr->rate = 5; /* txrate->bitrate / 5; */
 	}
 
-
-
 	skb->dev = wilc_wfi_mon;
 	skb_set_mac_header(skb, 0);
 	skb->ip_summed = CHECKSUM_UNNECESSARY;
@@ -143,8 +140,6 @@ static void mgmt_tx_complete(void *priv, int status)
 	struct tx_complete_mon_data *pv_data = (struct tx_complete_mon_data *)priv;
 	u8 *buf =  pv_data->buff;
 
-
-
 	if (status == 1) {
 		if (INFO || buf[0] == 0x10 || buf[0] == 0xb0)
 			PRINT_INFO(HOSTAPD_DBG, "Packet sent successfully - Size = %d - Address = %p.\n", pv_data->size, pv_data->buff);
@@ -152,8 +147,6 @@ static void mgmt_tx_complete(void *priv, int status)
 		PRINT_INFO(HOSTAPD_DBG, "Couldn't send packet - Size = %d - Address = %p.\n", pv_data->size, pv_data->buff);
 	}
 
-
-
 	/* incase of fully hosting mode, the freeing will be done in response to the cfg packet */
 	kfree(pv_data->buff);
 
@@ -220,7 +213,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 		return -EFAULT;
 	}
 
-
 	rtap_len = ieee80211_get_radiotap_len(skb->data);
 	if (skb->len < rtap_len) {
 		PRINT_ER("Error in radiotap header\n");
@@ -273,8 +265,6 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 
 	PRINT_INFO(HOSTAPD_DBG, "Skipping the radiotap header\n");
 
-
-
 	/* actual deliver of data is device-specific, and not shown here */
 	PRINT_INFO(HOSTAPD_DBG, "SKB netdevice name = %s\n", skb->dev->name);
 	PRINT_INFO(HOSTAPD_DBG, "MONITOR real dev name = %s\n", mon_priv->real_ndev->name);
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 05/11] staging: wilc1000: linux_mon: fix NULL comparison style
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (2 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 04/11] staging: wilc1000: linux_mon: remove multiple blank lines Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 06/11] staging: wilc1000: linux_mon: remove space after a cast Chaehyun Lim
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

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 <chaehyun.lim@gmail.com>
---
 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()) {
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 06/11] staging: wilc1000: linux_mon: remove space after a cast
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (3 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 05/11] staging: wilc1000: linux_mon: fix NULL comparison style Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 07/11] staging: wilc1000: linux_mon: insert blank line after a function Chaehyun Lim
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch removes space after a type cast found by checkpatch.pl
CHECK: No space is necessary after a cast

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 7b9cc02..0c3dee3 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -80,7 +80,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 
 		memcpy(skb_put(skb, size), buff, size);
 
-		cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *) skb_push(skb, sizeof(*cb_hdr));
+		cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb, sizeof(*cb_hdr));
 		memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
 
 		cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
@@ -109,7 +109,7 @@ void WILC_WFI_monitor_rx(u8 *buff, u32 size)
 		}
 
 		memcpy(skb_put(skb, size), buff, size);
-		hdr = (struct wilc_wfi_radiotap_hdr *) skb_push(skb, sizeof(*hdr));
+		hdr = (struct wilc_wfi_radiotap_hdr *)skb_push(skb, sizeof(*hdr));
 		memset(hdr, 0, sizeof(struct wilc_wfi_radiotap_hdr));
 		hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
 		hdr->hdr.it_len = cpu_to_le16(sizeof(struct wilc_wfi_radiotap_hdr));
@@ -236,7 +236,7 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 
 		memcpy(skb_put(skb2, skb->len), skb->data, skb->len);
 
-		cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *) skb_push(skb2, sizeof(*cb_hdr));
+		cb_hdr = (struct wilc_wfi_radiotap_cb_hdr *)skb_push(skb2, sizeof(*cb_hdr));
 		memset(cb_hdr, 0, sizeof(struct wilc_wfi_radiotap_cb_hdr));
 
 		cb_hdr->hdr.it_version = 0; /* PKTHDR_RADIOTAP_VERSION; */
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 07/11] staging: wilc1000: linux_mon: insert blank line after a function
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (4 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 06/11] staging: wilc1000: linux_mon: remove space after a cast Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 08/11] staging: wilc1000: linux_mon: add braces on all arms of if statement Chaehyun Lim
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch inserts a blank line afer function found by checkpatch.pl
CHECK: Please use a blank line after function/struct/union/enum
declarations

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 0c3dee3..53d0caf 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -152,6 +152,7 @@ static void mgmt_tx_complete(void *priv, int status)
 
 	kfree(pv_data);
 }
+
 static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
 {
 	struct tx_complete_mon_data *mgmt_tx = NULL;
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 08/11] staging: wilc1000: linux_mon: add braces on all arms of if statement
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (5 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 07/11] staging: wilc1000: linux_mon: insert blank line after a function Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 09/11] staging: wilc1000: linux_mon: fix coding style of kmalloc usage Chaehyun Lim
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch adds braces on all arms of if statement found by
checkpatch.pl
CHECK: braces {} should be used on all arms of this statement

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 53d0caf..255383c 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -278,8 +278,9 @@ static netdev_tx_t WILC_WFI_mon_xmit(struct sk_buff *skb,
 	if (!(memcmp(srcAdd, bssid, 6))) {
 		mon_mgmt_tx(mon_priv->real_ndev, skb->data, skb->len);
 		dev_kfree_skb(skb);
-	} else
+	} else {
 		ret = wilc_mac_xmit(skb, mon_priv->real_ndev);
+	}
 
 	return ret;
 }
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 09/11] staging: wilc1000: linux_mon: fix coding style of kmalloc usage
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (6 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 08/11] staging: wilc1000: linux_mon: add braces on all arms of if statement Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 10/11] staging: wilc1000: linux_mon: fix error code of kmalloc Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 11/11] staging: wilc1000: linux_mon: remove debug message of kmalloc failure Chaehyun Lim
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch fixes coding style of kmalloc usage found by checkpatch.pl
CHECK: Prefer kmalloc(sizeof(*mgmt_tx)...) over kmalloc(sizeof(struct
tx_complete_mon_data)...)

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 255383c..a19755e 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -163,7 +163,7 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
 	}
 
 	netif_stop_queue(dev);
-	mgmt_tx = kmalloc(sizeof(struct tx_complete_mon_data), GFP_ATOMIC);
+	mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
 	if (!mgmt_tx) {
 		PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
 		return -EFAULT;
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 10/11] staging: wilc1000: linux_mon: fix error code of kmalloc
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (7 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 09/11] staging: wilc1000: linux_mon: fix coding style of kmalloc usage Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  2016-02-01 12:26 ` [PATCH 11/11] staging: wilc1000: linux_mon: remove debug message of kmalloc failure Chaehyun Lim
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

This patch fixes error codes as -ENOMEM instead of using -EFAULT if
kmalloc is failed.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index a19755e..1443a23 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -166,14 +166,14 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
 	mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
 	if (!mgmt_tx) {
 		PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
-		return -EFAULT;
+		return -ENOMEM;
 	}
 
 	mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
 	if (!mgmt_tx->buff) {
 		PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
 		kfree(mgmt_tx);
-		return -EFAULT;
+		return -ENOMEM;
 	}
 
 	mgmt_tx->size = len;
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 11/11] staging: wilc1000: linux_mon: remove debug message of kmalloc failure
  2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
                   ` (8 preceding siblings ...)
  2016-02-01 12:26 ` [PATCH 10/11] staging: wilc1000: linux_mon: fix error code of kmalloc Chaehyun Lim
@ 2016-02-01 12:26 ` Chaehyun Lim
  9 siblings, 0 replies; 11+ messages in thread
From: Chaehyun Lim @ 2016-02-01 12:26 UTC (permalink / raw)
  To: gregkh
  Cc: johnny.kim, austin.shin, chris.park, tony.cho, glen.lee, leo.kim,
	linux-wireless, devel, Chaehyun Lim

There is no need to print debug message when kmalloc is failed.
This message is redundant. The code already show us that kmalloc is
failed. The braces of first if statement is remove as well because if
statement has a single statement.

Signed-off-by: Chaehyun Lim <chaehyun.lim@gmail.com>
---
 drivers/staging/wilc1000/linux_mon.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/wilc1000/linux_mon.c b/drivers/staging/wilc1000/linux_mon.c
index 1443a23..e9bb0ec 100644
--- a/drivers/staging/wilc1000/linux_mon.c
+++ b/drivers/staging/wilc1000/linux_mon.c
@@ -164,14 +164,11 @@ static int mon_mgmt_tx(struct net_device *dev, const u8 *buf, size_t len)
 
 	netif_stop_queue(dev);
 	mgmt_tx = kmalloc(sizeof(*mgmt_tx), GFP_ATOMIC);
-	if (!mgmt_tx) {
-		PRINT_ER("Failed to allocate memory for mgmt_tx structure\n");
+	if (!mgmt_tx)
 		return -ENOMEM;
-	}
 
 	mgmt_tx->buff = kmalloc(len, GFP_ATOMIC);
 	if (!mgmt_tx->buff) {
-		PRINT_ER("Failed to allocate memory for mgmt_tx buff\n");
 		kfree(mgmt_tx);
 		return -ENOMEM;
 	}
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-02-01 12:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 12:26 [PATCH 01/11] staging: wilc1000: linux_mon: use __packed instead of __attribute__((packed)) Chaehyun Lim
2016-02-01 12:26 ` [PATCH 02/11] staging: wilc1000: linux_mon: remove blank lines after open brace '{' Chaehyun Lim
2016-02-01 12:26 ` [PATCH 03/11] staging: wilc1000: linux_mon: remove blank line before a close brace '}' Chaehyun Lim
2016-02-01 12:26 ` [PATCH 04/11] staging: wilc1000: linux_mon: remove multiple blank lines Chaehyun Lim
2016-02-01 12:26 ` [PATCH 05/11] staging: wilc1000: linux_mon: fix NULL comparison style Chaehyun Lim
2016-02-01 12:26 ` [PATCH 06/11] staging: wilc1000: linux_mon: remove space after a cast Chaehyun Lim
2016-02-01 12:26 ` [PATCH 07/11] staging: wilc1000: linux_mon: insert blank line after a function Chaehyun Lim
2016-02-01 12:26 ` [PATCH 08/11] staging: wilc1000: linux_mon: add braces on all arms of if statement Chaehyun Lim
2016-02-01 12:26 ` [PATCH 09/11] staging: wilc1000: linux_mon: fix coding style of kmalloc usage Chaehyun Lim
2016-02-01 12:26 ` [PATCH 10/11] staging: wilc1000: linux_mon: fix error code of kmalloc Chaehyun Lim
2016-02-01 12:26 ` [PATCH 11/11] staging: wilc1000: linux_mon: remove debug message of kmalloc failure Chaehyun Lim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.