Skip to content

Commit f9dcde9

Browse files
committed
libkmod/libkmod-signature: comment out kmod_signature_info::algo
As the comment says, it's unused so we might as well not bother atm. This means, kmod_signature_info fits nicely in 64 bytes, thus being friendlier to the C runtime. While also shaving ~150 bytes off the binary and a few cycles. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
1 parent 946a55c commit f9dcde9

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

libkmod/libkmod-internal.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,11 @@ struct kmod_signature_info {
174174
size_t signer_len;
175175
const char *key_id;
176176
size_t key_id_len;
177-
const char *algo, *hash_algo, *id_type; /* XXX: algo is currently unused. See
178-
kmod_module_get_info */
177+
/*
178+
* XXX: algo is currently unused. See kmod_module_get_info() for more.
179+
* const char *algo;
180+
*/
181+
const char *hash_algo, *id_type;
179182
const char *sig;
180183
size_t sig_len;
181184
};

libkmod/libkmod-signature.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,13 @@ enum pkey_algo {
2828
PKEY_ALGO__LAST,
2929
};
3030

31+
#if 0
32+
/* XXX: algo is currently unused. See kmod_module_get_info() for more. */
3133
static const char *const pkey_algo[PKEY_ALGO__LAST] = {
3234
[PKEY_ALGO_DSA] = "DSA",
3335
[PKEY_ALGO_RSA] = "RSA",
3436
};
37+
#endif
3538

3639
enum pkey_hash_algo {
3740
PKEY_HASH_MD4,
@@ -328,7 +331,7 @@ bool kmod_module_signature_info(const struct kmod_file *file,
328331
}
329332

330333
if (ret == true) {
331-
(*sig_info)->algo = pkey_algo[modsig.algo];
334+
/*(*sig_info)->algo = pkey_algo[modsig.algo]; */
332335
(*sig_info)->id_type = pkey_id_type[modsig.id_type];
333336
}
334337

0 commit comments

Comments
 (0)