From 7475907d1ab0c3f57cd238380124184dda98b3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Wed, 24 Nov 2021 10:19:49 +0000 Subject: [PATCH] util: rename typedef for parsing swtpm capabilities MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Best practice is to have all types use a naming convention based on the filename. Reviewed-by: Ján Tomko Signed-off-by: Daniel P. Berrangé --- src/util/virtpm.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index d5d80aa9dc..1a34f8ce56 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -107,7 +107,7 @@ static virBitmap *swtpm_setup_caps; static char *swtpm_ioctl_path; static struct stat swtpm_ioctl_stat; -typedef int (*TypeFromStringFn)(const char *); +typedef int (*virTPMBinaryCapsParse)(const char *); char * virTPMGetSwtpm(void) @@ -171,7 +171,7 @@ virTPMGetSwtpmIoctl(void) */ static virBitmap * virTPMExecGetCaps(virCommand *cmd, - TypeFromStringFn typeFromStringFn) + virTPMBinaryCapsParse capsParse) { int exitstatus; virBitmap *bitmap; @@ -214,7 +214,7 @@ virTPMExecGetCaps(virCommand *cmd, str = virJSONValueGetString(item); if (!str) goto error_bad_json; - typ = typeFromStringFn(str); + typ = capsParse(str); if (typ < 0) continue; @@ -231,8 +231,8 @@ virTPMExecGetCaps(virCommand *cmd, } static virBitmap * -virTPMGetCaps(TypeFromStringFn typeFromStringFn, - const char *exec, const char *param1) +virTPMGetCaps(virTPMBinaryCapsParse capsParse, + const char *exec, const char *param1) { g_autoptr(virCommand) cmd = NULL; @@ -244,7 +244,7 @@ virTPMGetCaps(TypeFromStringFn typeFromStringFn, virCommandAddArg(cmd, "--print-capabilities"); virCommandClearCaps(cmd); - return virTPMExecGetCaps(cmd, typeFromStringFn); + return virTPMExecGetCaps(cmd, capsParse); } /* @@ -263,7 +263,7 @@ virTPMEmulatorInit(void) struct stat *stat; const char *parm; virBitmap **caps; - TypeFromStringFn typeFromStringFn; + virTPMBinaryCapsParse capsParse; } prgs[] = { { .name = "swtpm", @@ -271,14 +271,14 @@ virTPMEmulatorInit(void) .stat = &swtpm_stat, .parm = "socket", .caps = &swtpm_caps, - .typeFromStringFn = virTPMSwtpmFeatureTypeFromString, + .capsParse = virTPMSwtpmFeatureTypeFromString, }, { .name = "swtpm_setup", .path = &swtpm_setup_path, .stat = &swtpm_setup_stat, .caps = &swtpm_setup_caps, - .typeFromStringFn = virTPMSwtpmSetupFeatureTypeFromString, + .capsParse = virTPMSwtpmSetupFeatureTypeFromString, }, { .name = "swtpm_ioctl", @@ -329,7 +329,7 @@ virTPMEmulatorInit(void) *prgs[i].path = g_steal_pointer(&path); if (prgs[i].caps) { - *prgs[i].caps = virTPMGetCaps(prgs[i].typeFromStringFn, + *prgs[i].caps = virTPMGetCaps(prgs[i].capsParse, *prgs[i].path, prgs[i].parm); if (!*prgs[i].caps) goto cleanup;