OSDN Git Service

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)
commit54160ef6ec64e5a27b8f4ab4105ae81a57064dca
treec6578ca50e923aae50e6f00e9555c9c6e1236d62
parent0ac4bd68ab50a9f0860b10caacc1285fda5da0ca
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