From: Joe Perches <joe@perches.com>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org
Subject: [PATCH 2/3 v2] mii: Convert printks to netdev_info
Date: Thu, 03 Mar 2011 12:46:30 -0800 [thread overview]
Message-ID: <1299185190.4338.163.camel@Joe-Laptop> (raw)
In-Reply-To: <20110303.123225.242141985.davem@davemloft.net>
Add a bit more data to the output.
Convert string speeds to integer.
Object size reduced a tiny bit.
$ size drivers/net/mii.o*
text data bss dec hex filename
4155 56 1000 5211 145b drivers/net/mii.o.new
4184 56 1000 5240 1478 drivers/net/mii.o.old
Signed-off-by: Joe Perches <joe@perches.com>
---
On Thu, 2011-03-03 at 12:32 -0800, David Miller wrote:
> > This change is stuffed up somehow, it's
> > a reversion of the tun.c change.
> Oops.
> > Let me send you a new/correct patch right now.
> Ok.
Sorry about that. Here's the appropriate patch.
It seems apparent I don't know how to use git properly.
I commited the change, then thought I should see
what the size difference was and add that to the
changelog.
I believe I did this:
<edits drivers/net/mii.c>
make drivers/net/mii.o
git commit -s drivers/net/mii.c
mv drivers/net/mii.o drivers/net/mii.o.new
git checkout master -- drivers/net/mii.c
make drivers/net/mii.o
mv drivers/net/mii.o drivers/net/mii.i.old
git checkout <branch> -- drivers/net/mii.c
size drivers/net/mii.o.*
etc...
git commit --amend drivers/net/mii.c (add etc...)
tun revert? No mii change? huh?
drivers/net/mii.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/mii.c b/drivers/net/mii.c
index 210b2b1..0a6c6a2 100644
--- a/drivers/net/mii.c
+++ b/drivers/net/mii.c
@@ -354,7 +354,7 @@ unsigned int mii_check_media (struct mii_if_info *mii,
if (!new_carrier) {
netif_carrier_off(mii->dev);
if (ok_to_print)
- printk(KERN_INFO "%s: link down\n", mii->dev->name);
+ netdev_info(mii->dev, "link down\n");
return 0; /* duplex did not change */
}
@@ -381,12 +381,12 @@ unsigned int mii_check_media (struct mii_if_info *mii,
duplex = 1;
if (ok_to_print)
- printk(KERN_INFO "%s: link up, %sMbps, %s-duplex, lpa 0x%04X\n",
- mii->dev->name,
- lpa2 & (LPA_1000FULL | LPA_1000HALF) ? "1000" :
- media & (ADVERTISE_100FULL | ADVERTISE_100HALF) ? "100" : "10",
- duplex ? "full" : "half",
- lpa);
+ netdev_info(mii->dev, "link up, %uMbps, %s-duplex, lpa 0x%04X\n",
+ lpa2 & (LPA_1000FULL | LPA_1000HALF) ? 1000 :
+ media & (ADVERTISE_100FULL | ADVERTISE_100HALF) ?
+ 100 : 10,
+ duplex ? "full" : "half",
+ lpa);
if ((init_media) || (mii->full_duplex != duplex)) {
mii->full_duplex = duplex;
next prev parent reply other threads:[~2011-03-03 20:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 17:18 [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug Joe Perches
2011-03-02 17:18 ` [PATCH 2/3] mii: Convert printks to netdev_info Joe Perches
2011-03-03 20:21 ` David Miller
2011-03-03 20:29 ` Joe Perches
2011-03-03 20:32 ` David Miller
2011-03-03 20:46 ` Joe Perches [this message]
2011-03-03 20:56 ` [PATCH 2/3 v2] " David Miller
2011-03-02 17:18 ` [PATCH 3/3] eql: Convert printks to pr_<level> and netdev_<level> Joe Perches
2011-03-03 20:21 ` David Miller
2011-03-03 20:59 ` David Miller
2011-03-03 21:08 ` [PATCH 3/3 v2] " Joe Perches
2011-03-03 21:30 ` David Miller
2011-03-03 20:21 ` [PATCH 1/3] tun: Convert logging messages to pr_<level> and tun_debug David Miller
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=1299185190.4338.163.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.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