* [Patch] netpoll: warn when there are spaces in parameters
@ 2010-03-17 10:12 Amerigo Wang
2010-03-17 10:58 ` Frans Pop
0 siblings, 1 reply; 3+ messages in thread
From: Amerigo Wang @ 2010-03-17 10:12 UTC (permalink / raw)
To: linux-kernel; +Cc: netdev, Amerigo Wang, David Miller
Currently, if we leave spaces before dst port,
netconsole will silently accept it as 0. Warn about this.
Also, when spaces appear in other places, make them
visible in error messages.
Signed-off-by: WANG Cong <amwang@redhat.com>
Cc: David Miller <davem@davemloft.net>
---
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index 7aa6972..6df1863 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -614,7 +614,7 @@ void netpoll_print_options(struct netpoll *np)
np->name, np->local_port);
printk(KERN_INFO "%s: local IP %pI4\n",
np->name, &np->local_ip);
- printk(KERN_INFO "%s: interface %s\n",
+ printk(KERN_INFO "%s: interface '%s'\n",
np->name, np->dev_name);
printk(KERN_INFO "%s: remote port %d\n",
np->name, np->remote_port);
@@ -661,6 +661,9 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
if ((delim = strchr(cur, '@')) == NULL)
goto parse_failed;
*delim = 0;
+ if (*cur == ' ' || *cur == '\t')
+ printk(KERN_INFO "%s: warning: white spaces"
+ "are not allowed.\n", np->name);
np->remote_port = simple_strtol(cur, NULL, 10);
cur = delim;
}
@@ -708,7 +711,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
return 0;
parse_failed:
- printk(KERN_INFO "%s: couldn't parse config at %s!\n",
+ printk(KERN_INFO "%s: couldn't parse config at '%s'!\n",
np->name, cur);
return -1;
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Patch] netpoll: warn when there are spaces in parameters
2010-03-17 10:12 [Patch] netpoll: warn when there are spaces in parameters Amerigo Wang
@ 2010-03-17 10:58 ` Frans Pop
2010-03-18 2:02 ` Cong Wang
0 siblings, 1 reply; 3+ messages in thread
From: Frans Pop @ 2010-03-17 10:58 UTC (permalink / raw)
To: Amerigo Wang; +Cc: linux-kernel, netdev, amwang, davem
Amerigo Wang wrote:
> + if (*cur == ' ' || *cur == '\t')
> + printk(KERN_INFO "%s: warning: white spaces"
> + "are not allowed.\n", np->name);
>
The term "white spaces" not correct. Please change the message to
"whitespace is not allowed".
Also, it's normally not necessary to close kernel messages with a period;
most kernel messages do not have a closing period. Messages are not
sentences and the periods only help increase the kernel size.
Thanks,
FJP
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Patch] netpoll: warn when there are spaces in parameters
2010-03-17 10:58 ` Frans Pop
@ 2010-03-18 2:02 ` Cong Wang
0 siblings, 0 replies; 3+ messages in thread
From: Cong Wang @ 2010-03-18 2:02 UTC (permalink / raw)
To: Frans Pop; +Cc: linux-kernel, netdev, davem
Frans Pop wrote:
> Amerigo Wang wrote:
>> + if (*cur == ' ' || *cur == '\t')
>> + printk(KERN_INFO "%s: warning: white spaces"
>> + "are not allowed.\n", np->name);
>>
>
> The term "white spaces" not correct. Please change the message to
> "whitespace is not allowed".
>
> Also, it's normally not necessary to close kernel messages with a period;
> most kernel messages do not have a closing period. Messages are not
> sentences and the periods only help increase the kernel size.
>
Ok, I will update it.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-03-18 2:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-17 10:12 [Patch] netpoll: warn when there are spaces in parameters Amerigo Wang
2010-03-17 10:58 ` Frans Pop
2010-03-18 2:02 ` Cong Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).