All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geoff Levand <geoffrey.levand@am.sony.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Subject: Re: [PATCH 03/11] drivers: net: optimize hex2bin()
Date: Mon, 1 Mar 2010 15:06:02 -0800	[thread overview]
Message-ID: <4B8C485A.8000409@am.sony.com> (raw)
In-Reply-To: <c515333a5ade859310436de33402a057080ec429.1266861291.git.ext-andriy.shevchenko@nokia.com>

Hi Andy,

Sorry for the delay, I was working away from my test equipment
and wanted to test this change before commenting.

On 02/22/2010 10:09 AM, Andy Shevchenko wrote:
> From: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> 
> Optimize hex2bin() function used in ps3_gelic_wireless.c. It requires to have
> hex_to_bin() implementation introduced by starter patch in series.
> 
> Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
> Cc: Geoff Levand <geoffrey.levand@am.sony.com>
> ---
>  drivers/net/ps3_gelic_wireless.c |   12 ++++--------
>  1 files changed, 4 insertions(+), 8 deletions(-)
> 
> --- a/drivers/net/ps3_gelic_wireless.c
> +++ b/drivers/net/ps3_gelic_wireless.c
> @@ -1394,23 +1394,19 @@ static int gelic_wl_get_mode(struct net_device *netdev,
>  static int hex2bin(u8 *str, u8 *bin, unsigned int len)
>  {
>  	unsigned int i;
> -	static unsigned char *hex = "0123456789ABCDEF";
> -	unsigned char *p, *q;
> -	u8 tmp;
>  
>  	if (len != WPA_PSK_LEN * 2)
>  		return -EINVAL;
>  
>  	for (i = 0; i < WPA_PSK_LEN * 2; i += 2) {
> -		p = strchr(hex, toupper(str[i]));
> -		q = strchr(hex, toupper(str[i + 1]));
> -		if (!p || !q) {
> +		int h = hex_to_bin(str[i]);
> +		int l = hex_to_bin(str[i+1]);
> +		if ((h == -1) || (l == -1)) {

We should have a blank line between the two variable declarations
and the if statement here.

Please make an updated patch, otherwise this patch looks OK,
and seems to work correctly on PS3.

-Geoff



  reply	other threads:[~2010-03-01 23:21 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-22 18:08 [PATCH 00/11] Introduce common hex_to_bin() helper Andy Shevchenko
2010-02-22 18:09 ` [PATCH 01/11] lib: introduce common method to convert hex digits Andy Shevchenko
2010-03-09  1:03   ` Andy Shevchenko
2010-03-09 19:57     ` Andrew Morton
2010-04-22  8:39       ` Andy Shevchenko
2010-04-29 22:11         ` Andrew Morton
2010-02-22 18:09 ` [PATCH 02/11] drivers: isdn: use new hex_to_bin() method Andy Shevchenko
2010-02-22 21:22   ` Tilman Schmidt
2010-02-22 18:09 ` [PATCH 03/11] drivers: net: optimize hex2bin() Andy Shevchenko
2010-03-01 23:06   ` Geoff Levand [this message]
2010-03-02  7:59     ` [PATCHv2] " Andy Shevchenko
2010-03-02 16:04       ` Geoff Levand
2010-03-03 22:02         ` Geoff Levand
2010-02-22 18:09 ` [PATCH 04/11] usb: atm: speedtch: use new hex_to_bin() method Andy Shevchenko
2010-02-22 18:09 ` [PATCH 05/11] drivers: net: " Andy Shevchenko
2010-02-22 18:09 ` [PATCH 06/11] " Andy Shevchenko
2010-02-22 18:09 ` [PATCH 07/11] sysctl: don't use own implementation of hex_to_bin() Andy Shevchenko
2010-02-22 18:09 ` [PATCH 08/11] staging: rt2860: use new hex_to_bin() method Andy Shevchenko
2010-02-22 18:09 ` [PATCH 09/11] fs: ldm: don't use own implementation of hex_to_bin() Andy Shevchenko
2010-02-22 18:09 ` [PATCH 10/11] drivers: wireless: use new hex_to_bin() method Andy Shevchenko
2010-02-22 18:09 ` [PATCH 11/11] 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=4B8C485A.8000409@am.sony.com \
    --to=geoffrey.levand@am.sony.com \
    --cc=andy.shevchenko@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.