From 6f7895fa5b6736bfcd8be2ff6dfa20ab6b4343d5 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sun, 12 Jul 2020 01:04:19 +0800 Subject: [PATCH] blk/BlockDevice: use ceph_assertf() for assert also silences a warning like src/blk/BlockDevice.cc:158:1: warning: label 'out_fail' defined but not used [-Wunused-label] 158 | out_fail: | ^~~~~~~~ Signed-off-by: Kefu Chai --- src/blk/BlockDevice.cc | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/blk/BlockDevice.cc b/src/blk/BlockDevice.cc index 8a6763b448d..64abde6e386 100644 --- a/src/blk/BlockDevice.cc +++ b/src/blk/BlockDevice.cc @@ -135,11 +135,7 @@ BlockDevice *BlockDevice::create(CephContext* cct, const string& path, if (r == 1) { return new HMSMRDevice(cct, cb, cbpriv, d_cb, d_cbpriv); } - if (r < 0) { - derr << __func__ << " zbc_device_is_zoned(" << path << ") failed: " - << cpp_strerror(r) << dendl; - goto out_fail; - } + ceph_assertf(r >= 0, "zbc_device_is_zoned(%s) failed: %d", path.c_str(), r); #endif if (type == "kernel") { return new KernelDevice(cct, cb, cbpriv, d_cb, d_cbpriv); @@ -155,7 +151,6 @@ BlockDevice *BlockDevice::create(CephContext* cct, const string& path, derr << __func__ << " unknown backend " << type << dendl; -out_fail: ceph_abort(); return NULL; } -- 2.39.5