]> Pileus Git - ~andy/linux/blobdiff - net/core/pktgen.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
[~andy/linux] / net / core / pktgen.c
index 10a1ea72010d329295ce3936228aa5bffe7dc745..2c0df0f95b3d488c8e6f8818857f19c02726e200 100644 (file)
@@ -729,16 +729,14 @@ static int hex32_arg(const char __user *user_buffer, unsigned long maxlen,
        *num = 0;
 
        for (; i < maxlen; i++) {
+               int value;
                char c;
                *num <<= 4;
                if (get_user(c, &user_buffer[i]))
                        return -EFAULT;
-               if ((c >= '0') && (c <= '9'))
-                       *num |= c - '0';
-               else if ((c >= 'a') && (c <= 'f'))
-                       *num |= c - 'a' + 10;
-               else if ((c >= 'A') && (c <= 'F'))
-                       *num |= c - 'A' + 10;
+               value = hex_to_bin(c);
+               if (value >= 0)
+                       *num |= value;
                else
                        break;
        }
@@ -3907,8 +3905,6 @@ static void __exit pg_cleanup(void)
 {
        struct pktgen_thread *t;
        struct list_head *q, *n;
-       wait_queue_head_t queue;
-       init_waitqueue_head(&queue);
 
        /* Stop all interfaces & threads */