From: Yang Yingliang <yangyingliang@huawei•com>
To: Sergei Shtylyov <sergei.shtylyov@cogentembedded•com>,
<netdev@vger•kernel.org>
Subject: Re: [PATCH net-next v2 2/3] net_sched: fix some checkpatch errors
Date: Fri, 8 Nov 2013 09:51:19 +0800 [thread overview]
Message-ID: <527C4397.5010803@huawei.com> (raw)
In-Reply-To: <527BA4C4.50704@cogentembedded.com>
On 2013/11/7 22:33, Sergei Shtylyov wrote:
> Hello.
>
> On 07-11-2013 6:13, Yang Yingliang wrote:
>
>> There are some checkpatch errors, fix them.
>
>> Signed-off-by: Yang Yingliang <yangyingliang@huawei•com>
>> Suggested-by: Stephen Hemminger <stephen@networkplumber•org>
> [...]
>
>> diff --git a/net/sched/act_api.c b/net/sched/act_api.c
>> index fd70728..d92a90e9 100644
>> --- a/net/sched/act_api.c
>> +++ b/net/sched/act_api.c
>> @@ -191,7 +191,8 @@ u32 tcf_hash_new_index(u32 *idx_gen, struct tcf_hashinfo *hinfo)
>> val = 1;
>> } while (tcf_hash_lookup(val, hinfo));
>>
>> - return (*idx_gen = val);
>> + *idx_gen = val;
>> + return *idx_gen;
>
> return val;
>
> would have been simpler.
Yeah, i think so.
Thanks
>
>> diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
>> index 7a42c81..a8f40f5 100644
>> --- a/net/sched/sch_cbq.c
>> +++ b/net/sched/sch_cbq.c
>> @@ -1058,7 +1058,8 @@ static void cbq_normalize_quanta(struct cbq_sched_data *q, int prio)
>> cl->quantum = (cl->weight*cl->allot*q->nclasses[prio])/
>> q->quanta[prio];
>> }
>> - if (cl->quantum <= 0 || cl->quantum>32*qdisc_dev(cl->qdisc)->mtu) {
>> + if (cl->quantum <= 0 ||
>> + cl->quantum > 32*qdisc_dev(cl->qdisc)->mtu) {
>
> According to the networking coding style, the continuation line should start right under 'cl' on the first line of *if*. The way you did it makes it harder for the eyes to differentiate the code in the *if* branch from the *if* expression.
>
>> pr_warning("CBQ: class %08x has bad quantum==%ld, repaired.\n",
>> cl->common.classid, cl->quantum);
>> cl->quantum = qdisc_dev(cl->qdisc)->mtu/2 + 1;
> [...]
>
> WBR, Sergei
>
>
>
next prev parent reply other threads:[~2013-11-08 1:51 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-07 2:13 [PATCH net-next v2 0/3] net_sched: make tbf support 64bit rates Yang Yingliang
2013-11-07 2:13 ` [PATCH net-next v2 1/3] net_sched: tbf: support of " Yang Yingliang
2013-11-07 14:25 ` Sergei Shtylyov
2013-11-08 1:40 ` Yang Yingliang
2013-11-07 2:13 ` [PATCH net-next v2 2/3] net_sched: fix some checkpatch errors Yang Yingliang
2013-11-07 8:37 ` Daniel Borkmann
2013-11-08 11:04 ` Bjørn Mork
2013-11-07 14:33 ` Sergei Shtylyov
2013-11-08 1:51 ` Yang Yingliang [this message]
2013-11-07 2:13 ` [PATCH net-next v2 3/3] net_sched: Use pr_debug replace printk(KERN_DEBUG ...) Yang Yingliang
2013-11-07 8:30 ` Daniel Borkmann
2013-11-07 8:43 ` Yang Yingliang
2013-11-07 14:43 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=527C4397.5010803@huawei.com \
--to=yangyingliang@huawei$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=sergei.shtylyov@cogentembedded$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox