linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next 0/2] net: ch9200: code cleanup
@ 2020-01-07  9:28 Chen Zhou
  2020-01-07  9:28 ` [PATCH next 1/2] net: ch9200: use __func__ in debug message Chen Zhou
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Chen Zhou @ 2020-01-07  9:28 UTC (permalink / raw)
  To: davem; +Cc: linux-usb, netdev, linux-kernel, chenzhou10

patch 1 introduce __func__ in debug message.
patch 2 remove unnecessary return.

Chen Zhou (2):
  net: ch9200: use __func__ in debug message
  net: ch9200: remove unnecessary return

 drivers/net/usb/ch9200.c | 24 +++++++++++-------------
 1 file changed, 11 insertions(+), 13 deletions(-)

-- 
2.7.4


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

* [PATCH next 1/2] net: ch9200: use __func__ in debug message
  2020-01-07  9:28 [PATCH next 0/2] net: ch9200: code cleanup Chen Zhou
@ 2020-01-07  9:28 ` Chen Zhou
  2020-01-07  9:28 ` [PATCH next 2/2] net: ch9200: remove unnecessary return Chen Zhou
  2020-01-07 21:30 ` [PATCH next 0/2] net: ch9200: code cleanup David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Chen Zhou @ 2020-01-07  9:28 UTC (permalink / raw)
  To: davem; +Cc: linux-usb, netdev, linux-kernel, chenzhou10

Use __func__ to print the function name instead of hard coded string.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
 drivers/net/usb/ch9200.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/usb/ch9200.c b/drivers/net/usb/ch9200.c
index 9df3c1f..3c2dc74 100644
--- a/drivers/net/usb/ch9200.c
+++ b/drivers/net/usb/ch9200.c
@@ -111,8 +111,8 @@ static int control_read(struct usbnet *dev,
 		request_type = (USB_DIR_IN | USB_TYPE_VENDOR |
 				USB_RECIP_DEVICE);
 
-	netdev_dbg(dev->net, "Control_read() index=0x%02x size=%d\n",
-		   index, size);
+	netdev_dbg(dev->net, "%s() index=0x%02x size=%d\n",
+		   __func__, index, size);
 
 	buf = kmalloc(size, GFP_KERNEL);
 	if (!buf) {
@@ -151,8 +151,8 @@ static int control_write(struct usbnet *dev, unsigned char request,
 		request_type = (USB_DIR_OUT | USB_TYPE_VENDOR |
 				USB_RECIP_DEVICE);
 
-	netdev_dbg(dev->net, "Control_write() index=0x%02x size=%d\n",
-		   index, size);
+	netdev_dbg(dev->net, "%s() index=0x%02x size=%d\n",
+		   __func__, index, size);
 
 	if (data) {
 		buf = kmemdup(data, size, GFP_KERNEL);
@@ -181,8 +181,8 @@ static int ch9200_mdio_read(struct net_device *netdev, int phy_id, int loc)
 	struct usbnet *dev = netdev_priv(netdev);
 	unsigned char buff[2];
 
-	netdev_dbg(netdev, "ch9200_mdio_read phy_id:%02x loc:%02x\n",
-		   phy_id, loc);
+	netdev_dbg(netdev, "%s phy_id:%02x loc:%02x\n",
+		   __func__, phy_id, loc);
 
 	if (phy_id != 0)
 		return -ENODEV;
@@ -199,8 +199,8 @@ static void ch9200_mdio_write(struct net_device *netdev,
 	struct usbnet *dev = netdev_priv(netdev);
 	unsigned char buff[2];
 
-	netdev_dbg(netdev, "ch9200_mdio_write() phy_id=%02x loc:%02x\n",
-		   phy_id, loc);
+	netdev_dbg(netdev, "%s() phy_id=%02x loc:%02x\n",
+		   __func__, phy_id, loc);
 
 	if (phy_id != 0)
 		return;
@@ -219,8 +219,8 @@ static int ch9200_link_reset(struct usbnet *dev)
 	mii_check_media(&dev->mii, 1, 1);
 	mii_ethtool_gset(&dev->mii, &ecmd);
 
-	netdev_dbg(dev->net, "link_reset() speed:%d duplex:%d\n",
-		   ecmd.speed, ecmd.duplex);
+	netdev_dbg(dev->net, "%s() speed:%d duplex:%d\n",
+		   __func__, ecmd.speed, ecmd.duplex);
 
 	return 0;
 }
@@ -309,7 +309,7 @@ static int get_mac_address(struct usbnet *dev, unsigned char *data)
 	unsigned char mac_addr[0x06];
 	int rd_mac_len = 0;
 
-	netdev_dbg(dev->net, "get_mac_address:\n\tusbnet VID:%0x PID:%0x\n",
+	netdev_dbg(dev->net, "%s:\n\tusbnet VID:%0x PID:%0x\n", __func__,
 		   le16_to_cpu(dev->udev->descriptor.idVendor),
 		   le16_to_cpu(dev->udev->descriptor.idProduct));
 
-- 
2.7.4


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

* [PATCH next 2/2] net: ch9200: remove unnecessary return
  2020-01-07  9:28 [PATCH next 0/2] net: ch9200: code cleanup Chen Zhou
  2020-01-07  9:28 ` [PATCH next 1/2] net: ch9200: use __func__ in debug message Chen Zhou
@ 2020-01-07  9:28 ` Chen Zhou
  2020-01-07 21:30 ` [PATCH next 0/2] net: ch9200: code cleanup David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: Chen Zhou @ 2020-01-07  9:28 UTC (permalink / raw)
  To: davem; +Cc: linux-usb, netdev, linux-kernel, chenzhou10

The return is not needed, remove it.

Signed-off-by: Chen Zhou <chenzhou10@huawei.com>
---
 drivers/net/usb/ch9200.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/usb/ch9200.c b/drivers/net/usb/ch9200.c
index 3c2dc74..d7f3b70 100644
--- a/drivers/net/usb/ch9200.c
+++ b/drivers/net/usb/ch9200.c
@@ -130,8 +130,6 @@ static int control_read(struct usbnet *dev,
 		err = -EINVAL;
 	kfree(buf);
 
-	return err;
-
 err_out:
 	return err;
 }
-- 
2.7.4


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

* Re: [PATCH next 0/2] net: ch9200: code cleanup
  2020-01-07  9:28 [PATCH next 0/2] net: ch9200: code cleanup Chen Zhou
  2020-01-07  9:28 ` [PATCH next 1/2] net: ch9200: use __func__ in debug message Chen Zhou
  2020-01-07  9:28 ` [PATCH next 2/2] net: ch9200: remove unnecessary return Chen Zhou
@ 2020-01-07 21:30 ` David Miller
  2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2020-01-07 21:30 UTC (permalink / raw)
  To: chenzhou10; +Cc: linux-usb, netdev, linux-kernel

From: Chen Zhou <chenzhou10@huawei.com>
Date: Tue, 7 Jan 2020 17:28:54 +0800

> patch 1 introduce __func__ in debug message.
> patch 2 remove unnecessary return.

Series applied, thanks.

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

end of thread, other threads:[~2020-01-07 21:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-07  9:28 [PATCH next 0/2] net: ch9200: code cleanup Chen Zhou
2020-01-07  9:28 ` [PATCH next 1/2] net: ch9200: use __func__ in debug message Chen Zhou
2020-01-07  9:28 ` [PATCH next 2/2] net: ch9200: remove unnecessary return Chen Zhou
2020-01-07 21:30 ` [PATCH next 0/2] net: ch9200: code cleanup David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).