All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers
@ 2017-09-22 12:13 Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned Stefan Schmidt
                   ` (14 more replies)
  0 siblings, 15 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Hello.

This patchset works through various warnings and errors reported from checkpatch
on all ieee802154 drivers. Testing and ACKs from the repective driver
maintainers would be appreciated.

Stefan Schmidt (14):
  ieee802154: adf7242: use unsigned int over only unsigned
  ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
  ieee802154: at86rf230: use __func__ macro for debug messages
  ieee802154: atusb: switch from uint8_t to u8
  ieee802154: atusb: use __func__ macro for debug messages
  ieee802154: atusb: fix some kernel coding style errors
  ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem
  ieee802154: mrf24j40: fix some kernel coding style errors
  ieee802154: ca8210: fix some kernel coding style errors
  ieee802154: ca8210: use __func__ macro for debug messages
  ieee802154: cc2520: fix some kernel coding style errors
  ieee802154: cc2520: use __func__ macro for debug messages
  ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem
  ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem

 drivers/net/ieee802154/adf7242.c   |  8 ++--
 drivers/net/ieee802154/at86rf230.c | 15 +++-----
 drivers/net/ieee802154/atusb.c     | 77 +++++++++++++++++++-------------------
 drivers/net/ieee802154/ca8210.c    | 20 +++++-----
 drivers/net/ieee802154/cc2520.c    | 21 +++++------
 drivers/net/ieee802154/fakelb.c    |  2 +-
 drivers/net/ieee802154/mrf24j40.c  | 18 +++++----
 7 files changed, 79 insertions(+), 82 deletions(-)

regards
Stefan Schmidt
-- 
2.13.5


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

* [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-11-06 15:37   ` Michael Hennerich
  2017-09-22 12:13 ` [PATCH 02/14] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
                   ` (13 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Bring it in line with the rest of the ieee802154 drivers.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/adf7242.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
index 3e4c8b21403c..400fdbd3a120 100644
--- a/drivers/net/ieee802154/adf7242.c
+++ b/drivers/net/ieee802154/adf7242.c
@@ -311,8 +311,8 @@ static int adf7242_status(struct adf7242_local *lp, u8 *stat)
 	return status;
 }
 
-static int adf7242_wait_status(struct adf7242_local *lp, unsigned status,
-			       unsigned mask, int line)
+static int adf7242_wait_status(struct adf7242_local *lp, unsigned int status,
+			       unsigned int mask, int line)
 {
 	int cnt = 0, ret = 0;
 	u8 stat;
@@ -477,7 +477,7 @@ static int adf7242_write_reg(struct adf7242_local *lp, u16 addr, u8 data)
 	return status;
 }
 
-static int adf7242_cmd(struct adf7242_local *lp, unsigned cmd)
+static int adf7242_cmd(struct adf7242_local *lp, unsigned int cmd)
 {
 	int status;
 
@@ -920,7 +920,7 @@ static void adf7242_debug(u8 irq1)
 static irqreturn_t adf7242_isr(int irq, void *data)
 {
 	struct adf7242_local *lp = data;
-	unsigned xmit;
+	unsigned int xmit;
 	u8 irq1;
 
 	adf7242_wait_status(lp, RC_STATUS_PHY_RDY, RC_STATUS_MASK, __LINE__);
-- 
2.13.5


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

* [PATCH 02/14] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 03/14] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
                   ` (12 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/at86rf230.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index 548d9d026a85..ea1704a4b4b9 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -940,7 +940,7 @@ at86rf230_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
 static int
 at86rf230_ed(struct ieee802154_hw *hw, u8 *level)
 {
-	BUG_ON(!level);
+	WARN_ON(!level);
 	*level = 0xbe;
 	return 0;
 }
-- 
2.13.5


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

* [PATCH 03/14] ieee802154: at86rf230: use __func__ macro for debug messages
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 02/14] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8 Stefan Schmidt
                   ` (11 subsequent siblings)
  14 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Instead of having the function name hard-coded (it might change and we
forgot to update them in the debug output) we can use __func__ instead
and also shorter the line so we do not need to break it. Also fix an
extra blank line while being here.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/at86rf230.c | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c
index ea1704a4b4b9..5c48bdb6f678 100644
--- a/drivers/net/ieee802154/at86rf230.c
+++ b/drivers/net/ieee802154/at86rf230.c
@@ -1121,8 +1121,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
 	if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
 		u16 addr = le16_to_cpu(filt->short_addr);
 
-		dev_vdbg(&lp->spi->dev,
-			 "at86rf230_set_hw_addr_filt called for saddr\n");
+		dev_vdbg(&lp->spi->dev, "%s called for saddr\n", __func__);
 		__at86rf230_write(lp, RG_SHORT_ADDR_0, addr);
 		__at86rf230_write(lp, RG_SHORT_ADDR_1, addr >> 8);
 	}
@@ -1130,8 +1129,7 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
 	if (changed & IEEE802154_AFILT_PANID_CHANGED) {
 		u16 pan = le16_to_cpu(filt->pan_id);
 
-		dev_vdbg(&lp->spi->dev,
-			 "at86rf230_set_hw_addr_filt called for pan id\n");
+		dev_vdbg(&lp->spi->dev, "%s called for pan id\n", __func__);
 		__at86rf230_write(lp, RG_PAN_ID_0, pan);
 		__at86rf230_write(lp, RG_PAN_ID_1, pan >> 8);
 	}
@@ -1140,15 +1138,13 @@ at86rf230_set_hw_addr_filt(struct ieee802154_hw *hw,
 		u8 i, addr[8];
 
 		memcpy(addr, &filt->ieee_addr, 8);
-		dev_vdbg(&lp->spi->dev,
-			 "at86rf230_set_hw_addr_filt called for IEEE addr\n");
+		dev_vdbg(&lp->spi->dev, "%s called for IEEE addr\n", __func__);
 		for (i = 0; i < 8; i++)
 			__at86rf230_write(lp, RG_IEEE_ADDR_0 + i, addr[i]);
 	}
 
 	if (changed & IEEE802154_AFILT_PANC_CHANGED) {
-		dev_vdbg(&lp->spi->dev,
-			 "at86rf230_set_hw_addr_filt called for panc change\n");
+		dev_vdbg(&lp->spi->dev, "%s called for panc change\n", __func__);
 		if (filt->pan_coord)
 			at86rf230_write_subreg(lp, SR_AACK_I_AM_COORD, 1);
 		else
@@ -1252,7 +1248,6 @@ at86rf230_set_cca_mode(struct ieee802154_hw *hw,
 	return at86rf230_write_subreg(lp, SR_CCA_MODE, val);
 }
 
-
 static int
 at86rf230_set_cca_ed_level(struct ieee802154_hw *hw, s32 mbm)
 {
-- 
2.13.5


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

* [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (2 preceding siblings ...)
  2017-09-22 12:13 ` [PATCH 03/14] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-11-06 15:35   ` Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages Stefan Schmidt
                   ` (10 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Switch top the preferred kernel type naming.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/atusb.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 115fa3f37a86..a4a326933977 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -63,7 +63,7 @@ struct atusb {
 	struct usb_ctrlrequest tx_dr;
 	struct urb *tx_urb;
 	struct sk_buff *tx_skb;
-	uint8_t tx_ack_seq;		/* current TX ACK sequence number */
+	u8 tx_ack_seq;		/* current TX ACK sequence number */
 
 	/* Firmware variable */
 	unsigned char fw_ver_maj;	/* Firmware major version number */
@@ -107,7 +107,7 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
 	return ret;
 }
 
-static int atusb_command(struct atusb *atusb, uint8_t cmd, uint8_t arg)
+static int atusb_command(struct atusb *atusb, u8 cmd, u8 arg)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
 
@@ -116,7 +116,7 @@ static int atusb_command(struct atusb *atusb, uint8_t cmd, uint8_t arg)
 				 cmd, ATUSB_REQ_TO_DEV, arg, 0, NULL, 0, 1000);
 }
 
-static int atusb_write_reg(struct atusb *atusb, uint8_t reg, uint8_t value)
+static int atusb_write_reg(struct atusb *atusb, u8 reg, u8 value)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
 
@@ -127,12 +127,12 @@ static int atusb_write_reg(struct atusb *atusb, uint8_t reg, uint8_t value)
 				 value, reg, NULL, 0, 1000);
 }
 
-static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
+static int atusb_read_reg(struct atusb *atusb, u8 reg)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
 	int ret;
-	uint8_t *buffer;
-	uint8_t value;
+	u8 *buffer;
+	u8 value;
 
 	buffer = kmalloc(1, GFP_KERNEL);
 	if (!buffer)
@@ -153,11 +153,11 @@ static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
 	}
 }
 
-static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask,
-			      uint8_t shift, uint8_t value)
+static int atusb_write_subreg(struct atusb *atusb, u8 reg, u8 mask,
+			      u8 shift, u8 value)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
-	uint8_t orig, tmp;
+	u8 orig, tmp;
 	int ret = 0;
 
 	dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
@@ -263,10 +263,10 @@ static void atusb_work_urbs(struct work_struct *work)
 
 /* ----- Asynchronous USB -------------------------------------------------- */
 
-static void atusb_tx_done(struct atusb *atusb, uint8_t seq)
+static void atusb_tx_done(struct atusb *atusb, u8 seq)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
-	uint8_t expect = atusb->tx_ack_seq;
+	u8 expect = atusb->tx_ack_seq;
 
 	dev_dbg(&usb_dev->dev, "atusb_tx_done (0x%02x/0x%02x)\n", seq, expect);
 	if (seq == expect) {
@@ -289,7 +289,7 @@ static void atusb_in_good(struct urb *urb)
 	struct usb_device *usb_dev = urb->dev;
 	struct sk_buff *skb = urb->context;
 	struct atusb *atusb = SKB_ATUSB(skb);
-	uint8_t len, lqi;
+	u8 len, lqi;
 
 	if (!urb->actual_length) {
 		dev_dbg(&usb_dev->dev, "atusb_in: zero-sized URB ?\n");
@@ -882,7 +882,7 @@ static int atusb_get_and_show_build(struct atusb *atusb)
 static int atusb_get_and_conf_chip(struct atusb *atusb)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
-	uint8_t man_id_0, man_id_1, part_num, version_num;
+	u8 man_id_0, man_id_1, part_num, version_num;
 	const char *chip;
 	struct ieee802154_hw *hw = atusb->hw;
 
-- 
2.13.5


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

* [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (3 preceding siblings ...)
  2017-09-22 12:13 ` [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8 Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-11-06 15:35   ` Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors Stefan Schmidt
                   ` (9 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Instead of having the function name hard-coded (it might change and we
forgot to update them in the debug output) we can use __func__ instead
and also shorter the line so we do not need to break it.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/atusb.c | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index a4a326933977..bb02e37257cf 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -101,8 +101,8 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
 	if (ret < 0) {
 		atusb->err = ret;
 		dev_err(&usb_dev->dev,
-			"atusb_control_msg: req 0x%02x val 0x%x idx 0x%x, error %d\n",
-			request, value, index, ret);
+			"%s: req 0x%02x val 0x%x idx 0x%x, error %d\n",
+			__func__, request, value, index, ret);
 	}
 	return ret;
 }
@@ -111,7 +111,7 @@ static int atusb_command(struct atusb *atusb, u8 cmd, u8 arg)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
 
-	dev_dbg(&usb_dev->dev, "atusb_command: cmd = 0x%x\n", cmd);
+	dev_dbg(&usb_dev->dev, "%s: cmd = 0x%x\n", __func__, cmd);
 	return atusb_control_msg(atusb, usb_sndctrlpipe(usb_dev, 0),
 				 cmd, ATUSB_REQ_TO_DEV, arg, 0, NULL, 0, 1000);
 }
@@ -120,8 +120,7 @@ static int atusb_write_reg(struct atusb *atusb, u8 reg, u8 value)
 {
 	struct usb_device *usb_dev = atusb->usb_dev;
 
-	dev_dbg(&usb_dev->dev, "atusb_write_reg: 0x%02x <- 0x%02x\n",
-		reg, value);
+	dev_dbg(&usb_dev->dev, "%s: 0x%02x <- 0x%02x\n", __func__, reg, value);
 	return atusb_control_msg(atusb, usb_sndctrlpipe(usb_dev, 0),
 				 ATUSB_REG_WRITE, ATUSB_REQ_TO_DEV,
 				 value, reg, NULL, 0, 1000);
@@ -138,7 +137,7 @@ static int atusb_read_reg(struct atusb *atusb, u8 reg)
 	if (!buffer)
 		return -ENOMEM;
 
-	dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
+	dev_dbg(&usb_dev->dev, "%s: reg = 0x%x\n", __func__, reg);
 	ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
 				ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
 				0, reg, buffer, 1, 1000);
@@ -160,8 +159,7 @@ static int atusb_write_subreg(struct atusb *atusb, u8 reg, u8 mask,
 	u8 orig, tmp;
 	int ret = 0;
 
-	dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
-		reg, value);
+	dev_dbg(&usb_dev->dev, "%s: 0x%02x <- 0x%02x\n", __func__, reg, value);
 
 	orig = atusb_read_reg(atusb, reg);
 
@@ -268,7 +266,7 @@ static void atusb_tx_done(struct atusb *atusb, u8 seq)
 	struct usb_device *usb_dev = atusb->usb_dev;
 	u8 expect = atusb->tx_ack_seq;
 
-	dev_dbg(&usb_dev->dev, "atusb_tx_done (0x%02x/0x%02x)\n", seq, expect);
+	dev_dbg(&usb_dev->dev, "%s (0x%02x/0x%02x)\n", __func__, seq, expect);
 	if (seq == expect) {
 		/* TODO check for ifs handling in firmware */
 		ieee802154_xmit_complete(atusb->hw, atusb->tx_skb, false);
@@ -328,7 +326,7 @@ static void atusb_in(struct urb *urb)
 	struct sk_buff *skb = urb->context;
 	struct atusb *atusb = SKB_ATUSB(skb);
 
-	dev_dbg(&usb_dev->dev, "atusb_in: status %d len %d\n",
+	dev_dbg(&usb_dev->dev, "%s: status %d len %d\n", __func__,
 		urb->status, urb->actual_length);
 	if (urb->status) {
 		if (urb->status == -ENOENT) { /* being killed */
@@ -336,7 +334,7 @@ static void atusb_in(struct urb *urb)
 			urb->context = NULL;
 			return;
 		}
-		dev_dbg(&usb_dev->dev, "atusb_in: URB error %d\n", urb->status);
+		dev_dbg(&usb_dev->dev, "%s: URB error %d\n", __func__, urb->status);
 	} else {
 		atusb_in_good(urb);
 	}
@@ -390,7 +388,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
 	struct usb_device *usb_dev = atusb->usb_dev;
 	int ret;
 
-	dev_dbg(&usb_dev->dev, "atusb_xmit (%d)\n", skb->len);
+	dev_dbg(&usb_dev->dev, "%s (%d)\n", __func__, skb->len);
 	atusb->tx_skb = skb;
 	atusb->tx_ack_seq++;
 	atusb->tx_dr.wIndex = cpu_to_le16(atusb->tx_ack_seq);
@@ -401,7 +399,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
 			     (unsigned char *)&atusb->tx_dr, skb->data,
 			     skb->len, atusb_xmit_complete, NULL);
 	ret = usb_submit_urb(atusb->tx_urb, GFP_ATOMIC);
-	dev_dbg(&usb_dev->dev, "atusb_xmit done (%d)\n", ret);
+	dev_dbg(&usb_dev->dev, "%s done (%d)\n", __func__, ret);
 	return ret;
 }
 
@@ -422,7 +420,7 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
 	if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
 		u16 addr = le16_to_cpu(filt->short_addr);
 
-		dev_vdbg(dev, "atusb_set_hw_addr_filt called for saddr\n");
+		dev_vdbg(dev, "%s called for saddr\n", __func__);
 		atusb_write_reg(atusb, RG_SHORT_ADDR_0, addr);
 		atusb_write_reg(atusb, RG_SHORT_ADDR_1, addr >> 8);
 	}
@@ -430,7 +428,7 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
 	if (changed & IEEE802154_AFILT_PANID_CHANGED) {
 		u16 pan = le16_to_cpu(filt->pan_id);
 
-		dev_vdbg(dev, "atusb_set_hw_addr_filt called for pan id\n");
+		dev_vdbg(dev, "%s called for pan id\n", __func__);
 		atusb_write_reg(atusb, RG_PAN_ID_0, pan);
 		atusb_write_reg(atusb, RG_PAN_ID_1, pan >> 8);
 	}
@@ -439,14 +437,13 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
 		u8 i, addr[IEEE802154_EXTENDED_ADDR_LEN];
 
 		memcpy(addr, &filt->ieee_addr, IEEE802154_EXTENDED_ADDR_LEN);
-		dev_vdbg(dev, "atusb_set_hw_addr_filt called for IEEE addr\n");
+		dev_vdbg(dev, "%s called for IEEE addr\n", __func__);
 		for (i = 0; i < 8; i++)
 			atusb_write_reg(atusb, RG_IEEE_ADDR_0 + i, addr[i]);
 	}
 
 	if (changed & IEEE802154_AFILT_PANC_CHANGED) {
-		dev_vdbg(dev,
-			 "atusb_set_hw_addr_filt called for panc change\n");
+		dev_vdbg(dev, "%s called for panc change\n", __func__);
 		if (filt->pan_coord)
 			atusb_write_subreg(atusb, SR_AACK_I_AM_COORD, 1);
 		else
@@ -462,7 +459,7 @@ static int atusb_start(struct ieee802154_hw *hw)
 	struct usb_device *usb_dev = atusb->usb_dev;
 	int ret;
 
-	dev_dbg(&usb_dev->dev, "atusb_start\n");
+	dev_dbg(&usb_dev->dev, "%s\n", __func__);
 	schedule_delayed_work(&atusb->work, 0);
 	atusb_command(atusb, ATUSB_RX_MODE, 1);
 	ret = atusb_get_and_clear_error(atusb);
@@ -476,7 +473,7 @@ static void atusb_stop(struct ieee802154_hw *hw)
 	struct atusb *atusb = hw->priv;
 	struct usb_device *usb_dev = atusb->usb_dev;
 
-	dev_dbg(&usb_dev->dev, "atusb_stop\n");
+	dev_dbg(&usb_dev->dev, "%s\n", __func__);
 	usb_kill_anchored_urbs(&atusb->idle_urbs);
 	atusb_command(atusb, ATUSB_RX_MODE, 0);
 	atusb_get_and_clear_error(atusb);
@@ -1131,7 +1128,7 @@ static void atusb_disconnect(struct usb_interface *interface)
 {
 	struct atusb *atusb = usb_get_intfdata(interface);
 
-	dev_dbg(&atusb->usb_dev->dev, "atusb_disconnect\n");
+	dev_dbg(&atusb->usb_dev->dev, "%s\n", __func__);
 
 	atusb->shutdown = 1;
 	cancel_delayed_work_sync(&atusb->work);
@@ -1148,7 +1145,7 @@ static void atusb_disconnect(struct usb_interface *interface)
 	usb_set_intfdata(interface, NULL);
 	usb_put_dev(atusb->usb_dev);
 
-	pr_debug("atusb_disconnect done\n");
+	pr_debug("%s done\n", __func__);
 }
 
 /* The devices we work with */
-- 
2.13.5


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

* [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (4 preceding siblings ...)
  2017-09-22 12:13 ` [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-11-06 15:36   ` Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
                   ` (8 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Fix a long line, wrong comment format and misaligned indent.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/atusb.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index bb02e37257cf..13d8ee5df094 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -841,7 +841,8 @@ static int atusb_get_and_show_revision(struct atusb *atusb)
 
 		dev_info(&usb_dev->dev,
 			 "Firmware: major: %u, minor: %u, hardware type: %s (%d)\n",
-			 atusb->fw_ver_maj, atusb->fw_ver_min, hw_name, atusb->fw_hw_type);
+			 atusb->fw_ver_maj, atusb->fw_ver_min, hw_name,
+			 atusb->fw_hw_type);
 	}
 	if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 2) {
 		dev_info(&usb_dev->dev,
@@ -976,7 +977,8 @@ static int atusb_set_extended_addr(struct atusb *atusb)
 	int ret;
 
 	/* Firmware versions before 0.3 do not support the EUI64_READ command.
-	 * Just use a random address and be done */
+	 * Just use a random address and be done.
+	 */
 	if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 3) {
 		ieee802154_random_extended_addr(&atusb->hw->phy->perm_extended_addr);
 		return 0;
@@ -1006,7 +1008,7 @@ static int atusb_set_extended_addr(struct atusb *atusb)
 		atusb->hw->phy->perm_extended_addr = extended_addr;
 		addr = swab64((__force u64)atusb->hw->phy->perm_extended_addr);
 		dev_info(&usb_dev->dev, "Read permanent extended address %8phC from device\n",
-			&addr);
+			 &addr);
 	}
 
 	kfree(buffer);
-- 
2.13.5


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

* [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (5 preceding siblings ...)
  2017-09-22 12:13 ` [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-11-06 15:36   ` Stefan Schmidt
  2017-09-22 12:13 ` [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors Stefan Schmidt
                   ` (7 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/atusb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
index 13d8ee5df094..99d40617dc79 100644
--- a/drivers/net/ieee802154/atusb.c
+++ b/drivers/net/ieee802154/atusb.c
@@ -405,7 +405,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
 
 static int atusb_ed(struct ieee802154_hw *hw, u8 *level)
 {
-	BUG_ON(!level);
+	WARN_ON(!level);
 	*level = 0xbe;
 	return 0;
 }
-- 
2.13.5


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

* [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (6 preceding siblings ...)
  2017-09-22 12:13 ` [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2017-09-22 12:13 ` Stefan Schmidt
  2017-09-22 14:12   ` Alan Ott
  2017-09-22 12:14 ` [PATCH 09/14] ieee802154: ca8210: " Stefan Schmidt
                   ` (6 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:13 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Fix format of multi-line comments and long lines.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/mrf24j40.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
index ee7084b2d52d..e951a191e15d 100644
--- a/drivers/net/ieee802154/mrf24j40.c
+++ b/drivers/net/ieee802154/mrf24j40.c
@@ -569,8 +569,9 @@ static void write_tx_buf_complete(void *context)
 }
 
 /* This function relies on an undocumented write method. Once a write command
-   and address is set, as many bytes of data as desired can be clocked into
-   the device. The datasheet only shows setting one byte at a time. */
+ * and address is set, as many bytes of data as desired can be clocked into
+ * the device. The datasheet only shows setting one byte at a time.
+ */
 static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
 			const u8 *data, size_t length)
 {
@@ -578,9 +579,10 @@ static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
 	int ret;
 
 	/* Range check the length. 2 bytes are used for the length fields.*/
-	if (length > TX_FIFO_SIZE-2) {
-		dev_err(printdev(devrec), "write_tx_buf() was passed too large a buffer. Performing short write.\n");
-		length = TX_FIFO_SIZE-2;
+	if (length > TX_FIFO_SIZE - 2) {
+		dev_err(printdev(devrec), "%s: passed buffer to large, short write\n",
+			__func__);
+		length = TX_FIFO_SIZE - 2;
 	}
 
 	cmd = MRF24J40_WRITELONG(reg);
@@ -1073,7 +1075,8 @@ static int mrf24j40_hw_init(struct mrf24j40 *devrec)
 	int ret;
 
 	/* Initialize the device.
-		From datasheet section 3.2: Initialization. */
+	 * From datasheet section 3.2: Initialization.
+	 */
 	ret = regmap_write(devrec->regmap_short, REG_SOFTRST, 0x07);
 	if (ret)
 		goto err_ret;
@@ -1374,7 +1377,8 @@ static int mrf24j40_remove(struct spi_device *spi)
 	ieee802154_unregister_hw(devrec->hw);
 	ieee802154_free_hw(devrec->hw);
 	/* TODO: Will ieee802154_free_device() wait until ->xmit() is
-	 * complete? */
+	 * complete?
+	 */
 
 	return 0;
 }
-- 
2.13.5


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

* [PATCH 09/14] ieee802154: ca8210: fix some kernel coding style errors
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (7 preceding siblings ...)
  2017-09-22 12:13 ` [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors Stefan Schmidt
@ 2017-09-22 12:14 ` Stefan Schmidt
  2017-11-06 15:27   ` Harry Morris
  2017-09-22 12:14 ` [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages Stefan Schmidt
                   ` (5 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:14 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Remove unneeded parentheses and fix format for pointer style.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/ca8210.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 24a1eabbbc9d..66829055aa8b 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -1303,7 +1303,7 @@ static u8 tdme_checkpibattribute(
 		break;
 	/* MAC */
 	case MAC_BATT_LIFE_EXT_PERIODS:
-		if ((value < 6) || (value > 41))
+		if (value < 6 || value > 41)
 			status = MAC_INVALID_PARAMETER;
 		break;
 	case MAC_BEACON_PAYLOAD:
@@ -1319,7 +1319,7 @@ static u8 tdme_checkpibattribute(
 			status = MAC_INVALID_PARAMETER;
 		break;
 	case MAC_MAX_BE:
-		if ((value < 3) || (value > 8))
+		if (value < 3 || value > 8)
 			status = MAC_INVALID_PARAMETER;
 		break;
 	case MAC_MAX_CSMA_BACKOFFS:
@@ -1335,7 +1335,7 @@ static u8 tdme_checkpibattribute(
 			status = MAC_INVALID_PARAMETER;
 		break;
 	case MAC_RESPONSE_WAIT_TIME:
-		if ((value < 2) || (value > 64))
+		if (value < 2 || value > 64)
 			status = MAC_INVALID_PARAMETER;
 		break;
 	case MAC_SUPERFRAME_ORDER:
@@ -1511,7 +1511,7 @@ static u8 mcps_data_request(
 	psec = (struct secspec *)(command.pdata.data_req.msdu + msdu_length);
 	command.length = sizeof(struct mcps_data_request_pset) -
 		MAX_DATA_SIZE + msdu_length;
-	if (!security || (security->security_level == 0)) {
+	if (!security || security->security_level == 0) {
 		psec->security_level = 0;
 		command.length += 1;
 	} else {
@@ -1561,7 +1561,7 @@ static u8 mlme_reset_request_sync(
 	status = response.pdata.status;
 
 	/* reset COORD Bit for Channel Filtering as Coordinator */
-	if (CA8210_MAC_WORKAROUNDS && set_default_pib && (!status)) {
+	if (CA8210_MAC_WORKAROUNDS && set_default_pib && !status) {
 		status = tdme_setsfr_request_sync(
 			0,
 			CA8210_SFR_MACCON,
@@ -2369,7 +2369,7 @@ static int ca8210_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
 		MAC_PROMISCUOUS_MODE,
 		0,
 		1,
-		(const void*)&on,
+		(const void *)&on,
 		priv->spi
 	);
 	if (status) {
-- 
2.13.5


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

* [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (8 preceding siblings ...)
  2017-09-22 12:14 ` [PATCH 09/14] ieee802154: ca8210: " Stefan Schmidt
@ 2017-09-22 12:14 ` Stefan Schmidt
  2017-11-06 15:32   ` Harry Morris
  2017-09-22 12:14 ` [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors Stefan Schmidt
                   ` (4 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:14 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Instead of having the function name hard-coded (it might change and we
forgot to update them in the debug output) we can use __func__ instead
and also shorter the line so we do not need to break it.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/ca8210.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
index 66829055aa8b..26e04c9176a4 100644
--- a/drivers/net/ieee802154/ca8210.c
+++ b/drivers/net/ieee802154/ca8210.c
@@ -924,7 +924,7 @@ static int ca8210_spi_transfer(
 	priv = spi_get_drvdata(spi);
 	reinit_completion(&priv->spi_transfer_complete);
 
-	dev_dbg(&spi->dev, "ca8210_spi_transfer called\n");
+	dev_dbg(&spi->dev, "%s called\n", __func__);
 
 	cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
 	if (!cas_ctl)
@@ -1898,7 +1898,7 @@ static int ca8210_net_rx(struct ieee802154_hw *hw, u8 *command, size_t len)
 	unsigned long flags;
 	u8 status;
 
-	dev_dbg(&priv->spi->dev, "ca8210_net_rx(), CmdID = %d\n", command[0]);
+	dev_dbg(&priv->spi->dev, "%s: CmdID = %d\n", __func__, command[0]);
 
 	if (command[0] == SPI_MCPS_DATA_INDICATION) {
 		/* Received data */
@@ -1948,7 +1948,7 @@ static int ca8210_skb_tx(
 	struct secspec secspec;
 	unsigned int mac_len;
 
-	dev_dbg(&priv->spi->dev, "ca8210_skb_tx() called\n");
+	dev_dbg(&priv->spi->dev, "%s called\n", __func__);
 
 	/* Get addressing info from skb - ieee802154 layer creates a full
 	 * packet
@@ -2051,7 +2051,7 @@ static int ca8210_xmit_async(struct ieee802154_hw *hw, struct sk_buff *skb)
 	struct ca8210_priv *priv = hw->priv;
 	int status;
 
-	dev_dbg(&priv->spi->dev, "calling ca8210_xmit_async()\n");
+	dev_dbg(&priv->spi->dev, "calling %s\n", __func__);
 
 	priv->tx_skb = skb;
 	priv->async_tx_pending = true;
-- 
2.13.5


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

* [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (9 preceding siblings ...)
  2017-09-22 12:14 ` [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages Stefan Schmidt
@ 2017-09-22 12:14 ` Stefan Schmidt
  2017-11-06 15:34   ` Stefan Schmidt
  2017-09-22 12:14 ` [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages Stefan Schmidt
                   ` (3 subsequent siblings)
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:14 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Fix some spacing and needed new line.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/cc2520.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index d50add705a79..9c1d1768a36f 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -648,7 +648,7 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
 	BUG_ON(channel > CC2520_MAXCHANNEL);
 
 	ret = cc2520_write_register(priv, CC2520_FREQCTRL,
-				    11 + 5*(channel - 11));
+				    11 + 5 * (channel - 11));
 
 	return ret;
 }
@@ -929,6 +929,7 @@ static int cc2520_get_platform_data(struct spi_device *spi,
 
 	if (!np) {
 		struct cc2520_platform_data *spi_pdata = spi->dev.platform_data;
+
 		if (!spi_pdata)
 			return -ENOENT;
 		*pdata = *spi_pdata;
-- 
2.13.5


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

* [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (10 preceding siblings ...)
  2017-09-22 12:14 ` [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors Stefan Schmidt
@ 2017-09-22 12:14 ` Stefan Schmidt
       [not found]   ` <CAEUmHyZ1oaMjqzMHgNtMg+S2cmq2DvvgAkxBsP6-dkzYp0KyOw@mail.gmail.com>
  2017-11-06 15:34   ` Stefan Schmidt
  2017-09-22 12:14 ` [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
                   ` (2 subsequent siblings)
  14 siblings, 2 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:14 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

Instead of having the function name hard-coded (it might change and we
forgot to update them in the debug output) we can use __func__ instead
and also shorter the line so we do not need to break it.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/cc2520.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index 9c1d1768a36f..735b9f5f9754 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -663,15 +663,14 @@ cc2520_filter(struct ieee802154_hw *hw,
 	if (changed & IEEE802154_AFILT_PANID_CHANGED) {
 		u16 panid = le16_to_cpu(filt->pan_id);
 
-		dev_vdbg(&priv->spi->dev,
-			 "cc2520_filter called for pan id\n");
+		dev_vdbg(&priv->spi->dev, "%s called for pan id\n", __func__);
 		ret = cc2520_write_ram(priv, CC2520RAM_PANID,
 				       sizeof(panid), (u8 *)&panid);
 	}
 
 	if (changed & IEEE802154_AFILT_IEEEADDR_CHANGED) {
 		dev_vdbg(&priv->spi->dev,
-			 "cc2520_filter called for IEEE addr\n");
+			 "%s called for IEEE addr\n", __func__);
 		ret = cc2520_write_ram(priv, CC2520RAM_IEEEADDR,
 				       sizeof(filt->ieee_addr),
 				       (u8 *)&filt->ieee_addr);
@@ -680,8 +679,7 @@ cc2520_filter(struct ieee802154_hw *hw,
 	if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
 		u16 addr = le16_to_cpu(filt->short_addr);
 
-		dev_vdbg(&priv->spi->dev,
-			 "cc2520_filter called for saddr\n");
+		dev_vdbg(&priv->spi->dev, "%s called for saddr\n", __func__);
 		ret = cc2520_write_ram(priv, CC2520RAM_SHORTADDR,
 				       sizeof(addr), (u8 *)&addr);
 	}
@@ -690,7 +688,7 @@ cc2520_filter(struct ieee802154_hw *hw,
 		u8 frmfilt0;
 
 		dev_vdbg(&priv->spi->dev,
-			 "cc2520_filter called for panc change\n");
+			 "%s called for panc change\n", __func__);
 
 		cc2520_read_register(priv, CC2520_FRMFILT0, &frmfilt0);
 
-- 
2.13.5


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

* [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (11 preceding siblings ...)
  2017-09-22 12:14 ` [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages Stefan Schmidt
@ 2017-09-22 12:14 ` Stefan Schmidt
  2017-11-06 15:32   ` Stefan Schmidt
  2017-09-22 12:14 ` [PATCH 14/14] ieee802154: fakelb: " Stefan Schmidt
  2017-11-06 14:25 ` [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
  14 siblings, 1 reply; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:14 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/cc2520.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
index 735b9f5f9754..0c89d3edf901 100644
--- a/drivers/net/ieee802154/cc2520.c
+++ b/drivers/net/ieee802154/cc2520.c
@@ -517,7 +517,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
 	}
 
 	spin_lock_irqsave(&priv->lock, flags);
-	BUG_ON(priv->is_tx);
+	WARN_ON(priv->is_tx);
 	priv->is_tx = 1;
 	spin_unlock_irqrestore(&priv->lock, flags);
 
@@ -643,9 +643,9 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
 
 	dev_dbg(&priv->spi->dev, "trying to set channel\n");
 
-	BUG_ON(page != 0);
-	BUG_ON(channel < CC2520_MINCHANNEL);
-	BUG_ON(channel > CC2520_MAXCHANNEL);
+	WARN_ON(page != 0);
+	WARN_ON(channel < CC2520_MINCHANNEL);
+	WARN_ON(channel > CC2520_MAXCHANNEL);
 
 	ret = cc2520_write_register(priv, CC2520_FREQCTRL,
 				    11 + 5 * (channel - 11));
-- 
2.13.5


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

* [PATCH 14/14] ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (12 preceding siblings ...)
  2017-09-22 12:14 ` [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2017-09-22 12:14 ` Stefan Schmidt
  2017-11-06 14:25 ` [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
  14 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 12:14 UTC (permalink / raw)
  To: linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan, Stefan Schmidt

The check is valid but it does not warrant to crash the kernel. A
WARN_ON() is good enough here.
Found by checkpatch.

Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
---
 drivers/net/ieee802154/fakelb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ieee802154/fakelb.c b/drivers/net/ieee802154/fakelb.c
index 0d673f7682ee..176395e4b7bb 100644
--- a/drivers/net/ieee802154/fakelb.c
+++ b/drivers/net/ieee802154/fakelb.c
@@ -49,7 +49,7 @@ struct fakelb_phy {
 
 static int fakelb_hw_ed(struct ieee802154_hw *hw, u8 *level)
 {
-	BUG_ON(!level);
+	WARN_ON(!level);
 	*level = 0xbe;
 
 	return 0;
-- 
2.13.5


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

* Re: [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors
  2017-09-22 12:13 ` [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors Stefan Schmidt
@ 2017-09-22 14:12   ` Alan Ott
  2017-09-22 14:38     ` Stefan Schmidt
  0 siblings, 1 reply; 32+ messages in thread
From: Alan Ott @ 2017-09-22 14:12 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev, varkabhadram

Hi Stefan, it's good to hear from you.

On 09/22/2017 08:13 AM, Stefan Schmidt wrote:
> Fix format of multi-line comments and long lines.
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>

Overall, it's pretty churny. More below:

> ---
>  drivers/net/ieee802154/mrf24j40.c | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
> index ee7084b2d52d..e951a191e15d 100644
> --- a/drivers/net/ieee802154/mrf24j40.c
> +++ b/drivers/net/ieee802154/mrf24j40.c
> @@ -569,8 +569,9 @@ static void write_tx_buf_complete(void *context)
>  }
>
>  /* This function relies on an undocumented write method. Once a write command
> -   and address is set, as many bytes of data as desired can be clocked into
> -   the device. The datasheet only shows setting one byte at a time. */
> + * and address is set, as many bytes of data as desired can be clocked into
> + * the device. The datasheet only shows setting one byte at a time.
> + */
>  static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
>  			const u8 *data, size_t length)
>  {
> @@ -578,9 +579,10 @@ static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
>  	int ret;
>
>  	/* Range check the length. 2 bytes are used for the length fields.*/
> -	if (length > TX_FIFO_SIZE-2) {
> -		dev_err(printdev(devrec), "write_tx_buf() was passed too large a buffer. Performing short write.\n");
> -		length = TX_FIFO_SIZE-2;
> +	if (length > TX_FIFO_SIZE - 2) {
> +		dev_err(printdev(devrec), "%s: passed buffer to large, short write\n",
> +			__func__);
> +		length = TX_FIFO_SIZE - 2;
>  	}

Not breaking printouts is a case where long-ish lines are ok. Changing 
the output to be less clear and useful just to make the line short is a 
regression in my mind.

>
>  	cmd = MRF24J40_WRITELONG(reg);
> @@ -1073,7 +1075,8 @@ static int mrf24j40_hw_init(struct mrf24j40 *devrec)
>  	int ret;
>
>  	/* Initialize the device.
> -		From datasheet section 3.2: Initialization. */
> +	 * From datasheet section 3.2: Initialization.
> +	 */
>  	ret = regmap_write(devrec->regmap_short, REG_SOFTRST, 0x07);
>  	if (ret)
>  		goto err_ret;
> @@ -1374,7 +1377,8 @@ static int mrf24j40_remove(struct spi_device *spi)
>  	ieee802154_unregister_hw(devrec->hw);
>  	ieee802154_free_hw(devrec->hw);
>  	/* TODO: Will ieee802154_free_device() wait until ->xmit() is
> -	 * complete? */
> +	 * complete?
> +	 */
>
>  	return 0;
>  }
>

Regarding the comment format, adding extra lines for */ on a two-line 
comment is a bit overkill.

Sorry to be this way, but I just don't agree with this patch. It just 
feels like churn to me.

Alan.


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

* Re: [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors
  2017-09-22 14:12   ` Alan Ott
@ 2017-09-22 14:38     ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-09-22 14:38 UTC (permalink / raw)
  To: Alan Ott, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev, varkabhadram

Hello.

On 09/22/2017 04:12 PM, Alan Ott wrote:
> Hi Stefan, it's good to hear from you.

Same goes to you. It has been a while. Pretty fast turnaround time for mrf24 patches this time. :P

> On 09/22/2017 08:13 AM, Stefan Schmidt wrote:
>> Fix format of multi-line comments and long lines.
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> 
> Overall, it's pretty churny. More below:
> 
>> ---
>>  drivers/net/ieee802154/mrf24j40.c | 18 +++++++++++-------
>>  1 file changed, 11 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c
>> index ee7084b2d52d..e951a191e15d 100644
>> --- a/drivers/net/ieee802154/mrf24j40.c
>> +++ b/drivers/net/ieee802154/mrf24j40.c
>> @@ -569,8 +569,9 @@ static void write_tx_buf_complete(void *context)
>>  }
>>
>>  /* This function relies on an undocumented write method. Once a write command
>> -   and address is set, as many bytes of data as desired can be clocked into
>> -   the device. The datasheet only shows setting one byte at a time. */
>> + * and address is set, as many bytes of data as desired can be clocked into
>> + * the device. The datasheet only shows setting one byte at a time.
>> + */
>>  static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
>>  			const u8 *data, size_t length)
>>  {
>> @@ -578,9 +579,10 @@ static int write_tx_buf(struct mrf24j40 *devrec, u16 reg,
>>  	int ret;
>>
>>  	/* Range check the length. 2 bytes are used for the length fields.*/
>> -	if (length > TX_FIFO_SIZE-2) {
>> -		dev_err(printdev(devrec), "write_tx_buf() was passed too large a buffer. Performing short write.\n");
>> -		length = TX_FIFO_SIZE-2;
>> +	if (length > TX_FIFO_SIZE - 2) {
>> +		dev_err(printdev(devrec), "%s: passed buffer to large, short write\n",
>> +			__func__);
>> +		length = TX_FIFO_SIZE - 2;
>>  	}
> 
> Not breaking printouts is a case where long-ish lines are ok. Changing 
> the output to be less clear and useful just to make the line short is a 
> regression in my mind.

You are the native speaker but if I compare the two sentences they do not really look less clear and useful to me.
But well, different perceptions. :)

One thing I wondered when looking at this hunk was if this case can actually happen? Can we really get a length here greater than
TX_FIFO_SIZE-2?

>>
>>  	cmd = MRF24J40_WRITELONG(reg);
>> @@ -1073,7 +1075,8 @@ static int mrf24j40_hw_init(struct mrf24j40 *devrec)
>>  	int ret;
>>
>>  	/* Initialize the device.
>> -		From datasheet section 3.2: Initialization. */
>> +	 * From datasheet section 3.2: Initialization.
>> +	 */
>>  	ret = regmap_write(devrec->regmap_short, REG_SOFTRST, 0x07);
>>  	if (ret)
>>  		goto err_ret;
>> @@ -1374,7 +1377,8 @@ static int mrf24j40_remove(struct spi_device *spi)
>>  	ieee802154_unregister_hw(devrec->hw);
>>  	ieee802154_free_hw(devrec->hw);
>>  	/* TODO: Will ieee802154_free_device() wait until ->xmit() is
>> -	 * complete? */
>> +	 * complete?
>> +	 */
>>
>>  	return 0;
>>  }
>>
> 
> Regarding the comment format, adding extra lines for */ on a two-line 
> comment is a bit overkill.

Well, it simply is the kernel coding style. Imagine multi-line comments outside of net/ and drivers/net/ also have an /* on a new line at
the beginning. :-)

> Sorry to be this way, but I just don't agree with this patch. It just 
> feels like churn to me.

Given the tiny amount of patches mrf24 sees over time I would not go as far as calling this churn as it is highly unlikely to conflict with
anything else pending.

I do not mind dropping this patch if you do not want it, though. No problem from my side.

regards
Stefan Schmidt

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

* Re: [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers
  2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
                   ` (13 preceding siblings ...)
  2017-09-22 12:14 ` [PATCH 14/14] ieee802154: fakelb: " Stefan Schmidt
@ 2017-11-06 14:25 ` Stefan Schmidt
  14 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 14:25 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

I would like to move forward with these patches. Could the driver
maintainers give their ACK here please if they are happy with the patch?

On 22.09.2017 14:13, Stefan Schmidt wrote:
> Hello.
> 
> This patchset works through various warnings and errors reported from checkpatch
> on all ieee802154 drivers. Testing and ACKs from the repective driver
> maintainers would be appreciated.
> 
> Stefan Schmidt (14):
>   ieee802154: adf7242: use unsigned int over only unsigned

Michael?

>   ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem
>   ieee802154: at86rf230: use __func__ macro for debug messages

Alex?

>   ieee802154: atusb: switch from uint8_t to u8
>   ieee802154: atusb: use __func__ macro for debug messages
>   ieee802154: atusb: fix some kernel coding style errors
>   ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem

These four are getting applied soon.

>   ieee802154: mrf24j40: fix some kernel coding style errors

Alan, you spoke against this one. I will drop it.

>   ieee802154: ca8210: fix some kernel coding style errors
>   ieee802154: ca8210: use __func__ macro for debug messages

Harry?

>   ieee802154: cc2520: fix some kernel coding style errors
>   ieee802154: cc2520: use __func__ macro for debug messages
>   ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem

Varka?

>   ieee802154: fakelb: switch from BUG_ON() to WARN_ON() on problem

Alex?

regards
Stefan Schmidt

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

* Re: [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages
       [not found]   ` <CAEUmHyZ1oaMjqzMHgNtMg+S2cmq2DvvgAkxBsP6-dkzYp0KyOw@mail.gmail.com>
@ 2017-11-06 15:23     ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:23 UTC (permalink / raw)
  To: Varka Bhadram
  Cc: linux-wpan - ML, Alexander Aring, michael.hennerich, h.morris,
	linuxdev, Alan Ott

Hello Varka.

On 11/06/2017 04:04 PM, Varka Bhadram wrote:
> On Fri, Sep 22, 2017 at 5:44 PM, Stefan Schmidt <stefan@osg.samsung.com <mailto:stefan@osg.samsung.com>> wrote:
> 
>     Instead of having the function name hard-coded (it might change and we
>     forgot to update them in the debug output) we can use __func__ instead
>     and also shorter the line so we do not need to break it.
>     Found by checkpatch.
> 
>     Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
>     ---
> 
>  Acked-by: varkabhadram@gmail.com 

Your acked-by line is missing your real name. I will fix it up for the three acks you just sent. Please keep it in mind for the next time
though :)

regards
Stefan Schmidt

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

* Re: [PATCH 09/14] ieee802154: ca8210: fix some kernel coding style errors
  2017-09-22 12:14 ` [PATCH 09/14] ieee802154: ca8210: " Stefan Schmidt
@ 2017-11-06 15:27   ` Harry Morris
  2017-11-06 15:40     ` Stefan Schmidt
  0 siblings, 1 reply; 32+ messages in thread
From: Harry Morris @ 2017-11-06 15:27 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, varkabhadram, alan

On 22/09/2017 13:14, Stefan Schmidt wrote:
> Remove unneeded parentheses and fix format for pointer style.
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>   drivers/net/ieee802154/ca8210.c | 12 ++++++------
>   1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index 24a1eabbbc9d..66829055aa8b 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -1303,7 +1303,7 @@ static u8 tdme_checkpibattribute(
>   		break;
>   	/* MAC */
>   	case MAC_BATT_LIFE_EXT_PERIODS:
> -		if ((value < 6) || (value > 41))
> +		if (value < 6 || value > 41)
>   			status = MAC_INVALID_PARAMETER;
>   		break;
>   	case MAC_BEACON_PAYLOAD:
> @@ -1319,7 +1319,7 @@ static u8 tdme_checkpibattribute(
>   			status = MAC_INVALID_PARAMETER;
>   		break;
>   	case MAC_MAX_BE:
> -		if ((value < 3) || (value > 8))
> +		if (value < 3 || value > 8)
>   			status = MAC_INVALID_PARAMETER;
>   		break;
>   	case MAC_MAX_CSMA_BACKOFFS:
> @@ -1335,7 +1335,7 @@ static u8 tdme_checkpibattribute(
>   			status = MAC_INVALID_PARAMETER;
>   		break;
>   	case MAC_RESPONSE_WAIT_TIME:
> -		if ((value < 2) || (value > 64))
> +		if (value < 2 || value > 64)
>   			status = MAC_INVALID_PARAMETER;
>   		break;
>   	case MAC_SUPERFRAME_ORDER:
> @@ -1511,7 +1511,7 @@ static u8 mcps_data_request(
>   	psec = (struct secspec *)(command.pdata.data_req.msdu + msdu_length);
>   	command.length = sizeof(struct mcps_data_request_pset) -
>   		MAX_DATA_SIZE + msdu_length;
> -	if (!security || (security->security_level == 0)) {
> +	if (!security || security->security_level == 0) {
>   		psec->security_level = 0;
>   		command.length += 1;
>   	} else {
> @@ -1561,7 +1561,7 @@ static u8 mlme_reset_request_sync(
>   	status = response.pdata.status;
>   
>   	/* reset COORD Bit for Channel Filtering as Coordinator */
> -	if (CA8210_MAC_WORKAROUNDS && set_default_pib && (!status)) {
> +	if (CA8210_MAC_WORKAROUNDS && set_default_pib && !status) {
>   		status = tdme_setsfr_request_sync(
>   			0,
>   			CA8210_SFR_MACCON,
> @@ -2369,7 +2369,7 @@ static int ca8210_set_promiscuous_mode(struct ieee802154_hw *hw, const bool on)
>   		MAC_PROMISCUOUS_MODE,
>   		0,
>   		1,
> -		(const void*)&on,
> +		(const void *)&on,
>   		priv->spi
>   	);
>   	if (status) {

Acked-by: Harry Morris <h.morris@cascoda.com>

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

* Re: [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem
  2017-09-22 12:14 ` [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2017-11-06 15:32   ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:32 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:14, Stefan Schmidt wrote:
> The check is valid but it does not warrant to crash the kernel. A
> WARN_ON() is good enough here.
> Found by checkpatch.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/cc2520.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
> index 735b9f5f9754..0c89d3edf901 100644
> --- a/drivers/net/ieee802154/cc2520.c
> +++ b/drivers/net/ieee802154/cc2520.c
> @@ -517,7 +517,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb)
>  	}
>  
>  	spin_lock_irqsave(&priv->lock, flags);
> -	BUG_ON(priv->is_tx);
> +	WARN_ON(priv->is_tx);
>  	priv->is_tx = 1;
>  	spin_unlock_irqrestore(&priv->lock, flags);
>  
> @@ -643,9 +643,9 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
>  
>  	dev_dbg(&priv->spi->dev, "trying to set channel\n");
>  
> -	BUG_ON(page != 0);
> -	BUG_ON(channel < CC2520_MINCHANNEL);
> -	BUG_ON(channel > CC2520_MAXCHANNEL);
> +	WARN_ON(page != 0);
> +	WARN_ON(channel < CC2520_MINCHANNEL);
> +	WARN_ON(channel > CC2520_MAXCHANNEL);
>  
>  	ret = cc2520_write_register(priv, CC2520_FREQCTRL,
>  				    11 + 5 * (channel - 11));
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages
  2017-09-22 12:14 ` [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages Stefan Schmidt
@ 2017-11-06 15:32   ` Harry Morris
  2017-11-06 15:40     ` Stefan Schmidt
  0 siblings, 1 reply; 32+ messages in thread
From: Harry Morris @ 2017-11-06 15:32 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, varkabhadram, alan

On 22/09/2017 13:14, Stefan Schmidt wrote:
> Instead of having the function name hard-coded (it might change and we
> forgot to update them in the debug output) we can use __func__ instead
> and also shorter the line so we do not need to break it.
> Found by checkpatch.
>
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>   drivers/net/ieee802154/ca8210.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ieee802154/ca8210.c b/drivers/net/ieee802154/ca8210.c
> index 66829055aa8b..26e04c9176a4 100644
> --- a/drivers/net/ieee802154/ca8210.c
> +++ b/drivers/net/ieee802154/ca8210.c
> @@ -924,7 +924,7 @@ static int ca8210_spi_transfer(
>   	priv = spi_get_drvdata(spi);
>   	reinit_completion(&priv->spi_transfer_complete);
>   
> -	dev_dbg(&spi->dev, "ca8210_spi_transfer called\n");
> +	dev_dbg(&spi->dev, "%s called\n", __func__);
>   
>   	cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
>   	if (!cas_ctl)
> @@ -1898,7 +1898,7 @@ static int ca8210_net_rx(struct ieee802154_hw *hw, u8 *command, size_t len)
>   	unsigned long flags;
>   	u8 status;
>   
> -	dev_dbg(&priv->spi->dev, "ca8210_net_rx(), CmdID = %d\n", command[0]);
> +	dev_dbg(&priv->spi->dev, "%s: CmdID = %d\n", __func__, command[0]);
>   
>   	if (command[0] == SPI_MCPS_DATA_INDICATION) {
>   		/* Received data */
> @@ -1948,7 +1948,7 @@ static int ca8210_skb_tx(
>   	struct secspec secspec;
>   	unsigned int mac_len;
>   
> -	dev_dbg(&priv->spi->dev, "ca8210_skb_tx() called\n");
> +	dev_dbg(&priv->spi->dev, "%s called\n", __func__);
>   
>   	/* Get addressing info from skb - ieee802154 layer creates a full
>   	 * packet
> @@ -2051,7 +2051,7 @@ static int ca8210_xmit_async(struct ieee802154_hw *hw, struct sk_buff *skb)
>   	struct ca8210_priv *priv = hw->priv;
>   	int status;
>   
> -	dev_dbg(&priv->spi->dev, "calling ca8210_xmit_async()\n");
> +	dev_dbg(&priv->spi->dev, "calling %s\n", __func__);
>   
>   	priv->tx_skb = skb;
>   	priv->async_tx_pending = true;

Acked-by: Harry Morris <h.morris@cascoda.com>

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

* Re: [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages
  2017-09-22 12:14 ` [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages Stefan Schmidt
       [not found]   ` <CAEUmHyZ1oaMjqzMHgNtMg+S2cmq2DvvgAkxBsP6-dkzYp0KyOw@mail.gmail.com>
@ 2017-11-06 15:34   ` Stefan Schmidt
  1 sibling, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:34 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:14, Stefan Schmidt wrote:
> Instead of having the function name hard-coded (it might change and we
> forgot to update them in the debug output) we can use __func__ instead
> and also shorter the line so we do not need to break it.
> Found by checkpatch.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/cc2520.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
> index 9c1d1768a36f..735b9f5f9754 100644
> --- a/drivers/net/ieee802154/cc2520.c
> +++ b/drivers/net/ieee802154/cc2520.c
> @@ -663,15 +663,14 @@ cc2520_filter(struct ieee802154_hw *hw,
>  	if (changed & IEEE802154_AFILT_PANID_CHANGED) {
>  		u16 panid = le16_to_cpu(filt->pan_id);
>  
> -		dev_vdbg(&priv->spi->dev,
> -			 "cc2520_filter called for pan id\n");
> +		dev_vdbg(&priv->spi->dev, "%s called for pan id\n", __func__);
>  		ret = cc2520_write_ram(priv, CC2520RAM_PANID,
>  				       sizeof(panid), (u8 *)&panid);
>  	}
>  
>  	if (changed & IEEE802154_AFILT_IEEEADDR_CHANGED) {
>  		dev_vdbg(&priv->spi->dev,
> -			 "cc2520_filter called for IEEE addr\n");
> +			 "%s called for IEEE addr\n", __func__);
>  		ret = cc2520_write_ram(priv, CC2520RAM_IEEEADDR,
>  				       sizeof(filt->ieee_addr),
>  				       (u8 *)&filt->ieee_addr);
> @@ -680,8 +679,7 @@ cc2520_filter(struct ieee802154_hw *hw,
>  	if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
>  		u16 addr = le16_to_cpu(filt->short_addr);
>  
> -		dev_vdbg(&priv->spi->dev,
> -			 "cc2520_filter called for saddr\n");
> +		dev_vdbg(&priv->spi->dev, "%s called for saddr\n", __func__);
>  		ret = cc2520_write_ram(priv, CC2520RAM_SHORTADDR,
>  				       sizeof(addr), (u8 *)&addr);
>  	}
> @@ -690,7 +688,7 @@ cc2520_filter(struct ieee802154_hw *hw,
>  		u8 frmfilt0;
>  
>  		dev_vdbg(&priv->spi->dev,
> -			 "cc2520_filter called for panc change\n");
> +			 "%s called for panc change\n", __func__);
>  
>  		cc2520_read_register(priv, CC2520_FRMFILT0, &frmfilt0);
>  
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors
  2017-09-22 12:14 ` [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors Stefan Schmidt
@ 2017-11-06 15:34   ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:34 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:14, Stefan Schmidt wrote:
> Fix some spacing and needed new line.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/cc2520.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/cc2520.c b/drivers/net/ieee802154/cc2520.c
> index d50add705a79..9c1d1768a36f 100644
> --- a/drivers/net/ieee802154/cc2520.c
> +++ b/drivers/net/ieee802154/cc2520.c
> @@ -648,7 +648,7 @@ cc2520_set_channel(struct ieee802154_hw *hw, u8 page, u8 channel)
>  	BUG_ON(channel > CC2520_MAXCHANNEL);
>  
>  	ret = cc2520_write_register(priv, CC2520_FREQCTRL,
> -				    11 + 5*(channel - 11));
> +				    11 + 5 * (channel - 11));
>  
>  	return ret;
>  }
> @@ -929,6 +929,7 @@ static int cc2520_get_platform_data(struct spi_device *spi,
>  
>  	if (!np) {
>  		struct cc2520_platform_data *spi_pdata = spi->dev.platform_data;
> +
>  		if (!spi_pdata)
>  			return -ENOENT;
>  		*pdata = *spi_pdata;
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8
  2017-09-22 12:13 ` [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8 Stefan Schmidt
@ 2017-11-06 15:35   ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:35 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:13, Stefan Schmidt wrote:
> Switch top the preferred kernel type naming.
> Found by checkpatch.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/atusb.c | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 115fa3f37a86..a4a326933977 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -63,7 +63,7 @@ struct atusb {
>  	struct usb_ctrlrequest tx_dr;
>  	struct urb *tx_urb;
>  	struct sk_buff *tx_skb;
> -	uint8_t tx_ack_seq;		/* current TX ACK sequence number */
> +	u8 tx_ack_seq;		/* current TX ACK sequence number */
>  
>  	/* Firmware variable */
>  	unsigned char fw_ver_maj;	/* Firmware major version number */
> @@ -107,7 +107,7 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
>  	return ret;
>  }
>  
> -static int atusb_command(struct atusb *atusb, uint8_t cmd, uint8_t arg)
> +static int atusb_command(struct atusb *atusb, u8 cmd, u8 arg)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  
> @@ -116,7 +116,7 @@ static int atusb_command(struct atusb *atusb, uint8_t cmd, uint8_t arg)
>  				 cmd, ATUSB_REQ_TO_DEV, arg, 0, NULL, 0, 1000);
>  }
>  
> -static int atusb_write_reg(struct atusb *atusb, uint8_t reg, uint8_t value)
> +static int atusb_write_reg(struct atusb *atusb, u8 reg, u8 value)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  
> @@ -127,12 +127,12 @@ static int atusb_write_reg(struct atusb *atusb, uint8_t reg, uint8_t value)
>  				 value, reg, NULL, 0, 1000);
>  }
>  
> -static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
> +static int atusb_read_reg(struct atusb *atusb, u8 reg)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  	int ret;
> -	uint8_t *buffer;
> -	uint8_t value;
> +	u8 *buffer;
> +	u8 value;
>  
>  	buffer = kmalloc(1, GFP_KERNEL);
>  	if (!buffer)
> @@ -153,11 +153,11 @@ static int atusb_read_reg(struct atusb *atusb, uint8_t reg)
>  	}
>  }
>  
> -static int atusb_write_subreg(struct atusb *atusb, uint8_t reg, uint8_t mask,
> -			      uint8_t shift, uint8_t value)
> +static int atusb_write_subreg(struct atusb *atusb, u8 reg, u8 mask,
> +			      u8 shift, u8 value)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
> -	uint8_t orig, tmp;
> +	u8 orig, tmp;
>  	int ret = 0;
>  
>  	dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
> @@ -263,10 +263,10 @@ static void atusb_work_urbs(struct work_struct *work)
>  
>  /* ----- Asynchronous USB -------------------------------------------------- */
>  
> -static void atusb_tx_done(struct atusb *atusb, uint8_t seq)
> +static void atusb_tx_done(struct atusb *atusb, u8 seq)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
> -	uint8_t expect = atusb->tx_ack_seq;
> +	u8 expect = atusb->tx_ack_seq;
>  
>  	dev_dbg(&usb_dev->dev, "atusb_tx_done (0x%02x/0x%02x)\n", seq, expect);
>  	if (seq == expect) {
> @@ -289,7 +289,7 @@ static void atusb_in_good(struct urb *urb)
>  	struct usb_device *usb_dev = urb->dev;
>  	struct sk_buff *skb = urb->context;
>  	struct atusb *atusb = SKB_ATUSB(skb);
> -	uint8_t len, lqi;
> +	u8 len, lqi;
>  
>  	if (!urb->actual_length) {
>  		dev_dbg(&usb_dev->dev, "atusb_in: zero-sized URB ?\n");
> @@ -882,7 +882,7 @@ static int atusb_get_and_show_build(struct atusb *atusb)
>  static int atusb_get_and_conf_chip(struct atusb *atusb)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
> -	uint8_t man_id_0, man_id_1, part_num, version_num;
> +	u8 man_id_0, man_id_1, part_num, version_num;
>  	const char *chip;
>  	struct ieee802154_hw *hw = atusb->hw;
>  
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages
  2017-09-22 12:13 ` [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages Stefan Schmidt
@ 2017-11-06 15:35   ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:35 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:13, Stefan Schmidt wrote:
> Instead of having the function name hard-coded (it might change and we
> forgot to update them in the debug output) we can use __func__ instead
> and also shorter the line so we do not need to break it.
> Found by checkpatch.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/atusb.c | 41 +++++++++++++++++++----------------------
>  1 file changed, 19 insertions(+), 22 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index a4a326933977..bb02e37257cf 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -101,8 +101,8 @@ static int atusb_control_msg(struct atusb *atusb, unsigned int pipe,
>  	if (ret < 0) {
>  		atusb->err = ret;
>  		dev_err(&usb_dev->dev,
> -			"atusb_control_msg: req 0x%02x val 0x%x idx 0x%x, error %d\n",
> -			request, value, index, ret);
> +			"%s: req 0x%02x val 0x%x idx 0x%x, error %d\n",
> +			__func__, request, value, index, ret);
>  	}
>  	return ret;
>  }
> @@ -111,7 +111,7 @@ static int atusb_command(struct atusb *atusb, u8 cmd, u8 arg)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_command: cmd = 0x%x\n", cmd);
> +	dev_dbg(&usb_dev->dev, "%s: cmd = 0x%x\n", __func__, cmd);
>  	return atusb_control_msg(atusb, usb_sndctrlpipe(usb_dev, 0),
>  				 cmd, ATUSB_REQ_TO_DEV, arg, 0, NULL, 0, 1000);
>  }
> @@ -120,8 +120,7 @@ static int atusb_write_reg(struct atusb *atusb, u8 reg, u8 value)
>  {
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_write_reg: 0x%02x <- 0x%02x\n",
> -		reg, value);
> +	dev_dbg(&usb_dev->dev, "%s: 0x%02x <- 0x%02x\n", __func__, reg, value);
>  	return atusb_control_msg(atusb, usb_sndctrlpipe(usb_dev, 0),
>  				 ATUSB_REG_WRITE, ATUSB_REQ_TO_DEV,
>  				 value, reg, NULL, 0, 1000);
> @@ -138,7 +137,7 @@ static int atusb_read_reg(struct atusb *atusb, u8 reg)
>  	if (!buffer)
>  		return -ENOMEM;
>  
> -	dev_dbg(&usb_dev->dev, "atusb: reg = 0x%x\n", reg);
> +	dev_dbg(&usb_dev->dev, "%s: reg = 0x%x\n", __func__, reg);
>  	ret = atusb_control_msg(atusb, usb_rcvctrlpipe(usb_dev, 0),
>  				ATUSB_REG_READ, ATUSB_REQ_FROM_DEV,
>  				0, reg, buffer, 1, 1000);
> @@ -160,8 +159,7 @@ static int atusb_write_subreg(struct atusb *atusb, u8 reg, u8 mask,
>  	u8 orig, tmp;
>  	int ret = 0;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_write_subreg: 0x%02x <- 0x%02x\n",
> -		reg, value);
> +	dev_dbg(&usb_dev->dev, "%s: 0x%02x <- 0x%02x\n", __func__, reg, value);
>  
>  	orig = atusb_read_reg(atusb, reg);
>  
> @@ -268,7 +266,7 @@ static void atusb_tx_done(struct atusb *atusb, u8 seq)
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  	u8 expect = atusb->tx_ack_seq;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_tx_done (0x%02x/0x%02x)\n", seq, expect);
> +	dev_dbg(&usb_dev->dev, "%s (0x%02x/0x%02x)\n", __func__, seq, expect);
>  	if (seq == expect) {
>  		/* TODO check for ifs handling in firmware */
>  		ieee802154_xmit_complete(atusb->hw, atusb->tx_skb, false);
> @@ -328,7 +326,7 @@ static void atusb_in(struct urb *urb)
>  	struct sk_buff *skb = urb->context;
>  	struct atusb *atusb = SKB_ATUSB(skb);
>  
> -	dev_dbg(&usb_dev->dev, "atusb_in: status %d len %d\n",
> +	dev_dbg(&usb_dev->dev, "%s: status %d len %d\n", __func__,
>  		urb->status, urb->actual_length);
>  	if (urb->status) {
>  		if (urb->status == -ENOENT) { /* being killed */
> @@ -336,7 +334,7 @@ static void atusb_in(struct urb *urb)
>  			urb->context = NULL;
>  			return;
>  		}
> -		dev_dbg(&usb_dev->dev, "atusb_in: URB error %d\n", urb->status);
> +		dev_dbg(&usb_dev->dev, "%s: URB error %d\n", __func__, urb->status);
>  	} else {
>  		atusb_in_good(urb);
>  	}
> @@ -390,7 +388,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  	int ret;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_xmit (%d)\n", skb->len);
> +	dev_dbg(&usb_dev->dev, "%s (%d)\n", __func__, skb->len);
>  	atusb->tx_skb = skb;
>  	atusb->tx_ack_seq++;
>  	atusb->tx_dr.wIndex = cpu_to_le16(atusb->tx_ack_seq);
> @@ -401,7 +399,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
>  			     (unsigned char *)&atusb->tx_dr, skb->data,
>  			     skb->len, atusb_xmit_complete, NULL);
>  	ret = usb_submit_urb(atusb->tx_urb, GFP_ATOMIC);
> -	dev_dbg(&usb_dev->dev, "atusb_xmit done (%d)\n", ret);
> +	dev_dbg(&usb_dev->dev, "%s done (%d)\n", __func__, ret);
>  	return ret;
>  }
>  
> @@ -422,7 +420,7 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
>  	if (changed & IEEE802154_AFILT_SADDR_CHANGED) {
>  		u16 addr = le16_to_cpu(filt->short_addr);
>  
> -		dev_vdbg(dev, "atusb_set_hw_addr_filt called for saddr\n");
> +		dev_vdbg(dev, "%s called for saddr\n", __func__);
>  		atusb_write_reg(atusb, RG_SHORT_ADDR_0, addr);
>  		atusb_write_reg(atusb, RG_SHORT_ADDR_1, addr >> 8);
>  	}
> @@ -430,7 +428,7 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
>  	if (changed & IEEE802154_AFILT_PANID_CHANGED) {
>  		u16 pan = le16_to_cpu(filt->pan_id);
>  
> -		dev_vdbg(dev, "atusb_set_hw_addr_filt called for pan id\n");
> +		dev_vdbg(dev, "%s called for pan id\n", __func__);
>  		atusb_write_reg(atusb, RG_PAN_ID_0, pan);
>  		atusb_write_reg(atusb, RG_PAN_ID_1, pan >> 8);
>  	}
> @@ -439,14 +437,13 @@ static int atusb_set_hw_addr_filt(struct ieee802154_hw *hw,
>  		u8 i, addr[IEEE802154_EXTENDED_ADDR_LEN];
>  
>  		memcpy(addr, &filt->ieee_addr, IEEE802154_EXTENDED_ADDR_LEN);
> -		dev_vdbg(dev, "atusb_set_hw_addr_filt called for IEEE addr\n");
> +		dev_vdbg(dev, "%s called for IEEE addr\n", __func__);
>  		for (i = 0; i < 8; i++)
>  			atusb_write_reg(atusb, RG_IEEE_ADDR_0 + i, addr[i]);
>  	}
>  
>  	if (changed & IEEE802154_AFILT_PANC_CHANGED) {
> -		dev_vdbg(dev,
> -			 "atusb_set_hw_addr_filt called for panc change\n");
> +		dev_vdbg(dev, "%s called for panc change\n", __func__);
>  		if (filt->pan_coord)
>  			atusb_write_subreg(atusb, SR_AACK_I_AM_COORD, 1);
>  		else
> @@ -462,7 +459,7 @@ static int atusb_start(struct ieee802154_hw *hw)
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  	int ret;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_start\n");
> +	dev_dbg(&usb_dev->dev, "%s\n", __func__);
>  	schedule_delayed_work(&atusb->work, 0);
>  	atusb_command(atusb, ATUSB_RX_MODE, 1);
>  	ret = atusb_get_and_clear_error(atusb);
> @@ -476,7 +473,7 @@ static void atusb_stop(struct ieee802154_hw *hw)
>  	struct atusb *atusb = hw->priv;
>  	struct usb_device *usb_dev = atusb->usb_dev;
>  
> -	dev_dbg(&usb_dev->dev, "atusb_stop\n");
> +	dev_dbg(&usb_dev->dev, "%s\n", __func__);
>  	usb_kill_anchored_urbs(&atusb->idle_urbs);
>  	atusb_command(atusb, ATUSB_RX_MODE, 0);
>  	atusb_get_and_clear_error(atusb);
> @@ -1131,7 +1128,7 @@ static void atusb_disconnect(struct usb_interface *interface)
>  {
>  	struct atusb *atusb = usb_get_intfdata(interface);
>  
> -	dev_dbg(&atusb->usb_dev->dev, "atusb_disconnect\n");
> +	dev_dbg(&atusb->usb_dev->dev, "%s\n", __func__);
>  
>  	atusb->shutdown = 1;
>  	cancel_delayed_work_sync(&atusb->work);
> @@ -1148,7 +1145,7 @@ static void atusb_disconnect(struct usb_interface *interface)
>  	usb_set_intfdata(interface, NULL);
>  	usb_put_dev(atusb->usb_dev);
>  
> -	pr_debug("atusb_disconnect done\n");
> +	pr_debug("%s done\n", __func__);
>  }
>  
>  /* The devices we work with */
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors
  2017-09-22 12:13 ` [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors Stefan Schmidt
@ 2017-11-06 15:36   ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:36 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:13, Stefan Schmidt wrote:
> Fix a long line, wrong comment format and misaligned indent.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/atusb.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index bb02e37257cf..13d8ee5df094 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -841,7 +841,8 @@ static int atusb_get_and_show_revision(struct atusb *atusb)
>  
>  		dev_info(&usb_dev->dev,
>  			 "Firmware: major: %u, minor: %u, hardware type: %s (%d)\n",
> -			 atusb->fw_ver_maj, atusb->fw_ver_min, hw_name, atusb->fw_hw_type);
> +			 atusb->fw_ver_maj, atusb->fw_ver_min, hw_name,
> +			 atusb->fw_hw_type);
>  	}
>  	if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 2) {
>  		dev_info(&usb_dev->dev,
> @@ -976,7 +977,8 @@ static int atusb_set_extended_addr(struct atusb *atusb)
>  	int ret;
>  
>  	/* Firmware versions before 0.3 do not support the EUI64_READ command.
> -	 * Just use a random address and be done */
> +	 * Just use a random address and be done.
> +	 */
>  	if (atusb->fw_ver_maj == 0 && atusb->fw_ver_min < 3) {
>  		ieee802154_random_extended_addr(&atusb->hw->phy->perm_extended_addr);
>  		return 0;
> @@ -1006,7 +1008,7 @@ static int atusb_set_extended_addr(struct atusb *atusb)
>  		atusb->hw->phy->perm_extended_addr = extended_addr;
>  		addr = swab64((__force u64)atusb->hw->phy->perm_extended_addr);
>  		dev_info(&usb_dev->dev, "Read permanent extended address %8phC from device\n",
> -			&addr);
> +			 &addr);
>  	}
>  
>  	kfree(buffer);
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem
  2017-09-22 12:13 ` [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
@ 2017-11-06 15:36   ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:36 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, h.morris, linuxdev,
	varkabhadram, alan

Hello.

On 22.09.2017 14:13, Stefan Schmidt wrote:
> The check is valid but it does not warrant to crash the kernel. A
> WARN_ON() is good enough here.
> Found by checkpatch.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> ---
>  drivers/net/ieee802154/atusb.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ieee802154/atusb.c b/drivers/net/ieee802154/atusb.c
> index 13d8ee5df094..99d40617dc79 100644
> --- a/drivers/net/ieee802154/atusb.c
> +++ b/drivers/net/ieee802154/atusb.c
> @@ -405,7 +405,7 @@ static int atusb_xmit(struct ieee802154_hw *hw, struct sk_buff *skb)
>  
>  static int atusb_ed(struct ieee802154_hw *hw, u8 *level)
>  {
> -	BUG_ON(!level);
> +	WARN_ON(!level);
>  	*level = 0xbe;
>  	return 0;
>  }
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned
  2017-09-22 12:13 ` [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned Stefan Schmidt
@ 2017-11-06 15:37   ` Michael Hennerich
  2017-11-06 15:39     ` Stefan Schmidt
  0 siblings, 1 reply; 32+ messages in thread
From: Michael Hennerich @ 2017-11-06 15:37 UTC (permalink / raw)
  To: Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, h.morris, linuxdev, varkabhadram, alan

On 22.09.2017 14:13, Stefan Schmidt wrote:
> Bring it in line with the rest of the ieee802154 drivers.
> Found by checkpatch.
> 
> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>

Acked-by: Michael Hennerich <michael.hennerich@analog.com>

> ---
>   drivers/net/ieee802154/adf7242.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/ieee802154/adf7242.c b/drivers/net/ieee802154/adf7242.c
> index 3e4c8b21403c..400fdbd3a120 100644
> --- a/drivers/net/ieee802154/adf7242.c
> +++ b/drivers/net/ieee802154/adf7242.c
> @@ -311,8 +311,8 @@ static int adf7242_status(struct adf7242_local *lp, u8 *stat)
>   	return status;
>   }
>   
> -static int adf7242_wait_status(struct adf7242_local *lp, unsigned status,
> -			       unsigned mask, int line)
> +static int adf7242_wait_status(struct adf7242_local *lp, unsigned int status,
> +			       unsigned int mask, int line)
>   {
>   	int cnt = 0, ret = 0;
>   	u8 stat;
> @@ -477,7 +477,7 @@ static int adf7242_write_reg(struct adf7242_local *lp, u16 addr, u8 data)
>   	return status;
>   }
>   
> -static int adf7242_cmd(struct adf7242_local *lp, unsigned cmd)
> +static int adf7242_cmd(struct adf7242_local *lp, unsigned int cmd)
>   {
>   	int status;
>   
> @@ -920,7 +920,7 @@ static void adf7242_debug(u8 irq1)
>   static irqreturn_t adf7242_isr(int irq, void *data)
>   {
>   	struct adf7242_local *lp = data;
> -	unsigned xmit;
> +	unsigned int xmit;
>   	u8 irq1;
>   
>   	adf7242_wait_status(lp, RC_STATUS_PHY_RDY, RC_STATUS_MASK, __LINE__);
> 


-- 
Greetings,
Michael

--
Analog Devices GmbH      Otl-Aicher Strasse 60-64      80807 München
Sitz der Gesellschaft München, Registergericht München HRB 40368,
Geschäftsführer: Peter Kolberg, Ali Raza Husain, Eileen Wynne

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

* Re: [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned
  2017-11-06 15:37   ` Michael Hennerich
@ 2017-11-06 15:39     ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:39 UTC (permalink / raw)
  To: michael.hennerich, Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, h.morris, linuxdev, varkabhadram, alan

Hello.

On 06.11.2017 16:37, Michael Hennerich wrote:
> On 22.09.2017 14:13, Stefan Schmidt wrote:
>> Bring it in line with the rest of the ieee802154 drivers.
>> Found by checkpatch.
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
> 
> Acked-by: Michael Hennerich <michael.hennerich@analog.com>
> 
>> ---
>>   drivers/net/ieee802154/adf7242.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/adf7242.c
>> b/drivers/net/ieee802154/adf7242.c
>> index 3e4c8b21403c..400fdbd3a120 100644
>> --- a/drivers/net/ieee802154/adf7242.c
>> +++ b/drivers/net/ieee802154/adf7242.c
>> @@ -311,8 +311,8 @@ static int adf7242_status(struct adf7242_local
>> *lp, u8 *stat)
>>       return status;
>>   }
>>   -static int adf7242_wait_status(struct adf7242_local *lp, unsigned
>> status,
>> -                   unsigned mask, int line)
>> +static int adf7242_wait_status(struct adf7242_local *lp, unsigned int
>> status,
>> +                   unsigned int mask, int line)
>>   {
>>       int cnt = 0, ret = 0;
>>       u8 stat;
>> @@ -477,7 +477,7 @@ static int adf7242_write_reg(struct adf7242_local
>> *lp, u16 addr, u8 data)
>>       return status;
>>   }
>>   -static int adf7242_cmd(struct adf7242_local *lp, unsigned cmd)
>> +static int adf7242_cmd(struct adf7242_local *lp, unsigned int cmd)
>>   {
>>       int status;
>>   @@ -920,7 +920,7 @@ static void adf7242_debug(u8 irq1)
>>   static irqreturn_t adf7242_isr(int irq, void *data)
>>   {
>>       struct adf7242_local *lp = data;
>> -    unsigned xmit;
>> +    unsigned int xmit;
>>       u8 irq1;
>>         adf7242_wait_status(lp, RC_STATUS_PHY_RDY, RC_STATUS_MASK,
>> __LINE__);
>>
> 
> 

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

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

* Re: [PATCH 09/14] ieee802154: ca8210: fix some kernel coding style errors
  2017-11-06 15:27   ` Harry Morris
@ 2017-11-06 15:40     ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:40 UTC (permalink / raw)
  To: h.morris, Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, varkabhadram, alan

Hello.

On 06.11.2017 16:27, Harry Morris wrote:
> On 22/09/2017 13:14, Stefan Schmidt wrote:
>> Remove unneeded parentheses and fix format for pointer style.
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
>> ---
>>   drivers/net/ieee802154/ca8210.c | 12 ++++++------
>>   1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/ca8210.c
>> b/drivers/net/ieee802154/ca8210.c
>> index 24a1eabbbc9d..66829055aa8b 100644
>> --- a/drivers/net/ieee802154/ca8210.c
>> +++ b/drivers/net/ieee802154/ca8210.c
>> @@ -1303,7 +1303,7 @@ static u8 tdme_checkpibattribute(
>>           break;
>>       /* MAC */
>>       case MAC_BATT_LIFE_EXT_PERIODS:
>> -        if ((value < 6) || (value > 41))
>> +        if (value < 6 || value > 41)
>>               status = MAC_INVALID_PARAMETER;
>>           break;
>>       case MAC_BEACON_PAYLOAD:
>> @@ -1319,7 +1319,7 @@ static u8 tdme_checkpibattribute(
>>               status = MAC_INVALID_PARAMETER;
>>           break;
>>       case MAC_MAX_BE:
>> -        if ((value < 3) || (value > 8))
>> +        if (value < 3 || value > 8)
>>               status = MAC_INVALID_PARAMETER;
>>           break;
>>       case MAC_MAX_CSMA_BACKOFFS:
>> @@ -1335,7 +1335,7 @@ static u8 tdme_checkpibattribute(
>>               status = MAC_INVALID_PARAMETER;
>>           break;
>>       case MAC_RESPONSE_WAIT_TIME:
>> -        if ((value < 2) || (value > 64))
>> +        if (value < 2 || value > 64)
>>               status = MAC_INVALID_PARAMETER;
>>           break;
>>       case MAC_SUPERFRAME_ORDER:
>> @@ -1511,7 +1511,7 @@ static u8 mcps_data_request(
>>       psec = (struct secspec *)(command.pdata.data_req.msdu +
>> msdu_length);
>>       command.length = sizeof(struct mcps_data_request_pset) -
>>           MAX_DATA_SIZE + msdu_length;
>> -    if (!security || (security->security_level == 0)) {
>> +    if (!security || security->security_level == 0) {
>>           psec->security_level = 0;
>>           command.length += 1;
>>       } else {
>> @@ -1561,7 +1561,7 @@ static u8 mlme_reset_request_sync(
>>       status = response.pdata.status;
>>         /* reset COORD Bit for Channel Filtering as Coordinator */
>> -    if (CA8210_MAC_WORKAROUNDS && set_default_pib && (!status)) {
>> +    if (CA8210_MAC_WORKAROUNDS && set_default_pib && !status) {
>>           status = tdme_setsfr_request_sync(
>>               0,
>>               CA8210_SFR_MACCON,
>> @@ -2369,7 +2369,7 @@ static int ca8210_set_promiscuous_mode(struct
>> ieee802154_hw *hw, const bool on)
>>           MAC_PROMISCUOUS_MODE,
>>           0,
>>           1,
>> -        (const void*)&on,
>> +        (const void *)&on,
>>           priv->spi
>>       );
>>       if (status) {
> 
> Acked-by: Harry Morris <h.morris@cascoda.com>

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

* Re: [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages
  2017-11-06 15:32   ` Harry Morris
@ 2017-11-06 15:40     ` Stefan Schmidt
  0 siblings, 0 replies; 32+ messages in thread
From: Stefan Schmidt @ 2017-11-06 15:40 UTC (permalink / raw)
  To: h.morris, Stefan Schmidt, linux-wpan
  Cc: Alexander Aring, michael.hennerich, varkabhadram, alan

Hello.

On 06.11.2017 16:32, Harry Morris wrote:
> On 22/09/2017 13:14, Stefan Schmidt wrote:
>> Instead of having the function name hard-coded (it might change and we
>> forgot to update them in the debug output) we can use __func__ instead
>> and also shorter the line so we do not need to break it.
>> Found by checkpatch.
>>
>> Signed-off-by: Stefan Schmidt <stefan@osg.samsung.com>
>> ---
>>   drivers/net/ieee802154/ca8210.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/net/ieee802154/ca8210.c
>> b/drivers/net/ieee802154/ca8210.c
>> index 66829055aa8b..26e04c9176a4 100644
>> --- a/drivers/net/ieee802154/ca8210.c
>> +++ b/drivers/net/ieee802154/ca8210.c
>> @@ -924,7 +924,7 @@ static int ca8210_spi_transfer(
>>       priv = spi_get_drvdata(spi);
>>       reinit_completion(&priv->spi_transfer_complete);
>>   -    dev_dbg(&spi->dev, "ca8210_spi_transfer called\n");
>> +    dev_dbg(&spi->dev, "%s called\n", __func__);
>>         cas_ctl = kmalloc(sizeof(*cas_ctl), GFP_ATOMIC);
>>       if (!cas_ctl)
>> @@ -1898,7 +1898,7 @@ static int ca8210_net_rx(struct ieee802154_hw
>> *hw, u8 *command, size_t len)
>>       unsigned long flags;
>>       u8 status;
>>   -    dev_dbg(&priv->spi->dev, "ca8210_net_rx(), CmdID = %d\n",
>> command[0]);
>> +    dev_dbg(&priv->spi->dev, "%s: CmdID = %d\n", __func__, command[0]);
>>         if (command[0] == SPI_MCPS_DATA_INDICATION) {
>>           /* Received data */
>> @@ -1948,7 +1948,7 @@ static int ca8210_skb_tx(
>>       struct secspec secspec;
>>       unsigned int mac_len;
>>   -    dev_dbg(&priv->spi->dev, "ca8210_skb_tx() called\n");
>> +    dev_dbg(&priv->spi->dev, "%s called\n", __func__);
>>         /* Get addressing info from skb - ieee802154 layer creates a full
>>        * packet
>> @@ -2051,7 +2051,7 @@ static int ca8210_xmit_async(struct
>> ieee802154_hw *hw, struct sk_buff *skb)
>>       struct ca8210_priv *priv = hw->priv;
>>       int status;
>>   -    dev_dbg(&priv->spi->dev, "calling ca8210_xmit_async()\n");
>> +    dev_dbg(&priv->spi->dev, "calling %s\n", __func__);
>>         priv->tx_skb = skb;
>>       priv->async_tx_pending = true;
> 
> Acked-by: Harry Morris <h.morris@cascoda.com>

This patch has been applied to the wpan-next tree and will be
part of the next pull request to net-next. Thanks!

regards
Stefan Schmidt

> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-wpan" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2017-11-06 15:40 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-22 12:13 [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt
2017-09-22 12:13 ` [PATCH 01/14] ieee802154: adf7242: use unsigned int over only unsigned Stefan Schmidt
2017-11-06 15:37   ` Michael Hennerich
2017-11-06 15:39     ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 02/14] ieee802154: at86rf230: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2017-09-22 12:13 ` [PATCH 03/14] ieee802154: at86rf230: use __func__ macro for debug messages Stefan Schmidt
2017-09-22 12:13 ` [PATCH 04/14] ieee802154: atusb: switch from uint8_t to u8 Stefan Schmidt
2017-11-06 15:35   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 05/14] ieee802154: atusb: use __func__ macro for debug messages Stefan Schmidt
2017-11-06 15:35   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 06/14] ieee802154: atusb: fix some kernel coding style errors Stefan Schmidt
2017-11-06 15:36   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 07/14] ieee802154: atusb: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2017-11-06 15:36   ` Stefan Schmidt
2017-09-22 12:13 ` [PATCH 08/14] ieee802154: mrf24j40: fix some kernel coding style errors Stefan Schmidt
2017-09-22 14:12   ` Alan Ott
2017-09-22 14:38     ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 09/14] ieee802154: ca8210: " Stefan Schmidt
2017-11-06 15:27   ` Harry Morris
2017-11-06 15:40     ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 10/14] ieee802154: ca8210: use __func__ macro for debug messages Stefan Schmidt
2017-11-06 15:32   ` Harry Morris
2017-11-06 15:40     ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 11/14] ieee802154: cc2520: fix some kernel coding style errors Stefan Schmidt
2017-11-06 15:34   ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 12/14] ieee802154: cc2520: use __func__ macro for debug messages Stefan Schmidt
     [not found]   ` <CAEUmHyZ1oaMjqzMHgNtMg+S2cmq2DvvgAkxBsP6-dkzYp0KyOw@mail.gmail.com>
2017-11-06 15:23     ` Stefan Schmidt
2017-11-06 15:34   ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 13/14] ieee802154: cc2520: switch from BUG_ON() to WARN_ON() on problem Stefan Schmidt
2017-11-06 15:32   ` Stefan Schmidt
2017-09-22 12:14 ` [PATCH 14/14] ieee802154: fakelb: " Stefan Schmidt
2017-11-06 14:25 ` [PATCH 00/14] Checkpatch cleanup for ieee802154 drivers Stefan Schmidt

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.