All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] module: print sensible error code
@ 2018-06-22 15:38 Jason A. Donenfeld
  2018-06-25  9:02 ` Jessica Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Jason A. Donenfeld @ 2018-06-22 15:38 UTC (permalink / raw)
  To: jeyu, linux-kernel; +Cc: Jason A. Donenfeld

Printing "err 0" to the user in the warning message is not particularly
useful, especially when this gets transformed into a -ENOENT for the
remainder of the call chain.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
---
 kernel/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index f475f30eed8c..c666ab4139f4 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2282,9 +2282,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
 			if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
 				break;
 
-			pr_warn("%s: Unknown symbol %s (err %li)\n",
-				mod->name, name, PTR_ERR(ksym));
 			ret = PTR_ERR(ksym) ?: -ENOENT;
+			pr_warn("%s: Unknown symbol %s (err %d)\n",
+				mod->name, name, ret);
 			break;
 
 		default:
-- 
2.17.1


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

* Re: [PATCH] module: print sensible error code
  2018-06-22 15:38 [PATCH] module: print sensible error code Jason A. Donenfeld
@ 2018-06-25  9:02 ` Jessica Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Jessica Yu @ 2018-06-25  9:02 UTC (permalink / raw)
  To: Jason A. Donenfeld; +Cc: linux-kernel

+++ Jason A. Donenfeld [22/06/18 17:38 +0200]:
>Printing "err 0" to the user in the warning message is not particularly
>useful, especially when this gets transformed into a -ENOENT for the
>remainder of the call chain.
>
>Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Applied, thanks.

Jessica

>---
> kernel/module.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/module.c b/kernel/module.c
>index f475f30eed8c..c666ab4139f4 100644
>--- a/kernel/module.c
>+++ b/kernel/module.c
>@@ -2282,9 +2282,9 @@ static int simplify_symbols(struct module *mod, const struct load_info *info)
> 			if (!ksym && ELF_ST_BIND(sym[i].st_info) == STB_WEAK)
> 				break;
>
>-			pr_warn("%s: Unknown symbol %s (err %li)\n",
>-				mod->name, name, PTR_ERR(ksym));
> 			ret = PTR_ERR(ksym) ?: -ENOENT;
>+			pr_warn("%s: Unknown symbol %s (err %d)\n",
>+				mod->name, name, ret);
> 			break;
>
> 		default:
>-- 
>2.17.1
>

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

end of thread, other threads:[~2018-06-25  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-22 15:38 [PATCH] module: print sensible error code Jason A. Donenfeld
2018-06-25  9:02 ` Jessica Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.