From: Sascha Hauer <s.hauer@pengutronix.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/3] net: Use dev_name directly
Date: Thu, 28 Jun 2012 12:48:46 +0200 [thread overview]
Message-ID: <1340880527-6895-3-git-send-email-s.hauer@pengutronix.de> (raw)
In-Reply-To: <1340880527-6895-1-git-send-email-s.hauer@pengutronix.de>
eth_get_byname uses a selfmade dev_name, use dev_name directly instead.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
net/eth.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/eth.c b/net/eth.c
index 2b492ad..e023d65 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -100,11 +100,9 @@ struct eth_device * eth_get_current(void)
struct eth_device *eth_get_byname(char *ethname)
{
struct eth_device *edev;
- char name[MAX_DRIVER_NAME];
list_for_each_entry(edev, &netdev_list, list) {
- sprintf(name, "%s%d", edev->dev.name, edev->dev.id);
- if (!strcmp(ethname, name))
+ if (!strcmp(ethname, dev_name(&edev->dev)))
return edev;
}
return NULL;
--
1.7.10
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-06-28 10:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-28 10:48 [PATCH] some small binary size improvement patches Sascha Hauer
2012-06-28 10:48 ` [PATCH 1/3] menu: factor out a function to print an entry Sascha Hauer
2012-06-28 10:48 ` Sascha Hauer [this message]
2012-06-28 10:48 ` [PATCH 3/3] dos partitions: enable disk size guessing only for bios disks Sascha Hauer
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=1340880527-6895-3-git-send-email-s.hauer@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=barebox@lists.infradead.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