diff options
author | Andy Shevchenko <ext-andriy.shevchenko@nokia.com> | 2010-05-24 17:33:28 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-05-25 11:07:06 -0400 |
commit | 26355387c21accb0919d34ee59478c23b2030ee5 (patch) | |
tree | c6acac2eaf2ebe9f95cbd560e2e3ed279eab59b7 | |
parent | 91f06e66805dd94825885b3ec392c693fe9ef4d9 (diff) |
drivers: wireless: use new hex_to_bin() method
Instead of using own implementation involve hex_to_bin() function.
Signed-off-by: Andy Shevchenko <ext-andriy.shevchenko@nokia.com>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | drivers/net/wireless/airo.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c index a441aad922c2..3b7ab20a5c54 100644 --- a/drivers/net/wireless/airo.c +++ b/drivers/net/wireless/airo.c | |||
@@ -5162,13 +5162,6 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file) | |||
5162 | enable_MAC(ai, 1); | 5162 | enable_MAC(ai, 1); |
5163 | } | 5163 | } |
5164 | 5164 | ||
5165 | static inline u8 hexVal(char c) { | ||
5166 | if (c>='0' && c<='9') return c -= '0'; | ||
5167 | if (c>='a' && c<='f') return c -= 'a'-10; | ||
5168 | if (c>='A' && c<='F') return c -= 'A'-10; | ||
5169 | return 0; | ||
5170 | } | ||
5171 | |||
5172 | static void proc_APList_on_close( struct inode *inode, struct file *file ) { | 5165 | static void proc_APList_on_close( struct inode *inode, struct file *file ) { |
5173 | struct proc_data *data = (struct proc_data *)file->private_data; | 5166 | struct proc_data *data = (struct proc_data *)file->private_data; |
5174 | struct proc_dir_entry *dp = PDE(inode); | 5167 | struct proc_dir_entry *dp = PDE(inode); |
@@ -5188,11 +5181,11 @@ static void proc_APList_on_close( struct inode *inode, struct file *file ) { | |||
5188 | switch(j%3) { | 5181 | switch(j%3) { |
5189 | case 0: | 5182 | case 0: |
5190 | APList_rid.ap[i][j/3]= | 5183 | APList_rid.ap[i][j/3]= |
5191 | hexVal(data->wbuffer[j+i*6*3])<<4; | 5184 | hex_to_bin(data->wbuffer[j+i*6*3])<<4; |
5192 | break; | 5185 | break; |
5193 | case 1: | 5186 | case 1: |
5194 | APList_rid.ap[i][j/3]|= | 5187 | APList_rid.ap[i][j/3]|= |
5195 | hexVal(data->wbuffer[j+i*6*3]); | 5188 | hex_to_bin(data->wbuffer[j+i*6*3]); |
5196 | break; | 5189 | break; |
5197 | } | 5190 | } |
5198 | } | 5191 | } |
@@ -5340,10 +5333,10 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) { | |||
5340 | for( i = 0; i < 16*3 && data->wbuffer[i+j]; i++ ) { | 5333 | for( i = 0; i < 16*3 && data->wbuffer[i+j]; i++ ) { |
5341 | switch(i%3) { | 5334 | switch(i%3) { |
5342 | case 0: | 5335 | case 0: |
5343 | key[i/3] = hexVal(data->wbuffer[i+j])<<4; | 5336 | key[i/3] = hex_to_bin(data->wbuffer[i+j])<<4; |
5344 | break; | 5337 | break; |
5345 | case 1: | 5338 | case 1: |
5346 | key[i/3] |= hexVal(data->wbuffer[i+j]); | 5339 | key[i/3] |= hex_to_bin(data->wbuffer[i+j]); |
5347 | break; | 5340 | break; |
5348 | } | 5341 | } |
5349 | } | 5342 | } |