From 320b72437ce3a48ac75e9639a8f4361dd0f7385d Mon Sep 17 00:00:00 2001
From: Thomas Lamprecht <t.lamprecht@proxmox.com>
Date: Mon, 22 Jan 2024 14:42:28 +0100
Subject: [PATCH] tape: drop unused has_encryption helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
---
 pbs-tape/src/sg_tape.rs            |  2 +-
 pbs-tape/src/sg_tape/encryption.rs | 11 -----------
 2 files changed, 1 insertion(+), 12 deletions(-)

diff --git a/pbs-tape/src/sg_tape.rs b/pbs-tape/src/sg_tape.rs
index 44f30fdb2..3ba28a6a0 100644
--- a/pbs-tape/src/sg_tape.rs
+++ b/pbs-tape/src/sg_tape.rs
@@ -9,7 +9,7 @@ use endian_trait::Endian;
 use nix::fcntl::{fcntl, FcntlArg, OFlag};
 
 mod encryption;
-pub use encryption::{drive_set_encryption, drive_get_encryption, has_encryption};
+pub use encryption::{drive_set_encryption, drive_get_encryption};
 
 mod volume_statistics;
 use proxmox_uuid::Uuid;
diff --git a/pbs-tape/src/sg_tape/encryption.rs b/pbs-tape/src/sg_tape/encryption.rs
index d460c2f76..9fafb62a8 100644
--- a/pbs-tape/src/sg_tape/encryption.rs
+++ b/pbs-tape/src/sg_tape/encryption.rs
@@ -8,17 +8,6 @@ use proxmox_io::{ReadExt, WriteExt};
 
 use crate::sgutils2::{alloc_page_aligned_buffer, SgRaw};
 
-/// Test if drive supports hardware encryption
-///
-/// We search for AES_GCM algorithm with 256bits key.
-pub fn has_encryption<F: AsRawFd>(file: &mut F) -> bool {
-    let data = match sg_spin_data_encryption_caps(file) {
-        Ok(data) => data,
-        Err(_) => return false,
-    };
-    decode_spin_data_encryption_caps(&data).is_ok()
-}
-
 /// Set or clear encryption key
 ///
 /// We always use mixed mode,