From: Lucas De Marchi Date: Mon, 12 Dec 2011 20:36:27 +0000 (-0200) Subject: Fix "Dead assignments" as reported by llvm X-Git-Tag: v1~34 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1c250ec1504150e5be09f2c4a58f9282bf937f86;p=thirdparty%2Fkmod.git Fix "Dead assignments" as reported by llvm --- diff --git a/libkmod/libkmod-config.c b/libkmod/libkmod-config.c index 0b5ac705..44fad72f 100644 --- a/libkmod/libkmod-config.c +++ b/libkmod/libkmod-config.c @@ -402,15 +402,14 @@ static DIR *conf_files_list(struct kmod_ctx *ctx, struct kmod_list **list, DIR *d; int err; + *list = NULL; + d = opendir(path); if (d == NULL) { - err = errno; ERR(ctx, "%m\n"); return NULL; } - *list = NULL; - for (;;) { struct dirent ent, *entp; struct kmod_list *l, *tmp; diff --git a/test/test-rmmod.c b/test/test-rmmod.c index 2f19006e..493af803 100644 --- a/test/test-rmmod.c +++ b/test/test-rmmod.c @@ -32,7 +32,6 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - err = 0; kmod_list_foreach(itr, list) { struct kmod_module *mod = kmod_module_get_module(itr); const char *name = kmod_module_get_name(mod);