]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
blkpr: fix compilation [-Werror,-Wunused-function]
authorKarel Zak <kzak@redhat.com>
Tue, 13 Jan 2026 12:23:39 +0000 (13:23 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 13 Jan 2026 12:23:39 +0000 (13:23 +0100)
sys-utils/blkpr.c:171:27: error: unused function 'type_to_str' [-Werror,-Wunused-function]

Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/blkpr.c

index dfa18f783327d7ebe45d83bb49bb02d5e3392c87..5e5e107e34d918cf73605db2c343cb1e97e81dd9 100644 (file)
@@ -168,17 +168,6 @@ static int parse_type_by_str(const struct type_string *ts, int nmem, char *patte
        return -1;
 }
 
-static inline const char *type_to_str(const struct type_string *ts, int nmem,
-                                      int type)
-{
-       int i;
-
-       for (i = 0; i < nmem; i++) {
-               if (ts[i].type == type)
-                       return ts[i].str;
-       }
-       return "unknown type";
-}
 
 
 #define PRINT_SUPPORTED(XX) \
@@ -233,6 +222,18 @@ out:
 #endif /* IOC_PR_READ_KEYS */
 
 #ifdef IOC_PR_READ_RESERVATION
+static inline const char *type_to_str(const struct type_string *ts, int nmem,
+                                      int type)
+{
+       int i;
+
+       for (i = 0; i < nmem; i++) {
+               if (ts[i].type == type)
+                       return ts[i].str;
+       }
+       return "unknown type";
+}
+
 static int do_pr_read_reservation(int fd)
 {
        struct pr_read_reservation pr_rr;