Linux Modules
 help / color / mirror / Atom feed
From: Emil Velikov <emil.l.velikov@gmail.com>
To: linux-modules@vger.kernel.org
Cc: emil.l.velikov@gmail.com
Subject: [PATCH 1/4] libkmod: remove unused kmod_module_get_builtin
Date: Tue, 21 Feb 2023 13:19:26 +0000	[thread overview]
Message-ID: <20230221131929.106951-2-emil.l.velikov@gmail.com> (raw)
In-Reply-To: <20230221131929.106951-1-emil.l.velikov@gmail.com>

From: Emil Velikov <emil.velikov@collabora.com>

The last and only user was removed with commit 0246e06 ("depmod: Stop
opening modules.modinfo once per module")

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
---
 libkmod/libkmod-internal.h |  1 -
 libkmod/libkmod-module.c   | 43 --------------------------------------
 2 files changed, 44 deletions(-)

diff --git a/libkmod/libkmod-internal.h b/libkmod/libkmod-internal.h
index c22644a..95c0377 100644
--- a/libkmod/libkmod-internal.h
+++ b/libkmod/libkmod-internal.h
@@ -148,7 +148,6 @@ void kmod_module_set_visited(struct kmod_module *mod, bool visited) __attribute_
 void kmod_module_set_builtin(struct kmod_module *mod, bool builtin) __attribute__((nonnull((1))));
 void kmod_module_set_required(struct kmod_module *mod, bool required) __attribute__((nonnull(1)));
 bool kmod_module_is_builtin(struct kmod_module *mod) __attribute__((nonnull(1)));
-int kmod_module_get_builtin(struct kmod_ctx *ctx, struct kmod_list **list) __attribute__((nonnull(1, 2)));
 
 /* libkmod-file.c */
 struct kmod_file *kmod_file_open(const struct kmod_ctx *ctx, const char *filename) _must_check_ __attribute__((nonnull(1,2)));
diff --git a/libkmod/libkmod-module.c b/libkmod/libkmod-module.c
index c7232e0..1da64b3 100644
--- a/libkmod/libkmod-module.c
+++ b/libkmod/libkmod-module.c
@@ -2943,46 +2943,3 @@ KMOD_EXPORT void kmod_module_dependency_symbols_free_list(struct kmod_list *list
 		list = kmod_list_remove(list);
 	}
 }
-
-/**
- * kmod_module_get_builtin:
- * @ctx: kmod library context
- * @list: where to save the builtin module list
- *
- * Returns: 0 on success or < 0 otherwise.
- */
-int kmod_module_get_builtin(struct kmod_ctx *ctx, struct kmod_list **list)
-{
-	struct kmod_builtin_iter *iter;
-	int err = 0;
-
-	iter = kmod_builtin_iter_new(ctx);
-	if (!iter)
-		return -errno;
-
-	while (kmod_builtin_iter_next(iter)) {
-		struct kmod_module *mod = NULL;
-		char modname[PATH_MAX];
-
-		if (!kmod_builtin_iter_get_modname(iter, modname)) {
-			err = -errno;
-			goto fail;
-		}
-
-		err = kmod_module_new_from_name(ctx, modname, &mod);
-		if (err < 0)
-			goto fail;
-
-		kmod_module_set_builtin(mod, true);
-
-		*list = kmod_list_append(*list, mod);
-	}
-
-	kmod_builtin_iter_free(iter);
-	return err;
-fail:
-	kmod_builtin_iter_free(iter);
-	kmod_module_unref_list(*list);
-	*list = NULL;
-	return err;
-}
-- 
2.39.2


  reply	other threads:[~2023-02-21 13:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-21 13:19 [PATCH 0/4] kmod: Paper cuts - dead code removal, don't SED manually Emil Velikov
2023-02-21 13:19 ` Emil Velikov [this message]
2023-02-21 13:19 ` [PATCH 2/4] libkmod: annotate kmod_builtin_iter API as static Emil Velikov
2023-02-21 13:19 ` [PATCH 3/4] shared: annotate local " Emil Velikov
2023-02-21 13:19 ` [PATCH 4/4] configure: manage libkmod.pc.in and version.py.in via AC_CONFIG_FILES Emil Velikov
2023-02-22  0:40 ` [PATCH 0/4] kmod: Paper cuts - dead code removal, don't SED manually Lucas De Marchi
2023-02-22 11:50   ` Emil Velikov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230221131929.106951-2-emil.l.velikov@gmail.com \
    --to=emil.l.velikov@gmail.com \
    --cc=linux-modules@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox