Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 198310
b: refs/heads/master
c: 91f06e6
h: refs/heads/master
v: v3
  • Loading branch information
Andy Shevchenko authored and Linus Torvalds committed May 25, 2010
1 parent 4ea4c39 commit 26c67d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1356de06cea80ffc84cde6a4f8779414f20f211e
refs/heads/master: 91f06e66805dd94825885b3ec392c693fe9ef4d9
18 changes: 9 additions & 9 deletions trunk/fs/partitions/ldm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/slab.h>
#include <linux/pagemap.h>
#include <linux/stringify.h>
#include <linux/kernel.h>
#include "ldm.h"
#include "check.h"
#include "msdos.h"
Expand Down Expand Up @@ -77,17 +78,16 @@ static int ldm_parse_hexbyte (const u8 *src)
int h;

/* high part */
if ((x = src[0] - '0') <= '9'-'0') h = x;
else if ((x = src[0] - 'a') <= 'f'-'a') h = x+10;
else if ((x = src[0] - 'A') <= 'F'-'A') h = x+10;
else return -1;
h <<= 4;
x = h = hex_to_bin(src[0]);
if (h < 0)
return -1;

/* low part */
if ((x = src[1] - '0') <= '9'-'0') return h | x;
if ((x = src[1] - 'a') <= 'f'-'a') return h | (x+10);
if ((x = src[1] - 'A') <= 'F'-'A') return h | (x+10);
return -1;
h = hex_to_bin(src[1]);
if (h < 0)
return -1;

return (x << 4) + h;
}

/**
Expand Down

0 comments on commit 26c67d7

Please sign in to comment.