[PATCH ethtool] Remove trailing newline in perror messages

Subsystems: the rest

STALE1810d

2 messages, 2 authors, 2021-08-24 · open the first message on its own page

[PATCH ethtool] Remove trailing newline in perror messages

From: Jules Maselbas <hidden>
Date: 2021-08-11 14:51:15

perror append additional text at the end of the error message,
and will also include a newline. The newline in the error message
it self is not needed and can be removed. This makes errors much
nicer to read.

Signed-off-by: Jules Maselbas <redacted>
---
 ethtool.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ethtool.c b/ethtool.c
index 33a0a49..d4c861f 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -2122,7 +2122,7 @@ static int do_gchannels(struct cmd_context *ctx)
 		if (err)
 			return err;
 	} else {
-		perror("Cannot get device channel parameters\n");
+		perror("Cannot get device channel parameters");
 		return 1;
 	}
 	return 0;
@@ -4613,7 +4613,7 @@ static int do_getfwdump(struct cmd_context *ctx)
 
 	err = send_ioctl(ctx, &edata);
 	if (err < 0) {
-		perror("Can not get dump level\n");
+		perror("Can not get dump level");
 		return 1;
 	}
 	if (dump_flag != ETHTOOL_GET_DUMP_DATA) {
@@ -4623,14 +4623,14 @@ static int do_getfwdump(struct cmd_context *ctx)
 	}
 	data = calloc(1, offsetof(struct ethtool_dump, data) + edata.len);
 	if (!data) {
-		perror("Can not allocate enough memory\n");
+		perror("Can not allocate enough memory");
 		return 1;
 	}
 	data->cmd = ETHTOOL_GET_DUMP_DATA;
 	data->len = edata.len;
 	err = send_ioctl(ctx, data);
 	if (err < 0) {
-		perror("Can not get dump data\n");
+		perror("Can not get dump data");
 		err = 1;
 		goto free;
 	}
@@ -4654,7 +4654,7 @@ static int do_setfwdump(struct cmd_context *ctx)
 	dump.flag = dump_flag;
 	err = send_ioctl(ctx, &dump);
 	if (err < 0) {
-		perror("Can not set dump level\n");
+		perror("Can not set dump level");
 		return 1;
 	}
 	return 0;
-- 
2.17.1

Re: [PATCH ethtool] Remove trailing newline in perror messages

From: patchwork-bot+netdevbpf@kernel.org
Date: 2021-08-24 17:41:12

Hello:

This patch was applied to ethtool/ethtool.git (refs/heads/master):

On Wed, 11 Aug 2021 16:43:59 +0200 you wrote:
perror append additional text at the end of the error message,
and will also include a newline. The newline in the error message
it self is not needed and can be removed. This makes errors much
nicer to read.

Signed-off-by: Jules Maselbas <redacted>

[...]
Here is the summary with links:
  - [ethtool] Remove trailing newline in perror messages
    https://git.kernel.org/pub/scm/network/ethtool/ethtool.git/commit/?id=abe26809f5c7

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help