]> git.baikalelectronics.ru Git - kernel.git/commit
net: sched: sch_api: rearrange init handling
authorAlexander Aring <aring@mojatatu.com>
Mon, 4 Dec 2017 23:40:00 +0000 (18:40 -0500)
committerDavid S. Miller <davem@davemloft.net>
Tue, 5 Dec 2017 20:04:27 +0000 (15:04 -0500)
commit90a1bd15a564b7d096c0ba83dd75ed07e5571459
treec6578ca50e923aae50e6f00e9555c9c6e1236d62
parentaa80a3137d6299989501198c9cf235fd303be50f
net: sched: sch_api: rearrange init handling

This patch fixes the following checkpatch error:

ERROR: do not use assignment in if condition

by rearranging the if condition to execute init callback only if init
callback exists. The whole setup afterwards is called in any case,
doesn't matter if init callback is set or not. This patch has the same
behaviour as before, just without assign err variable in if condition.
It also makes the code easier to read.

Reviewed-by: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: David Ahern <dsahern@gmail.com>
Signed-off-by: Alexander Aring <aring@mojatatu.com>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/sch_api.c