]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
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 beb39469e7f1e4f91c971f6da468c742a338699d..1cd6ce373b83508fd396f82b80290b91372c9e96 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;