]> git.proxmox.com Git - swtpm.git/commitdiff
swtpm_setup: Use SWTPM_ATTR_UNUSED on unused parameters (BSDs)
authorStefan Berger <stefanb@linux.ibm.com>
Tue, 5 Oct 2021 16:46:40 +0000 (12:46 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Tue, 5 Oct 2021 17:50:45 +0000 (13:50 -0400)
To silence the BSD gcc compiler on unused function parameters,
use SWTPM_ATTR_UNUSED.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/swtpm_setup/swtpm_backend_file.c

index 26aa6bfaf154faab967f77928b60a54cd0349f90..c6b6b1e291aee52139a8bef787844d9cdaf92992 100644 (file)
@@ -12,6 +12,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 
+#include "compiler_dependencies.h"
 #include "swtpm.h"
 #include "swtpm_utils.h"
 
@@ -48,7 +49,9 @@ static void *parse_file_state(const gchar* uri) {
 }
 
 /* Check user access in 'mode' to file/blockdev specified in backend state. */
-static int check_access(void *state, int mode, const struct passwd *curr_user) {
+static int check_access(void *state,
+                        int mode SWTPM_ATTR_UNUSED,
+                        const struct passwd *curr_user SWTPM_ATTR_UNUSED) {
     const gchar *path = ((struct file_state*)state)->path;
     int ret = access(path, R_OK|W_OK);
     return ret == 0 || errno == ENOENT ? 0 : 1;