iscsi-target: Fix hex2bin warn_unused compile message
authorNicholas Bellinger <nab@linux-iscsi.org>
Tue, 6 Dec 2011 05:24:19 +0000 (05:24 +0000)
committerNicholas Bellinger <nab@linux-iscsi.org>
Tue, 6 Dec 2011 06:00:59 +0000 (06:00 +0000)
Fix the following compile warning with hex2bin() usage:

drivers/target/iscsi/iscsi_target_auth.c: In function ‘chap_string_to_hex’:
drivers/target/iscsi/iscsi_target_auth.c:35: warning: ignoring return value of ‘hex2bin’, declared with attribute warn_unused_result

Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
drivers/target/iscsi/iscsi_target_auth.c

index beb3946..1cd6ce3 100644 (file)
 
 static int chap_string_to_hex(unsigned char *dst, unsigned char *src, int len)
 {
-       int j = DIV_ROUND_UP(len, 2);
+       int j = DIV_ROUND_UP(len, 2), rc;
 
-       hex2bin(dst, src, j);
+       rc = hex2bin(dst, src, j);
+       if (rc < 0)
+               pr_debug("CHAP string contains non hex digit symbols\n");
 
        dst[j] = '\0';
        return j;