staging: unisys: visornic: simplify visornic if statements

Changes the conditional logic by looking for the absence of work
to do, instead of the opposite.

Signed-off-by: David Binder <david.binder@unisys.com>
Reviewed-by: Tim Sell <Timothy.Sell@unisys.com>
Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
David Binder 2016-05-12 09:14:45 -04:00 committed by Greg Kroah-Hartman
parent d91184a9c6
commit 6d8c96cbc1
1 changed files with 22 additions and 19 deletions

View File

@ -1000,25 +1000,28 @@ visornic_set_multi(struct net_device *netdev)
struct uiscmdrsp *cmdrsp;
struct visornic_devdata *devdata = netdev_priv(netdev);
/* any filtering changes */
if (devdata->old_flags != netdev->flags) {
if ((netdev->flags & IFF_PROMISC) !=
(devdata->old_flags & IFF_PROMISC)) {
cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
if (!cmdrsp)
return;
cmdrsp->cmdtype = CMD_NET_TYPE;
cmdrsp->net.type = NET_RCV_PROMISC;
cmdrsp->net.enbdis.context = netdev;
cmdrsp->net.enbdis.enable =
netdev->flags & IFF_PROMISC;
visorchannel_signalinsert(devdata->dev->visorchannel,
IOCHAN_TO_IOPART,
cmdrsp);
kfree(cmdrsp);
}
devdata->old_flags = netdev->flags;
}
if (devdata->old_flags == netdev->flags)
return;
if ((netdev->flags & IFF_PROMISC) ==
(devdata->old_flags & IFF_PROMISC))
goto out_save_flags;
cmdrsp = kmalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
if (!cmdrsp)
return;
cmdrsp->cmdtype = CMD_NET_TYPE;
cmdrsp->net.type = NET_RCV_PROMISC;
cmdrsp->net.enbdis.context = netdev;
cmdrsp->net.enbdis.enable =
netdev->flags & IFF_PROMISC;
visorchannel_signalinsert(devdata->dev->visorchannel,
IOCHAN_TO_IOPART,
cmdrsp);
kfree(cmdrsp);
out_save_flags:
devdata->old_flags = netdev->flags;
}
/**