]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: do not assign never read variable
authorKefu Chai <kchai@redhat.com>
Thu, 28 Sep 2017 07:48:06 +0000 (15:48 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 29 Sep 2017 03:01:53 +0000 (11:01 +0800)
shrink the lexical scope of "csum_order" and do not set it if it is
never read.

this silences the clang analyzer warning of:

Value stored to 'csum_order' is never read

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/os/bluestore/BlueStore.cc

index 8aee903518148a051434e7b6add3271d0ec90ab2..f2bb4c055c8de35df34b4f59fc7cf40b26683484 100644 (file)
@@ -10006,16 +10006,15 @@ int BlueStore::_do_alloc_write(
     bufferlist *l = &wi.bl;
     uint64_t final_length = wi.blob_length;
     uint64_t csum_length = wi.blob_length;
-    unsigned csum_order = block_size_order;
     if (wi.compressed) {
       final_length = wi.compressed_bl.length();
       csum_length = final_length;
-      csum_order = ctz(csum_length);
       l = &wi.compressed_bl;
       dblob.set_compressed(wi.blob_length, wi.compressed_len);
     } else if (wi.new_blob) {
       // initialize newly created blob only
       assert(dblob.is_mutable());
+      unsigned csum_order;
       if (l->length() != wi.blob_length) {
         // hrm, maybe we could do better here, but let's not bother.
         dout(20) << __func__ << " forcing csum_order to block_size_order "