From: Andy Shevchenko Date: Mon, 20 Sep 2010 20:40:24 +0000 (+0000) Subject: drivers: atm: use native kernel's hex_to_bin() func X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=66bb16de6b9a05936d1eeb20155bab008b476191;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git drivers: atm: use native kernel's hex_to_bin() func Signed-off-by: Andy Shevchenko Cc: Chas Williams Cc: linux-atm-general@lists.sourceforge.net Signed-off-by: David S. Miller --- diff --git a/drivers/atm/horizon.c b/drivers/atm/horizon.c index 54720baa7363..a95790452a68 100644 --- a/drivers/atm/horizon.c +++ b/drivers/atm/horizon.c @@ -1645,10 +1645,8 @@ static int hrz_send (struct atm_vcc * atm_vcc, struct sk_buff * skb) { unsigned short d = 0; char * s = skb->data; if (*s++ == 'D') { - for (i = 0; i < 4; ++i) { - d = (d<<4) | ((*s <= '9') ? (*s - '0') : (*s - 'a' + 10)); - ++s; - } + for (i = 0; i < 4; ++i) + d = (d << 4) | hex_to_bin(*s++); PRINTK (KERN_INFO, "debug bitmap is now %hx", debug = d); } }