From 4125e0c3db9fd8a2102781674db7aae263714aec Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 17 Sep 2025 09:45:47 +0200 Subject: [PATCH] efivars: drop unused "optimization" This was added in c242a082793df77a1dc0bce7f470660ab0a86fe5, and AFAICT, the code was never exercised, not even in the tests. With this chunk gone, if anyone ever calls the function without any output params, we'll do open + fstat instead of access, which will work just fine too. --- src/basic/efivars.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/basic/efivars.c b/src/basic/efivars.c index c30469d136f..86544d1de26 100644 --- a/src/basic/efivars.c +++ b/src/basic/efivars.c @@ -38,15 +38,6 @@ int efi_get_variable( const char *p = strjoina("/sys/firmware/efi/efivars/", variable); - if (!ret_value && !ret_size && !ret_attribute) { - /* If caller is not interested in anything, just check if the variable exists and is - * readable. */ - if (access(p, R_OK) < 0) - return -errno; - - return 0; - } - if (DEBUG_LOGGING) { log_debug("Reading EFI variable %s.", p); begin = now(CLOCK_MONOTONIC); -- 2.47.3