From 86ae68a5f7e396a6584b8003667b44a433d914fd Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Wed, 26 Nov 2014 11:30:01 +0100 Subject: [PATCH] coverity: remove dead code in lv_info_with_seg_status Just call return 0 directly on error path, without using "goto" - the code is short, no need to use it this way (the dead code appeared as part of further changes in this function). --- lib/activate/activate.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 60dba1b48..258873bea 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -719,15 +719,13 @@ int lv_info_with_seg_status(struct cmd_context *cmd, const struct logical_volume struct lvinfo *lvinfo, struct lv_seg_status *lv_seg_status, int with_open_count, int with_read_ahead) { - int r = 0; - if (!activation()) return 0; if (lv == lv_seg->lv) { r = _lv_info(cmd, lv, use_layer, lvinfo, lv_seg, lv_seg_status, with_open_count, with_read_ahead); - goto out; + return 0; } /* @@ -737,10 +735,6 @@ int lv_info_with_seg_status(struct cmd_context *cmd, const struct logical_volume */ return _lv_info(cmd, lv, use_layer, lvinfo, NULL, NULL, with_open_count, with_read_ahead) && _lv_info(cmd, lv_seg->lv, use_layer, NULL, lv_seg, lv_seg_status, 0, 0); - - r = 1; -out: - return r; } #define OPEN_COUNT_CHECK_RETRIES 25