]> 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)
commitf241428de9d18131c194720455b359515ec70807
treec6578ca50e923aae50e6f00e9555c9c6e1236d62
parent071142651582535e030722002be26306566208e7
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