From 807a5a7b1333bf9fc857ec73c3ec0d827c1064f5 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Sun, 25 Sep 2011 19:45:40 +0000 Subject: [PATCH] Remove test for NULL Since it's internal function and we always check for NULL value before call - this is safe. Just for case add nonnull attribute so analyzer might better catch error. --- libdm/libdm-config.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libdm/libdm-config.c b/libdm/libdm-config.c index 5280953b6..a831936e2 100644 --- a/libdm/libdm-config.c +++ b/libdm/libdm-config.c @@ -1225,14 +1225,12 @@ unsigned dm_config_maybe_section(const char *str, unsigned len) return 0; } +__attribute__((nonnull(1, 2))) static struct dm_config_value *_clone_config_value(struct dm_pool *mem, const struct dm_config_value *v) { struct dm_config_value *new_cv; - if (!v) - return NULL; - if (!(new_cv = _create_value(mem))) { log_error("Failed to clone config value."); return NULL;