From: Joe Perches <joe@perches.com>
To: Jean-Michel Hautbois <jhautbois@gmail.com>
Cc: davem@davemloft.net, richard.cochran@omicron.at,
shemminger@vyatta.com, tj@kernel.org, randy.dunlap@oracle.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: phy: Fixed some checkpatch errors
Date: Sun, 19 Dec 2010 01:19:07 -0800 [thread overview]
Message-ID: <1292750347.22702.268.camel@Joe-Laptop> (raw)
In-Reply-To: <1292697704-2886-2-git-send-email-jhautbois@gmail.com>
On Sat, 2010-12-18 at 19:41 +0100, Jean-Michel Hautbois wrote:
> Fixes some coding style issues (errors and warnings).
Hi Jean-Michel.
> diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
[]
> @@ -47,11 +47,11 @@ void phy_print_status(struct phy_device *phydev)
> pr_info("PHY: %s - Link is %s", dev_name(&phydev->dev),
> phydev->link ? "Up" : "Down");
> if (phydev->link)
> - printk(" - %d/%s", phydev->speed,
> + pr_info(" - %d/%s", phydev->speed,
> DUPLEX_FULL == phydev->duplex ?
> "Full" : "Half");
>
> - printk("\n");
> + pr_info("\n");
This isn't the right way to fix this actually.
The first pr_info is not terminated with a newline,
so the second printk should be printk(KERN_CONT or
pr_cont instead.
Ideally, you would make a different change.
There should be just one printk/pr_info.
Fewer messages, couldn't be interleaved with other
simultaneous output, easier to grep, etc...
I think something like this would be better:
if (phydev->link)
pr_info("PHY: %s - Link is down\n", dev_name(&phydev->dev));
else
pr_info("PHY: %s - Link is up - %d/%s\n",
dev_name(&phydev->dev),
phydev->speed,
phydev->duplex == DUPLEX_FULL ? "Full" : "Half");
or maybe use dev_info like this:
if (phydev->link)
dev_info(&phydev->dev, "PHY: Link is down\n");
else
dev_info(&phydev->dev, "PHY: Link is up - %d/%s\n",
phydev->speed,
phydev->duplex == DUPLEX_FULL ? "Full" : "Half");
cheers, Joe
next prev parent reply other threads:[~2010-12-19 9:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-18 18:41 [PATCH 1/2] net: phy: balance disable/enable irq on change Jean-Michel Hautbois
2010-12-18 18:41 ` [PATCH 2/2] net: phy: Fixed some checkpatch errors Jean-Michel Hautbois
2010-12-19 9:19 ` Joe Perches [this message]
-- strict thread matches above, loose matches on Subject: below --
2010-12-18 18:38 [PATCH 1/2] net: phy: balance disable/enable irq on change Jean-Michel Hautbois
2010-12-18 18:39 ` [PATCH 2/2] net: phy: Fixed some checkpatch errors Jean-Michel Hautbois
2010-12-18 15:55 [PATCH 1/2] net: phy: balance disable/enable irq on change Jean-Michel Hautbois
2010-12-18 15:55 ` [PATCH 2/2] net: phy: Fixed some checkpatch errors Jean-Michel Hautbois
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292750347.22702.268.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=jhautbois@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=randy.dunlap@oracle.com \
--cc=richard.cochran@omicron.at \
--cc=shemminger@vyatta.com \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox