summaryrefslogtreecommitdiffhomepage
path: root/vlan.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2018-06-29 04:30:13 +0200
committerAlexander Couzens <lynxis@fe80.eu>2018-07-11 22:03:38 +0200
commit60293a7a3656aab8c10f2d1827d1da88ad46d32c (patch)
tree21e820844c861085dab08403e5da04f94ce43aa9 /vlan.c
parent5cf79759a24e9bb2a6a3aef7c83d73efb9bf2df3 (diff)
replace fall throughs in switch/cases where possible with simple code changes
fall throughs are usually error-prone, especially when someone else extend it. Signed-off-by: Alexander Couzens <lynxis@fe80.eu> Acked-by: Hans Dedecker <dedeckeh@gmail.com>
Diffstat (limited to 'vlan.c')
-rw-r--r--vlan.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vlan.c b/vlan.c
index 067f624..84befc9 100644
--- a/vlan.c
+++ b/vlan.c
@@ -73,14 +73,14 @@ static void vlan_dev_set_name(struct vlan_device *vldev, struct device *dev)
static void vlan_dev_cb(struct device_user *dep, enum device_event ev)
{
struct vlan_device *vldev;
- bool new_state = false;
vldev = container_of(dep, struct vlan_device, dep);
switch(ev) {
case DEV_EVENT_ADD:
- new_state = true;
+ device_set_present(&vldev->dev, true);
+ break;
case DEV_EVENT_REMOVE:
- device_set_present(&vldev->dev, new_state);
+ device_set_present(&vldev->dev, false);
break;
case DEV_EVENT_UPDATE_IFNAME:
vlan_dev_set_name(vldev, dep->dev);