Skip to content

Commit

Permalink
module: icp: fix unused, remove argsused
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12844
  • Loading branch information
nabijaczleweli authored and nicman23 committed Aug 22, 2022
1 parent a8ac500 commit 4eb02be
Show file tree
Hide file tree
Showing 21 changed files with 69 additions and 72 deletions.
1 change: 0 additions & 1 deletion module/icp/algs/aes/aes_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@ aes_decrypt_block(const void *ks, const uint8_t *ct, uint8_t *pt)
* size Size of key schedule allocated, in bytes
* kmflag Flag passed to kmem_alloc(9F); ignored in userland.
*/
/* ARGSUSED */
void *
aes_alloc_keysched(size_t *size, int kmflag)
{
Expand Down
2 changes: 0 additions & 2 deletions module/icp/algs/modes/cbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ cbc_encrypt_contiguous_blocks(cbc_ctx_t *ctx, char *data, size_t length,
#define OTHER(a, ctx) \
(((a) == (ctx)->cbc_lastblock) ? (ctx)->cbc_iv : (ctx)->cbc_lastblock)

/* ARGSUSED */
int
cbc_decrypt_contiguous_blocks(cbc_ctx_t *ctx, char *data, size_t length,
crypto_data_t *out, size_t block_size,
Expand Down Expand Up @@ -259,7 +258,6 @@ cbc_init_ctx(cbc_ctx_t *cbc_ctx, char *param, size_t param_len,
return (CRYPTO_SUCCESS);
}

/* ARGSUSED */
void *
cbc_alloc_ctx(int kmflag)
{
Expand Down
3 changes: 1 addition & 2 deletions module/icp/algs/modes/ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ calculate_ccm_mac(ccm_ctx_t *ctx, uint8_t *ccm_mac,
}
}

/* ARGSUSED */
int
ccm_encrypt_final(ccm_ctx_t *ctx, crypto_data_t *out, size_t block_size,
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *),
Expand Down Expand Up @@ -342,14 +341,14 @@ ccm_decrypt_incomplete_block(ccm_ctx_t *ctx,
* returned to the caller. It will be returned when decrypt_final() is
* called if the MAC matches
*/
/* ARGSUSED */
int
ccm_mode_decrypt_contiguous_blocks(ccm_ctx_t *ctx, char *data, size_t length,
crypto_data_t *out, size_t block_size,
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *),
void (*copy_block)(uint8_t *, uint8_t *),
void (*xor_block)(uint8_t *, uint8_t *))
{
(void) out;
size_t remainder = length;
size_t need = 0;
uint8_t *datap = (uint8_t *)data;
Expand Down
1 change: 0 additions & 1 deletion module/icp/algs/modes/ctr.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ ctr_init_ctx(ctr_ctx_t *ctr_ctx, ulong_t count, uint8_t *cb,
return (CRYPTO_SUCCESS);
}

/* ARGSUSED */
void *
ctr_alloc_ctx(int kmflag)
{
Expand Down
1 change: 0 additions & 1 deletion module/icp/algs/modes/ecb.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ ecb_cipher_contiguous_blocks(ecb_ctx_t *ctx, char *data, size_t length,
return (CRYPTO_SUCCESS);
}

/* ARGSUSED */
void *
ecb_alloc_ctx(int kmflag)
{
Expand Down
5 changes: 3 additions & 2 deletions module/icp/algs/modes/gcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,13 @@ gcm_mode_encrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length,
return (CRYPTO_SUCCESS);
}

/* ARGSUSED */
int
gcm_encrypt_final(gcm_ctx_t *ctx, crypto_data_t *out, size_t block_size,
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *),
void (*copy_block)(uint8_t *, uint8_t *),
void (*xor_block)(uint8_t *, uint8_t *))
{
(void) copy_block;
#ifdef CAN_USE_GCM_ASM
if (ctx->gcm_use_avx == B_TRUE)
return (gcm_encrypt_final_avx(ctx, out, block_size));
Expand Down Expand Up @@ -324,14 +324,15 @@ gcm_decrypt_incomplete_block(gcm_ctx_t *ctx, size_t block_size, size_t index,
}
}

/* ARGSUSED */
int
gcm_mode_decrypt_contiguous_blocks(gcm_ctx_t *ctx, char *data, size_t length,
crypto_data_t *out, size_t block_size,
int (*encrypt_block)(const void *, const uint8_t *, uint8_t *),
void (*copy_block)(uint8_t *, uint8_t *),
void (*xor_block)(uint8_t *, uint8_t *))
{
(void) out, (void) block_size, (void) encrypt_block, (void) copy_block,
(void) xor_block;
size_t new_len;
uint8_t *new;

Expand Down
8 changes: 4 additions & 4 deletions module/icp/asm-x86_64/aes/aes_aesni.S
Original file line number Diff line number Diff line change
Expand Up @@ -154,26 +154,26 @@

#include <sys/types.h>

/* ARGSUSED */
void
aes_encrypt_intel(const uint32_t rk[], int Nr, const uint32_t pt[4],
uint32_t ct[4]) {
(void) rk, (void) Nr, (void) pt, (void) ct;
}
/* ARGSUSED */
void
aes_decrypt_intel(const uint32_t rk[], int Nr, const uint32_t ct[4],
uint32_t pt[4]) {
(void) rk, (void) Nr, (void) ct, (void) pt;
}
/* ARGSUSED */
int
rijndael_key_setup_enc_intel(uint32_t rk[], const uint32_t cipherKey[],
uint64_t keyBits) {
(void) rk, (void) cipherKey, (void) keyBits;
return (0);
}
/* ARGSUSED */
int
rijndael_key_setup_dec_intel(uint32_t rk[], const uint32_t cipherKey[],
uint64_t keyBits) {
(void) rk, (void) cipherKey, (void) keyBits;
return (0);
}

Expand Down
4 changes: 2 additions & 2 deletions module/icp/asm-x86_64/aes/aes_amd64.S
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,15 @@
#if defined(lint) || defined(__lint)

#include <sys/types.h>
/* ARGSUSED */
void
aes_encrypt_amd64(const uint32_t rk[], int Nr, const uint32_t pt[4],
uint32_t ct[4]) {
(void) rk, (void) Nr, (void) pt, (void) ct;
}
/* ARGSUSED */
void
aes_decrypt_amd64(const uint32_t rk[], int Nr, const uint32_t ct[4],
uint32_t pt[4]) {
(void) rk, (void) Nr, (void) pt, (void) ct;
}


Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/modes/gcm_pclmulqdq.S
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@

#include <sys/types.h>

/* ARGSUSED */
void
gcm_mul_pclmulqdq(uint64_t *x_in, uint64_t *y, uint64_t *res) {
(void) x_in, (void) y, (void) res;
}

#elif defined(HAVE_PCLMULQDQ) /* guard by instruction set */
Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/sha1/sha1-x86_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@
#include <sys/sha1.h>


/* ARGSUSED */
void
sha1_block_data_order(SHA1_CTX *ctx, const void *inpp, size_t blocks)
{
(void) ctx, (void) inpp, (void) blocks;
}

#else
Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/sha2/sha256_impl.S
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@
#include <sys/stdint.h>
#include <sha2/sha2.h>

/* ARGSUSED */
void
SHA256TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num)
{
(void) ctx, (void) in, (void) num;
}


Expand Down
2 changes: 1 addition & 1 deletion module/icp/asm-x86_64/sha2/sha512_impl.S
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
#include <sys/stdint.h>
#include <sha2/sha2.h>

/* ARGSUSED */
void
SHA512TransformBlocks(SHA2_CTX *ctx, const void *in, size_t num)
{
(void) ctx, (void) in, (void) num;
}


Expand Down
4 changes: 2 additions & 2 deletions module/icp/core/kcf_mech_tabs.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,6 @@ kcf_get_mech_entry(crypto_mech_type_t mech_type, kcf_mech_entry_t **mep)
crypto_mech_type_t
crypto_mech2id_common(char *mechname, boolean_t load_module)
{
crypto_mech_type_t mt = kcf_mech_hash_find(mechname);
return (mt);
(void) load_module;
return (kcf_mech_hash_find(mechname));
}
1 change: 1 addition & 0 deletions module/icp/core/kcf_prov_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ int
crypto_uio_data(crypto_data_t *data, uchar_t *buf, int len, cmd_type_t cmd,
void *digest_ctx, void (*update)(void))
{
(void) digest_ctx, (void) update;
zfs_uio_t *uiop = data->cd_uio;
off_t offset = data->cd_offset;
size_t length = len;
Expand Down
12 changes: 6 additions & 6 deletions module/icp/core/kcf_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -970,10 +970,10 @@ kcf_enqueue(kcf_areq_node_t *node)
/*
* kmem_cache_alloc constructor for sync request structure.
*/
/* ARGSUSED */
static int
kcf_sreq_cache_constructor(void *buf, void *cdrarg, int kmflags)
{
(void) cdrarg, (void) kmflags;
kcf_sreq_node_t *sreq = (kcf_sreq_node_t *)buf;

sreq->sn_type = CRYPTO_SYNCH;
Expand All @@ -983,10 +983,10 @@ kcf_sreq_cache_constructor(void *buf, void *cdrarg, int kmflags)
return (0);
}

/* ARGSUSED */
static void
kcf_sreq_cache_destructor(void *buf, void *cdrarg)
{
(void) cdrarg;
kcf_sreq_node_t *sreq = (kcf_sreq_node_t *)buf;

mutex_destroy(&sreq->sn_lock);
Expand All @@ -996,10 +996,10 @@ kcf_sreq_cache_destructor(void *buf, void *cdrarg)
/*
* kmem_cache_alloc constructor for async request structure.
*/
/* ARGSUSED */
static int
kcf_areq_cache_constructor(void *buf, void *cdrarg, int kmflags)
{
(void) cdrarg, (void) kmflags;
kcf_areq_node_t *areq = (kcf_areq_node_t *)buf;

areq->an_type = CRYPTO_ASYNCH;
Expand All @@ -1011,10 +1011,10 @@ kcf_areq_cache_constructor(void *buf, void *cdrarg, int kmflags)
return (0);
}

/* ARGSUSED */
static void
kcf_areq_cache_destructor(void *buf, void *cdrarg)
{
(void) cdrarg;
kcf_areq_node_t *areq = (kcf_areq_node_t *)buf;

ASSERT(areq->an_refcnt == 0);
Expand All @@ -1026,10 +1026,10 @@ kcf_areq_cache_destructor(void *buf, void *cdrarg)
/*
* kmem_cache_alloc constructor for kcf_context structure.
*/
/* ARGSUSED */
static int
kcf_context_cache_constructor(void *buf, void *cdrarg, int kmflags)
{
(void) cdrarg, (void) kmflags;
kcf_context_t *kctx = (kcf_context_t *)buf;

kctx->kc_refcnt = 0;
Expand All @@ -1038,10 +1038,10 @@ kcf_context_cache_constructor(void *buf, void *cdrarg, int kmflags)
return (0);
}

/* ARGSUSED */
static void
kcf_context_cache_destructor(void *buf, void *cdrarg)
{
(void) cdrarg;
kcf_context_t *kctx = (kcf_context_t *)buf;

ASSERT(kctx->kc_refcnt == 0);
Expand Down
14 changes: 7 additions & 7 deletions module/icp/io/aes.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ init_keysched(crypto_key_t *key, void *newbie)
/*
* KCF software provider control entry points.
*/
/* ARGSUSED */
static void
aes_provider_status(crypto_provider_handle_t provider, uint_t *status)
{
(void) provider;
*status = CRYPTO_PROVIDER_READY;
}

Expand Down Expand Up @@ -617,11 +617,11 @@ aes_decrypt(crypto_ctx_t *ctx, crypto_data_t *ciphertext,
}


/* ARGSUSED */
static int
aes_encrypt_update(crypto_ctx_t *ctx, crypto_data_t *plaintext,
crypto_data_t *ciphertext, crypto_req_handle_t req)
{
(void) req;
off_t saved_offset;
size_t saved_length, out_len;
int ret = CRYPTO_SUCCESS;
Expand Down Expand Up @@ -769,11 +769,11 @@ aes_decrypt_update(crypto_ctx_t *ctx, crypto_data_t *ciphertext,
return (ret);
}

/* ARGSUSED */
static int
aes_encrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
crypto_req_handle_t req)
{
(void) req;
aes_ctx_t *aes_ctx;
int ret;

Expand Down Expand Up @@ -826,11 +826,11 @@ aes_encrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
return (CRYPTO_SUCCESS);
}

/* ARGSUSED */
static int
aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
crypto_req_handle_t req)
{
(void) req;
aes_ctx_t *aes_ctx;
int ret;
off_t saved_offset;
Expand Down Expand Up @@ -929,13 +929,13 @@ aes_decrypt_final(crypto_ctx_t *ctx, crypto_data_t *data,
return (CRYPTO_SUCCESS);
}

/* ARGSUSED */
static int
aes_encrypt_atomic(crypto_provider_handle_t provider,
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
crypto_key_t *key, crypto_data_t *plaintext, crypto_data_t *ciphertext,
crypto_spi_ctx_template_t template, crypto_req_handle_t req)
{
(void) provider, (void) session_id;
aes_ctx_t aes_ctx; /* on the stack */
off_t saved_offset;
size_t saved_length;
Expand Down Expand Up @@ -1065,13 +1065,13 @@ aes_encrypt_atomic(crypto_provider_handle_t provider,
return (ret);
}

/* ARGSUSED */
static int
aes_decrypt_atomic(crypto_provider_handle_t provider,
crypto_session_id_t session_id, crypto_mechanism_t *mechanism,
crypto_key_t *key, crypto_data_t *ciphertext, crypto_data_t *plaintext,
crypto_spi_ctx_template_t template, crypto_req_handle_t req)
{
(void) provider, (void) session_id;
aes_ctx_t aes_ctx; /* on the stack */
off_t saved_offset;
size_t saved_length;
Expand Down Expand Up @@ -1235,12 +1235,12 @@ aes_decrypt_atomic(crypto_provider_handle_t provider,
/*
* KCF software provider context template entry points.
*/
/* ARGSUSED */
static int
aes_create_ctx_template(crypto_provider_handle_t provider,
crypto_mechanism_t *mechanism, crypto_key_t *key,
crypto_spi_ctx_template_t *tmpl, size_t *tmpl_size, crypto_req_handle_t req)
{
(void) provider;
void *keysched;
size_t size;
int rv;
Expand Down
Loading

0 comments on commit 4eb02be

Please sign in to comment.