]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
modinfo: omit param::desc == NULL case
authorEmil Velikov <emil.l.velikov@gmail.com>
Thu, 30 Jul 2026 14:32:51 +0000 (15:32 +0100)
committerLucas De Marchi <demarchi@kernel.org>
Thu, 6 Aug 2026 01:35:44 +0000 (20:35 -0500)
There is no need for the special case, since printf("%.s", 0, NULL) is a
perfectly valid use.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/451
Signed-off-by: Lucas De Marchi <demarchi@kernel.org>
tools/modinfo.c

index 5091aa32ea887783cb80f819426081845a550c34..b84850151ee5b82c5f94862ced1ae0ad22be4863 100644 (file)
@@ -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