* [PATCH net-next v2 0/3] net_sched: do some cleanup
@ 2013-12-23 9:38 Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 1/3] net_sched: replace pr_warning with pr_warn Yang Yingliang
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Yang Yingliang @ 2013-12-23 9:38 UTC (permalink / raw)
To: davem, netdev
Prefer pr_warn(... to pr_warning(...
Do not use C99 // comments and fix spelling.
Correct function names by using __func__ .
v1 -> v2:
patch 1/3: Don't split messages in "..." into multiple lines.
patch 3/3: Add patch #3.
Yang Yingliang (3):
net_sched: replace pr_warning with pr_warn
sch_htb: use /* comments
sch_dsmark: use correct func name in print messages
net/sched/sch_cbq.c | 4 ++--
net/sched/sch_dsmark.c | 37 +++++++++++++++++++------------------
net/sched/sch_gred.c | 4 ++--
net/sched/sch_htb.c | 19 +++++++++----------
4 files changed, 32 insertions(+), 32 deletions(-)
--
1.8.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next v2 1/3] net_sched: replace pr_warning with pr_warn
2013-12-23 9:38 [PATCH net-next v2 0/3] net_sched: do some cleanup Yang Yingliang
@ 2013-12-23 9:38 ` Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 2/3] sch_htb: use /* comments Yang Yingliang
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Yang Yingliang @ 2013-12-23 9:38 UTC (permalink / raw)
To: davem, netdev
Prefer pr_warn(... to pr_warning(...
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_cbq.c | 4 ++--
net/sched/sch_dsmark.c | 4 ++--
net/sched/sch_gred.c | 4 ++--
net/sched/sch_htb.c | 12 +++++-------
4 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
index e251833..2f80d01 100644
--- a/net/sched/sch_cbq.c
+++ b/net/sched/sch_cbq.c
@@ -1060,8 +1060,8 @@ static void cbq_normalize_quanta(struct cbq_sched_data *q, int prio)
}
if (cl->quantum <= 0 ||
cl->quantum > 32*qdisc_dev(cl->qdisc)->mtu) {
- pr_warning("CBQ: class %08x has bad quantum==%ld, repaired.\n",
- cl->common.classid, cl->quantum);
+ pr_warn("CBQ: class %08x has bad quantum==%ld, repaired.\n",
+ cl->common.classid, cl->quantum);
cl->quantum = qdisc_dev(cl->qdisc)->mtu/2 + 1;
}
}
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 0952fd2..7cd49e5 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -303,8 +303,8 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
* and don't need yet another qdisc as a bypass.
*/
if (p->mask[index] != 0xff || p->value[index])
- pr_warning("dsmark_dequeue: unsupported protocol %d\n",
- ntohs(skb->protocol));
+ pr_warn("dsmark_dequeue: unsupported protocol %d\n",
+ ntohs(skb->protocol));
break;
}
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index d42234c..12cbc09 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -370,8 +370,8 @@ static inline int gred_change_table_def(struct Qdisc *sch, struct nlattr *dps)
for (i = table->DPs; i < MAX_DPs; i++) {
if (table->tab[i]) {
- pr_warning("GRED: Warning: Destroying "
- "shadowed VQ 0x%x\n", i);
+ pr_warn("GRED: Warning: Destroying shadowed VQ 0x%x\n",
+ i);
gred_destroy_vq(table->tab[i]);
table->tab[i] = NULL;
}
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index 6b0e854..e598810 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -712,7 +712,7 @@ static s64 htb_do_events(struct htb_sched *q, const int level,
/* too much load - let's continue after a break for scheduling */
if (!(q->warned & HTB_WARN_TOOMANYEVENTS)) {
- pr_warning("htb: too many events!\n");
+ pr_warn("htb: too many events!\n");
q->warned |= HTB_WARN_TOOMANYEVENTS;
}
@@ -1488,15 +1488,13 @@ static int htb_change_class(struct Qdisc *sch, u32 classid,
cl->quantum = min_t(u64, quantum, INT_MAX);
if (!hopt->quantum && cl->quantum < 1000) {
- pr_warning(
- "HTB: quantum of class %X is small. Consider r2q change.\n",
- cl->common.classid);
+ pr_warn("HTB: quantum of class %X is small. Consider r2q change.\n",
+ cl->common.classid);
cl->quantum = 1000;
}
if (!hopt->quantum && cl->quantum > 200000) {
- pr_warning(
- "HTB: quantum of class %X is big. Consider r2q change.\n",
- cl->common.classid);
+ pr_warn("HTB: quantum of class %X is big. Consider r2q change.\n",
+ cl->common.classid);
cl->quantum = 200000;
}
if (hopt->quantum)
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v2 2/3] sch_htb: use /* comments
2013-12-23 9:38 [PATCH net-next v2 0/3] net_sched: do some cleanup Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 1/3] net_sched: replace pr_warning with pr_warn Yang Yingliang
@ 2013-12-23 9:38 ` Yang Yingliang
2013-12-23 9:39 ` [PATCH net-next v2 3/3] sch_dsmark: use correct func name in print messages Yang Yingliang
2013-12-31 18:51 ` [PATCH net-next v2 0/3] net_sched: do some cleanup David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Yang Yingliang @ 2013-12-23 9:38 UTC (permalink / raw)
To: davem, netdev
Do not use C99 // comments and correct a spelling typo.
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_htb.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c
index e598810..0db5a6e 100644
--- a/net/sched/sch_htb.c
+++ b/net/sched/sch_htb.c
@@ -1276,9 +1276,10 @@ static int htb_delete(struct Qdisc *sch, unsigned long arg)
struct Qdisc *new_q = NULL;
int last_child = 0;
- // TODO: why don't allow to delete subtree ? references ? does
- // tc subsys quarantee us that in htb_destroy it holds no class
- // refs so that we can remove children safely there ?
+ /* TODO: why don't allow to delete subtree ? references ? does
+ * tc subsys guarantee us that in htb_destroy it holds no class
+ * refs so that we can remove children safely there ?
+ */
if (cl->children || cl->filter_cnt)
return -EBUSY;
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v2 3/3] sch_dsmark: use correct func name in print messages
2013-12-23 9:38 [PATCH net-next v2 0/3] net_sched: do some cleanup Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 1/3] net_sched: replace pr_warning with pr_warn Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 2/3] sch_htb: use /* comments Yang Yingliang
@ 2013-12-23 9:39 ` Yang Yingliang
2013-12-31 18:51 ` [PATCH net-next v2 0/3] net_sched: do some cleanup David Miller
3 siblings, 0 replies; 5+ messages in thread
From: Yang Yingliang @ 2013-12-23 9:39 UTC (permalink / raw)
To: davem, netdev
In dsmark_drop(), the function name printed by pr_debug
is "dsmark_reset", correct it to "dsmark_drop" by using
__func__ .
BTW, replace the other function names with __func__ .
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
---
net/sched/sch_dsmark.c | 37 +++++++++++++++++++------------------
1 file changed, 19 insertions(+), 18 deletions(-)
diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c
index 7cd49e5..49d6ef3 100644
--- a/net/sched/sch_dsmark.c
+++ b/net/sched/sch_dsmark.c
@@ -57,8 +57,8 @@ static int dsmark_graft(struct Qdisc *sch, unsigned long arg,
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);
- pr_debug("dsmark_graft(sch %p,[qdisc %p],new %p,old %p)\n",
- sch, p, new, old);
+ pr_debug("%s(sch %p,[qdisc %p],new %p,old %p)\n",
+ __func__, sch, p, new, old);
if (new == NULL) {
new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
@@ -85,8 +85,8 @@ static struct Qdisc *dsmark_leaf(struct Qdisc *sch, unsigned long arg)
static unsigned long dsmark_get(struct Qdisc *sch, u32 classid)
{
- pr_debug("dsmark_get(sch %p,[qdisc %p],classid %x)\n",
- sch, qdisc_priv(sch), classid);
+ pr_debug("%s(sch %p,[qdisc %p],classid %x)\n",
+ __func__, sch, qdisc_priv(sch), classid);
return TC_H_MIN(classid) + 1;
}
@@ -118,8 +118,8 @@ static int dsmark_change(struct Qdisc *sch, u32 classid, u32 parent,
int err = -EINVAL;
u8 mask = 0;
- pr_debug("dsmark_change(sch %p,[qdisc %p],classid %x,parent %x),"
- "arg 0x%lx\n", sch, p, classid, parent, *arg);
+ pr_debug("%s(sch %p,[qdisc %p],classid %x,parent %x), arg 0x%lx\n",
+ __func__, sch, p, classid, parent, *arg);
if (!dsmark_valid_index(p, *arg)) {
err = -ENOENT;
@@ -166,7 +166,8 @@ static void dsmark_walk(struct Qdisc *sch, struct qdisc_walker *walker)
struct dsmark_qdisc_data *p = qdisc_priv(sch);
int i;
- pr_debug("dsmark_walk(sch %p,[qdisc %p],walker %p)\n", sch, p, walker);
+ pr_debug("%s(sch %p,[qdisc %p],walker %p)\n",
+ __func__, sch, p, walker);
if (walker->stop)
return;
@@ -199,7 +200,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
struct dsmark_qdisc_data *p = qdisc_priv(sch);
int err;
- pr_debug("dsmark_enqueue(skb %p,sch %p,[qdisc %p])\n", skb, sch, p);
+ pr_debug("%s(skb %p,sch %p,[qdisc %p])\n", __func__, skb, sch, p);
if (p->set_tc_index) {
switch (skb->protocol) {
@@ -275,7 +276,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
struct sk_buff *skb;
u32 index;
- pr_debug("dsmark_dequeue(sch %p,[qdisc %p])\n", sch, p);
+ pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
skb = p->q->ops->dequeue(p->q);
if (skb == NULL)
@@ -303,8 +304,8 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
* and don't need yet another qdisc as a bypass.
*/
if (p->mask[index] != 0xff || p->value[index])
- pr_warn("dsmark_dequeue: unsupported protocol %d\n",
- ntohs(skb->protocol));
+ pr_warn("%s: unsupported protocol %d\n",
+ __func__, ntohs(skb->protocol));
break;
}
@@ -315,7 +316,7 @@ static struct sk_buff *dsmark_peek(struct Qdisc *sch)
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);
- pr_debug("dsmark_peek(sch %p,[qdisc %p])\n", sch, p);
+ pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
return p->q->ops->peek(p->q);
}
@@ -325,7 +326,7 @@ static unsigned int dsmark_drop(struct Qdisc *sch)
struct dsmark_qdisc_data *p = qdisc_priv(sch);
unsigned int len;
- pr_debug("dsmark_reset(sch %p,[qdisc %p])\n", sch, p);
+ pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
if (p->q->ops->drop == NULL)
return 0;
@@ -346,7 +347,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
u16 indices;
u8 *mask;
- pr_debug("dsmark_init(sch %p,[qdisc %p],opt %p)\n", sch, p, opt);
+ pr_debug("%s(sch %p,[qdisc %p],opt %p)\n", __func__, sch, p, opt);
if (!opt)
goto errout;
@@ -384,7 +385,7 @@ static int dsmark_init(struct Qdisc *sch, struct nlattr *opt)
if (p->q == NULL)
p->q = &noop_qdisc;
- pr_debug("dsmark_init: qdisc %p\n", p->q);
+ pr_debug("%s: qdisc %p\n", __func__, p->q);
err = 0;
errout:
@@ -395,7 +396,7 @@ static void dsmark_reset(struct Qdisc *sch)
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);
- pr_debug("dsmark_reset(sch %p,[qdisc %p])\n", sch, p);
+ pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
qdisc_reset(p->q);
sch->q.qlen = 0;
}
@@ -404,7 +405,7 @@ static void dsmark_destroy(struct Qdisc *sch)
{
struct dsmark_qdisc_data *p = qdisc_priv(sch);
- pr_debug("dsmark_destroy(sch %p,[qdisc %p])\n", sch, p);
+ pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
tcf_destroy_chain(&p->filter_list);
qdisc_destroy(p->q);
@@ -417,7 +418,7 @@ static int dsmark_dump_class(struct Qdisc *sch, unsigned long cl,
struct dsmark_qdisc_data *p = qdisc_priv(sch);
struct nlattr *opts = NULL;
- pr_debug("dsmark_dump_class(sch %p,[qdisc %p],class %ld\n", sch, p, cl);
+ pr_debug("%s(sch %p,[qdisc %p],class %ld\n", __func__, sch, p, cl);
if (!dsmark_valid_index(p, cl))
return -EINVAL;
--
1.8.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 0/3] net_sched: do some cleanup
2013-12-23 9:38 [PATCH net-next v2 0/3] net_sched: do some cleanup Yang Yingliang
` (2 preceding siblings ...)
2013-12-23 9:39 ` [PATCH net-next v2 3/3] sch_dsmark: use correct func name in print messages Yang Yingliang
@ 2013-12-31 18:51 ` David Miller
3 siblings, 0 replies; 5+ messages in thread
From: David Miller @ 2013-12-31 18:51 UTC (permalink / raw)
To: yangyingliang; +Cc: netdev
From: Yang Yingliang <yangyingliang@huawei.com>
Date: Mon, 23 Dec 2013 17:38:57 +0800
> Prefer pr_warn(... to pr_warning(...
> Do not use C99 // comments and fix spelling.
> Correct function names by using __func__ .
Series applied, thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-12-31 18:51 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-23 9:38 [PATCH net-next v2 0/3] net_sched: do some cleanup Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 1/3] net_sched: replace pr_warning with pr_warn Yang Yingliang
2013-12-23 9:38 ` [PATCH net-next v2 2/3] sch_htb: use /* comments Yang Yingliang
2013-12-23 9:39 ` [PATCH net-next v2 3/3] sch_dsmark: use correct func name in print messages Yang Yingliang
2013-12-31 18:51 ` [PATCH net-next v2 0/3] net_sched: do some cleanup David Miller
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).