From: Emil Velikov Date: Thu, 30 Jul 2026 14:32:51 +0000 (+0100) Subject: modinfo: omit param::desc == NULL case X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4af70817bd8e241d6d9e5fa40105009337041bb2;p=thirdparty%2Fkmod.git modinfo: omit param::desc == NULL case There is no need for the special case, since printf("%.s", 0, NULL) is a perfectly valid use. Signed-off-by: Emil Velikov Link: https://github.com/kmod-project/kmod/pull/451 Signed-off-by: Lucas De Marchi --- diff --git a/tools/modinfo.c b/tools/modinfo.c index 5091aa32..b8485015 100644 --- a/tools/modinfo.c +++ b/tools/modinfo.c @@ -151,10 +151,7 @@ static int modinfo_params_do(const struct kmod_list *list) struct param *p = params; params = p->next; - if (p->desc == NULL) - printf("%.*s: (%.*s)%c", p->namelen, p->name, p->typelen, p->type, - separator); - else if (p->type != NULL) + if (p->type != NULL) printf("%.*s:%.*s (%.*s)%c", p->namelen, p->name, p->desclen, p->desc, p->typelen, p->type, separator); else @@ -253,10 +250,7 @@ static int modinfo_do(struct kmod_module *mod) struct param *p = params; params = p->next; - if (p->desc == NULL) - printf("%-16s%.*s: (%.*s)%c", "parm:", p->namelen, p->name, - p->typelen, p->type, separator); - else if (p->type != NULL) + if (p->type != NULL) printf("%-16s%.*s:%.*s (%.*s)%c", "parm:", p->namelen, p->name, p->desclen, p->desc, p->typelen, p->type, separator); else