]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
cryptsetup: use errno-flavoured logging where we have an errno
authorLennart Poettering <lennart@poettering.net>
Fri, 14 Oct 2022 12:42:37 +0000 (14:42 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Mon, 17 Oct 2022 06:02:03 +0000 (08:02 +0200)
src/cryptsetup/cryptsetup-tokens/cryptsetup-token-systemd-tpm2.c

index 7e958a4db580be7d57c2255a748b87545c448ded..abe80720afe4027568ee3da2c2671045c592fa85 100644 (file)
@@ -24,13 +24,10 @@ _public_ const char *cryptsetup_token_version(void) {
 }
 
 static int log_debug_open_error(struct crypt_device *cd, int r) {
-        if (r == -EAGAIN) {
-                crypt_log_debug(cd, "TPM2 device not found.");
-                return r;
-        } else if (r == -ENXIO) {
-                crypt_log_debug(cd, "No matching TPM2 token data found.");
-                return r;
-        }
+        if (r == -EAGAIN)
+                return crypt_log_debug_errno(cd, r, "TPM2 device not found.");
+        if (r == -ENXIO)
+                return crypt_log_debug_errno(cd, r, "No matching TPM2 token data found.");
 
         return crypt_log_debug_errno(cd, r, TOKEN_NAME " open failed: %m.");
 }