[PATCH v1] cxgb3: re-use native hex2bin()

Subsystems: cxgb3 ethernet driver (cxgb3), networking drivers, the rest

STALE4208d

2 messages, 2 authors, 2015-01-25 · open the first message on its own page

[PATCH v1] cxgb3: re-use native hex2bin()

From: Andy Shevchenko <hidden>
Date: 2015-01-22 21:37:35

Call hex2bin() library function instead of doing conversion here.

Signed-off-by: Andy Shevchenko <redacted>
---
 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

Re: [PATCH v1] cxgb3: re-use native hex2bin()

From: David Miller <davem@davemloft.net>
Date: 2015-01-25 08:10:04

From: Andy Shevchenko <redacted>
Date: Thu, 22 Jan 2015 23:37:39 +0200
Call hex2bin() library function instead of doing conversion here.

Signed-off-by: Andy Shevchenko <redacted>
Applied.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help