From a337499f660ff70a12cea6607b9a64d7420e32dc Mon Sep 17 00:00:00 2001 From: "Denis V. Lunev" Date: Thu, 28 Feb 2008 20:44:27 -0800 Subject: [PATCH] [IPV4]: Remove ifa != NULL check. This is a callback registered to inet address notifier chain. The check is useless as: - ifa is always != NULL - similar checks are abscent in all other notifiers. Signed-off-by: Denis V. Lunev Signed-off-by: David S. Miller --- drivers/net/via-velocity.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index cc0addb5640c..c50fdeed9e85 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -3460,21 +3460,19 @@ static int velocity_resume(struct pci_dev *pdev) static int velocity_netdev_event(struct notifier_block *nb, unsigned long notification, void *ptr) { struct in_ifaddr *ifa = (struct in_ifaddr *) ptr; + struct net_device *dev = ifa->ifa_dev->dev; + struct velocity_info *vptr; + unsigned long flags; - if (ifa) { - struct net_device *dev = ifa->ifa_dev->dev; - struct velocity_info *vptr; - unsigned long flags; - - spin_lock_irqsave(&velocity_dev_list_lock, flags); - list_for_each_entry(vptr, &velocity_dev_list, list) { - if (vptr->dev == dev) { - velocity_get_ip(vptr); - break; - } + spin_lock_irqsave(&velocity_dev_list_lock, flags); + list_for_each_entry(vptr, &velocity_dev_list, list) { + if (vptr->dev == dev) { + velocity_get_ip(vptr); + break; } - spin_unlock_irqrestore(&velocity_dev_list_lock, flags); } + spin_unlock_irqrestore(&velocity_dev_list_lock, flags); + return NOTIFY_DONE; } -- 2.30.2