Drop unused type parameter from LUKS2_keyslot_find_empty()

This commit is contained in:
Ondrej Kozina
2019-04-10 15:54:20 +02:00
committed by Milan Broz
parent cfe2fb66ab
commit 86b2736480
4 changed files with 5 additions and 5 deletions

View File

@@ -432,7 +432,7 @@ int LUKS2_keyslot_params_default(struct crypt_device *cd, struct luks2_hdr *hdr,
int LUKS2_get_volume_key_size(struct luks2_hdr *hdr, int segment); int LUKS2_get_volume_key_size(struct luks2_hdr *hdr, int segment);
int LUKS2_get_keyslot_stored_key_size(struct luks2_hdr *hdr, int keyslot); int LUKS2_get_keyslot_stored_key_size(struct luks2_hdr *hdr, int keyslot);
const char *LUKS2_get_keyslot_cipher(struct luks2_hdr *hdr, int keyslot, size_t *key_size); const char *LUKS2_get_keyslot_cipher(struct luks2_hdr *hdr, int keyslot, size_t *key_size);
int LUKS2_keyslot_find_empty(struct luks2_hdr *hdr, const char *type); int LUKS2_keyslot_find_empty(struct luks2_hdr *hdr);
int LUKS2_keyslot_active_count(struct luks2_hdr *hdr, int segment); int LUKS2_keyslot_active_count(struct luks2_hdr *hdr, int segment);
int LUKS2_keyslot_for_segment(struct luks2_hdr *hdr, int keyslot, int segment); int LUKS2_keyslot_for_segment(struct luks2_hdr *hdr, int keyslot, int segment);
crypt_keyslot_info LUKS2_keyslot_info(struct luks2_hdr *hdr, int keyslot); crypt_keyslot_info LUKS2_keyslot_info(struct luks2_hdr *hdr, int keyslot);

View File

@@ -63,7 +63,7 @@ static const keyslot_handler
return LUKS2_keyslot_handler_type(cd, json_object_get_string(jobj2)); return LUKS2_keyslot_handler_type(cd, json_object_get_string(jobj2));
} }
int LUKS2_keyslot_find_empty(struct luks2_hdr *hdr, const char *type) int LUKS2_keyslot_find_empty(struct luks2_hdr *hdr)
{ {
int i; int i;

View File

@@ -475,7 +475,7 @@ static int luks2_keyslot_alloc(struct crypt_device *cd,
return -EINVAL; return -EINVAL;
if (keyslot == CRYPT_ANY_SLOT) if (keyslot == CRYPT_ANY_SLOT)
keyslot = LUKS2_keyslot_find_empty(hdr, "luks2"); keyslot = LUKS2_keyslot_find_empty(hdr);
if (keyslot < 0 || keyslot >= LUKS2_KEYSLOTS_MAX) if (keyslot < 0 || keyslot >= LUKS2_KEYSLOTS_MAX)
return -ENOMEM; return -ENOMEM;

View File

@@ -396,7 +396,7 @@ static int keyslot_verify_or_find_empty(struct crypt_device *cd, int *keyslot)
if (isLUKS1(cd->type)) if (isLUKS1(cd->type))
*keyslot = LUKS_keyslot_find_empty(&cd->u.luks1.hdr); *keyslot = LUKS_keyslot_find_empty(&cd->u.luks1.hdr);
else else
*keyslot = LUKS2_keyslot_find_empty(&cd->u.luks2.hdr, "luks2"); *keyslot = LUKS2_keyslot_find_empty(&cd->u.luks2.hdr);
if (*keyslot < 0) { if (*keyslot < 0) {
log_err(cd, _("All key slots full.")); log_err(cd, _("All key slots full."));
return -EINVAL; return -EINVAL;
@@ -3228,7 +3228,7 @@ int crypt_keyslot_change_by_passphrase(struct crypt_device *cd,
if (isLUKS1(cd->type)) if (isLUKS1(cd->type))
keyslot_new = LUKS_keyslot_find_empty(&cd->u.luks1.hdr); keyslot_new = LUKS_keyslot_find_empty(&cd->u.luks1.hdr);
else if (isLUKS2(cd->type)) else if (isLUKS2(cd->type))
keyslot_new = LUKS2_keyslot_find_empty(&cd->u.luks2.hdr, "luks2"); // FIXME keyslot_new = LUKS2_keyslot_find_empty(&cd->u.luks2.hdr);
if (keyslot_new < 0) if (keyslot_new < 0)
keyslot_new = keyslot_old; keyslot_new = keyslot_old;
} }