Message ID | 1623393419-2521-7-git-send-email-liweihang@huawei.com |
---|---|
State | New |
Headers | show |
Series | [net-next,1/8] net: phy: add a blank line after declarations | expand |
On Fri, Jun 11, 2021 at 02:36:57PM +0800, Weihang Li wrote: > From: Wenpeng Liang <liangwenpeng@huawei.com> > > It's better to use __func__ than a fixed string to print a > function's name. > > Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com> > Signed-off-by: Weihang Li <liweihang@huawei.com> > --- > drivers/net/phy/mdio_device.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c > index 0837319..c94cb53 100644 > --- a/drivers/net/phy/mdio_device.c > +++ b/drivers/net/phy/mdio_device.c > @@ -77,7 +77,7 @@ int mdio_device_register(struct mdio_device *mdiodev) > { > int err; > > - dev_dbg(&mdiodev->dev, "mdio_device_register\n"); > + dev_dbg(&mdiodev->dev, "%s\n", __func__); > > err = mdiobus_register_device(mdiodev); > if (err) > @@ -188,7 +188,7 @@ int mdio_driver_register(struct mdio_driver *drv) > struct mdio_driver_common *mdiodrv = &drv->mdiodrv; > int retval; > > - pr_debug("mdio_driver_register: %s\n", mdiodrv->driver.name); > + pr_debug("%s: %s\n", __func__, mdiodrv->driver.name); It would be nice to make this dev_dbg(&mdiodev->dev, "%s: %s\n", __func__, mdiodrv->driver.name); Andrew
On 2021/6/12 0:05, Andrew Lunn wrote: > On Fri, Jun 11, 2021 at 02:36:57PM +0800, Weihang Li wrote: >> From: Wenpeng Liang <liangwenpeng@huawei.com> >> >> It's better to use __func__ than a fixed string to print a >> function's name. >> >> Signed-off-by: Wenpeng Liang <liangwenpeng@huawei.com> >> Signed-off-by: Weihang Li <liweihang@huawei.com> >> --- >> drivers/net/phy/mdio_device.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c >> index 0837319..c94cb53 100644 >> --- a/drivers/net/phy/mdio_device.c >> +++ b/drivers/net/phy/mdio_device.c >> @@ -77,7 +77,7 @@ int mdio_device_register(struct mdio_device *mdiodev) >> { >> int err; >> >> - dev_dbg(&mdiodev->dev, "mdio_device_register\n"); >> + dev_dbg(&mdiodev->dev, "%s\n", __func__); >> >> err = mdiobus_register_device(mdiodev); >> if (err) >> @@ -188,7 +188,7 @@ int mdio_driver_register(struct mdio_driver *drv) >> struct mdio_driver_common *mdiodrv = &drv->mdiodrv; >> int retval; >> >> - pr_debug("mdio_driver_register: %s\n", mdiodrv->driver.name); >> + pr_debug("%s: %s\n", __func__, mdiodrv->driver.name); > > It would be nice to make this > > dev_dbg(&mdiodev->dev, "%s: %s\n", __func__, mdiodrv->driver.name); > > Andrew > Thanks for the advice, I will change it. Weihang
On 2021/6/12 0:05, Andrew Lunn wrote: >> @@ -188,7 +188,7 @@ int mdio_driver_register(struct mdio_driver *drv) >> struct mdio_driver_common *mdiodrv = &drv->mdiodrv; >> int retval; >> >> - pr_debug("mdio_driver_register: %s\n", mdiodrv->driver.name); >> + pr_debug("%s: %s\n", __func__, mdiodrv->driver.name); > It would be nice to make this > > dev_dbg(&mdiodev->dev, "%s: %s\n", __func__, mdiodrv->driver.name); > > Andrew > There is no way to get mdiodev from a pointer to mdio_driver, I don't think there's a direct relationship between them. So I will keep using pr_debug :) Thanks Weihang
diff --git a/drivers/net/phy/mdio_device.c b/drivers/net/phy/mdio_device.c index 0837319..c94cb53 100644 --- a/drivers/net/phy/mdio_device.c +++ b/drivers/net/phy/mdio_device.c @@ -77,7 +77,7 @@ int mdio_device_register(struct mdio_device *mdiodev) { int err; - dev_dbg(&mdiodev->dev, "mdio_device_register\n"); + dev_dbg(&mdiodev->dev, "%s\n", __func__); err = mdiobus_register_device(mdiodev); if (err) @@ -188,7 +188,7 @@ int mdio_driver_register(struct mdio_driver *drv) struct mdio_driver_common *mdiodrv = &drv->mdiodrv; int retval; - pr_debug("mdio_driver_register: %s\n", mdiodrv->driver.name); + pr_debug("%s: %s\n", __func__, mdiodrv->driver.name); mdiodrv->driver.bus = &mdio_bus_type; mdiodrv->driver.probe = mdio_probe;