public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Divy Le Ray <divy@chelsio.com>
To: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 05/10] drivers: net: use new hex_to_bin() method
Date: Mon, 03 May 2010 17:14:26 -0700	[thread overview]
Message-ID: <4BDF66E2.6010308@chelsio.com> (raw)
In-Reply-To: <2eb558b7b0b20dfea0b61223db6146cb8fdbe52d.1272617852.git.ext-andriy.shevchenko@nokia.com>

On 04/30/2010 02:34 AM, Andy Shevchenko wrote:
> Get rid of own implementation of hex_to_bin(). It requires to have hex_to_bin()
> introduced by starter patch in series.
>
> Signed-off-by: Andy Shevchenko<ext-andriy.shevchenko@nokia.com>
> Cc: Divy Le Ray<divy@chelsio.com>
> Cc: Andrew Morton<akpm@linux-foundation.org>
>    

Acked-by: Divy Le Ray <divy@chelsio.com>

> ---
>   drivers/net/cxgb3/t3_hw.c |   16 ++++------------
>   1 files changed, 4 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c
> index 95a8ba0..427c451 100644
> --- a/drivers/net/cxgb3/t3_hw.c
> +++ b/drivers/net/cxgb3/t3_hw.c
> @@ -679,14 +679,6 @@ int t3_seeprom_wp(struct adapter *adapter, int enable)
>   	return t3_seeprom_write(adapter, EEPROM_STAT_ADDR, enable ? 0xc : 0);
>   }
>
> -/*
> - * Convert a character holding a hex digit to a number.
> - */
> -static unsigned int hex2int(unsigned char c)
> -{
> -	return isdigit(c) ? c - '0' : toupper(c) - 'A' + 10;
> -}
> -
>   /**
>    *	get_vpd_params - read VPD parameters from VPD EEPROM
>    *	@adapter: adapter to read
> @@ -727,15 +719,15 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
>   		p->port_type[0] = uses_xaui(adapter) ? 1 : 2;
>   		p->port_type[1] = uses_xaui(adapter) ? 6 : 2;
>   	} else {
> -		p->port_type[0] = hex2int(vpd.port0_data[0]);
> -		p->port_type[1] = hex2int(vpd.port1_data[0]);
> +		p->port_type[0] = hex_to_bin(vpd.port0_data[0]);
> +		p->port_type[1] = hex_to_bin(vpd.port1_data[0]);
>   		p->xauicfg[0] = simple_strtoul(vpd.xaui0cfg_data, NULL, 16);
>   		p->xauicfg[1] = simple_strtoul(vpd.xaui1cfg_data, NULL, 16);
>   	}
>
>   	for (i = 0; i<  6; i++)
> -		p->eth_base[i] = hex2int(vpd.na_data[2 * i]) * 16 +
> -				 hex2int(vpd.na_data[2 * i + 1]);
> +		p->eth_base[i] = hex_to_bin(vpd.na_data[2 * i]) * 16 +
> +				 hex_to_bin(vpd.na_data[2 * i + 1]);
>   	return 0;
>   }
>
>    


  reply	other threads:[~2010-05-04  0:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30  9:33 [PATCH 00/10] Introduce common hex_to_bin() helper Andy Shevchenko
2010-04-30  9:34 ` [PATCH 01/10] lib: introduce common method to convert hex digits Andy Shevchenko
2010-04-30 19:07   ` Andrew Morton
2010-05-01  2:55     ` Joe Perches
2010-05-02 18:12     ` Andy Shevchenko
2010-04-30  9:34 ` [PATCH 02/10] drivers: isdn: use new hex_to_bin() method Andy Shevchenko
2010-04-30  9:34 ` [PATCH 03/10] usb: atm: speedtch: " Andy Shevchenko
2010-04-30  9:34 ` [PATCH 04/10] drivers: net: " Andy Shevchenko
2010-04-30  9:34 ` [PATCH 05/10] " Andy Shevchenko
2010-05-04  0:14   ` Divy Le Ray [this message]
2010-04-30  9:34 ` [PATCH 06/10] sysctl: don't use own implementation of hex_to_bin() Andy Shevchenko
2010-04-30  9:34 ` [PATCH 07/10] staging: rt2860: use new hex_to_bin() method Andy Shevchenko
2010-04-30  9:34 ` [PATCH 08/10] fs: ldm: don't use own implementation of hex_to_bin() Andy Shevchenko
2010-04-30  9:34 ` [PATCH 09/10] drivers: wireless: use new hex_to_bin() method Andy Shevchenko
2010-04-30 18:14   ` John W. Linville
2010-04-30  9:34 ` [PATCH 10/10] drivers: acpi: don't use own implementation of hex_to_bin() Andy Shevchenko

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=4BDF66E2.6010308@chelsio.com \
    --to=divy@chelsio.com \
    --cc=akpm@linux-foundation.org \
    --cc=ext-andriy.shevchenko@nokia.com \
    --cc=linux-kernel@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