From bd4db59197093f2100cab5d1a1b61ddf251d41d8 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 28 Sep 2017 15:48:06 +0800 Subject: [PATCH] os/bluestore: do not assign never read variable 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 --- src/os/bluestore/BlueStore.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index 8aee9035181..f2bb4c055c8 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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 " -- 2.39.5