From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: netdev@vger.kernel.org, Santosh Raspatur <santosh@chelsio.com>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Subject: [PATCH v1] cxgb3: re-use native hex2bin()
Date: Thu, 22 Jan 2015 23:37:39 +0200 [thread overview]
Message-ID: <1421962659-25885-1-git-send-email-andy.shevchenko@gmail.com> (raw)
Call hex2bin() library function instead of doing conversion here.
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/net/ethernet/chelsio/cxgb3/t3_hw.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
index c74a898..184a8d5 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/t3_hw.c
@@ -727,9 +727,9 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
p->xauicfg[1] = simple_strtoul(vpd.xaui1cfg_data, NULL, 16);
}
- for (i = 0; i < 6; i++)
- p->eth_base[i] = hex_to_bin(vpd.na_data[2 * i]) * 16 +
- hex_to_bin(vpd.na_data[2 * i + 1]);
+ ret = hex2bin(p->eth_base, vpd.na_data, 6);
+ if (ret < 0)
+ return -EINVAL;
return 0;
}
--
1.8.3.101.g727a46b
next reply other threads:[~2015-01-22 21:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-22 21:37 Andy Shevchenko [this message]
2015-01-25 8:10 ` [PATCH v1] cxgb3: re-use native hex2bin() 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=1421962659-25885-1-git-send-email-andy.shevchenko@gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=santosh@chelsio.com \
/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;
as well as URLs for NNTP newsgroup(s).