]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: clean up warnings in fscrypt
authorChristopher Hoffman <choffman@redhat.com>
Tue, 23 Sep 2025 14:58:32 +0000 (14:58 +0000)
committerChristopher Hoffman <choffman@redhat.com>
Wed, 5 Nov 2025 13:59:36 +0000 (13:59 +0000)
Fix warnings/errors in ceph API tests that are present in FSCrypt.cc

src/client/FSCrypt.cc:90:6: error: variable 'olen' set but not used [-Werror,-Wunused-but-set-variable]
   90 |         int olen = 0;
      |             ^
src/client/FSCrypt.cc:91:6: error: variable 'line' set but not used [-Werror,-Wunused-but-set-variable]
   91 |         int line = 0;
      |             ^
src/client/FSCrypt.cc:945:2: error: is this the way to do it? [-Werror,-W#warnings]
  945 | #warning is this the way to do it?

Signed-off-by: Christopher Hoffman <choffman@redhat.com>
src/client/FSCrypt.cc

index 60538079629c97588280df93bdd10f0dccdb9ab4..090f97af17f3addfc1e7edd465d680eaeeec6ca9 100644 (file)
@@ -86,9 +86,8 @@ static int set_str_val(char **pdst, const char *end, char c)
 
 static int b64_encode(char *dst, char * const dst_end, const char *src, const char *end)
 {
+
         char *orig_dst = dst;
-       int olen = 0;
-       int line = 0;
 
 #define SET_DST(c) do { \
        int __ret = set_str_val(&dst, dst_end, c); \
@@ -117,8 +116,6 @@ static int b64_encode(char *dst, char * const dst_end, const char *src, const ch
                } else {
                        SET_DST(encode_bits(((a & 3) << 4)));
                }
-               olen += 4;
-               line += 4;
        }
        *dst = '\0';
        return (dst - orig_dst);
@@ -942,7 +939,7 @@ int FSCryptFDataDenc::decrypt_bl(uint64_t off, uint64_t len, uint64_t pos, const
       has_hole = true;
       break;
     }
-#warning is this the way to do it?
+
     uint64_t needed_pos = (pos > off ? pos : off);
     void *data_pos = bl->c_str() + needed_pos - start_block_off;
     if (!has_hole && *(uint64_t *)data_pos == 0) {