Author: jhb
Date: Tue Nov  3 22:53:23 2020
New Revision: 367311
URL: https://svnweb.freebsd.org/changeset/base/367311

Log:
  Remove unnecessary __DECONST().
  
  Reviewed by:  markj
  Sponsored by: Chelsio Communications
  Differential Revision:        https://reviews.freebsd.org/D27063

Modified:
  head/tools/tools/crypto/cryptocheck.c

Modified: head/tools/tools/crypto/cryptocheck.c
==============================================================================
--- head/tools/tools/crypto/cryptocheck.c       Tue Nov  3 22:32:30 2020        
(r367310)
+++ head/tools/tools/crypto/cryptocheck.c       Tue Nov  3 22:53:23 2020        
(r367311)
@@ -492,7 +492,7 @@ ocf_hash(const struct alg *alg, const char *buffer, si
        ocf_init_cop(&ses, &cop);
        cop.op = 0;
        cop.len = size;
-       cop.src = __DECONST(char *, buffer);
+       cop.src = buffer;
        cop.mac = digest;
 
        if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
@@ -596,7 +596,7 @@ ocf_hmac(const struct alg *alg, const char *buffer, si
 
        ocf_init_sop(&sop);
        sop.mackeylen = key_len;
-       sop.mackey = __DECONST(char *, key);
+       sop.mackey = key;
        sop.mac = alg->mac;
        if (!ocf_init_session(&sop, "HMAC", alg->name, &ses))
                return (false);
@@ -604,7 +604,7 @@ ocf_hmac(const struct alg *alg, const char *buffer, si
        ocf_init_cop(&ses, &cop);
        cop.op = 0;
        cop.len = size;
-       cop.src = __DECONST(char *, buffer);
+       cop.src = buffer;
        cop.mac = digest;
 
        if (ioctl(ses.fd, CIOCCRYPT, &cop) < 0) {
@@ -709,7 +709,7 @@ ocf_init_cipher_session(const struct alg *alg, const c
 
        ocf_init_sop(&sop);
        sop.keylen = key_len;
-       sop.key = __DECONST(char *, key);
+       sop.key = key;
        sop.cipher = alg->cipher;
        return (ocf_init_session(&sop, "cipher", alg->name, ses));
 }
@@ -723,9 +723,9 @@ ocf_cipher(const struct ocf_session *ses, const struct
        ocf_init_cop(ses, &cop);
        cop.op = op;
        cop.len = size;
-       cop.src = __DECONST(char *, input);
+       cop.src = input;
        cop.dst = output;
-       cop.iv = __DECONST(char *, iv);
+       cop.iv = iv;
 
        if (ioctl(ses->fd, CIOCCRYPT, &cop) < 0) {
                warn("cryptodev %s (%zu) cipher failed for device %s",
@@ -841,10 +841,10 @@ ocf_init_eta_session(const struct alg *alg, const char
 
        ocf_init_sop(&sop);
        sop.keylen = cipher_key_len;
-       sop.key = __DECONST(char *, cipher_key);
+       sop.key = cipher_key;
        sop.cipher = alg->cipher;
        sop.mackeylen = auth_key_len;
-       sop.mackey = __DECONST(char *, auth_key);
+       sop.mackey = auth_key;
        sop.mac = alg->mac;
        return (ocf_init_session(&sop, "ETA", alg->name, ses));
 }
@@ -864,11 +864,11 @@ ocf_eta(const struct ocf_session *ses, const char *iv,
                caead.len = size;
                caead.aadlen = aad_len;
                caead.ivlen = iv_len;
-               caead.src = __DECONST(char *, input);
+               caead.src = input;
                caead.dst = output;
-               caead.aad = __DECONST(char *, aad);
+               caead.aad = aad;
                caead.tag = digest;
-               caead.iv = __DECONST(char *, iv);
+               caead.iv = iv;
 
                ret = ioctl(ses->fd, CIOCCRYPTAEAD, &caead);
        } else {
@@ -877,10 +877,10 @@ ocf_eta(const struct ocf_session *ses, const char *iv,
                ocf_init_cop(ses, &cop);
                cop.op = op;
                cop.len = size;
-               cop.src = __DECONST(char *, input);
+               cop.src = input;
                cop.dst = output;
                cop.mac = digest;
-               cop.iv = __DECONST(char *, iv);
+               cop.iv = iv;
 
                ret = ioctl(ses->fd, CIOCCRYPT, &cop);
        }
@@ -1078,7 +1078,7 @@ ocf_gmac(const struct alg *alg, const char *input, siz
 
        ocf_init_sop(&sop);
        sop.mackeylen = key_len;
-       sop.mackey = __DECONST(char *, key);
+       sop.mackey = key;
        sop.mac = alg->mac;
        if (!ocf_init_session(&sop, "GMAC", alg->name, &ses))
                return (false);
@@ -1086,7 +1086,7 @@ ocf_gmac(const struct alg *alg, const char *input, siz
        ocf_init_cop(&ses, &cop);
        cop.op = 0;
        cop.len = size;
-       cop.src = __DECONST(char *, input);
+       cop.src = input;
        cop.mac = tag;
        cop.iv = iv;
 
@@ -1298,7 +1298,7 @@ ocf_init_aead_session(const struct alg *alg, const cha
 
        ocf_init_sop(&sop);
        sop.keylen = key_len;
-       sop.key = __DECONST(char *, key);
+       sop.key = key;
        sop.cipher = alg->cipher;
        return (ocf_init_session(&sop, "AEAD", alg->name, ses));
 }
@@ -1315,11 +1315,11 @@ ocf_aead(const struct ocf_session *ses, const char *iv
        caead.len = size;
        caead.aadlen = aad_len;
        caead.ivlen = iv_len;
-       caead.src = __DECONST(char *, input);
+       caead.src = input;
        caead.dst = output;
-       caead.aad = __DECONST(char *, aad);
+       caead.aad = aad;
        caead.tag = tag;
-       caead.iv = __DECONST(char *, iv);
+       caead.iv = iv;
 
        if (ioctl(ses->fd, CIOCCRYPTAEAD, &caead) < 0)
                return (errno);
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to