public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH-next] modpost: Remove logically dead condition
@ 2024-11-27 16:29 Advait Dhamorikar
  2024-11-27 20:51 ` Nicolas Schier
  0 siblings, 1 reply; 4+ messages in thread
From: Advait Dhamorikar @ 2024-11-27 16:29 UTC (permalink / raw)
  To: Masahiro Yamada, Nathan Chancellor, Nicolas Schier
  Cc: linux-kbuild, linux-kernel, Advait Dhamorikar

In case of failure vsnprintf returns `pos`, an unsigned long integer.
An unsigned value can never be negative, so this test will always evaluate 
the same way. 

Signed-off-by: Advait Dhamorikar <advaitdhamorikar@gmail.com>
---
 scripts/mod/file2alias.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 81f20ef13a0d..8ce48d7dd36d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -57,11 +57,6 @@ module_alias_printf(struct module *mod, bool append_wildcard,
 	n = vsnprintf(NULL, 0, fmt, ap);
 	va_end(ap);
 
-	if (n < 0) {
-		error("vsnprintf failed\n");
-		return;
-	}
-
 	len = n + 1;	/* extra byte for '\0' */
 
 	if (append_wildcard)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-11-27 23:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-27 16:29 [PATCH-next] modpost: Remove logically dead condition Advait Dhamorikar
2024-11-27 20:51 ` Nicolas Schier
2024-11-27 21:30   ` Advait Dhamorikar
2024-11-27 23:30     ` Masahiro Yamada

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox