[PATCH] USB: clean out an unnecessary NULL check from ub
authorPete Zaitcev <zaitcev@redhat.com>
Sat, 29 Apr 2006 03:45:49 +0000 (20:45 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 21 Jun 2006 22:04:09 +0000 (15:04 -0700)
Remove the check for NULL which makes no sense. Suggested by Al.

Signed-off-by: Pete Zaitcev <zaitcev@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/block/ub.c

index c688c25992e44b0a914624735c448e7e7abb1429..8eb44a55b9b8d5e6799d16efece43810763d8e2f 100644 (file)
@@ -1651,15 +1651,11 @@ static void ub_revalidate(struct ub_dev *sc, struct ub_lun *lun)
 static int ub_bd_open(struct inode *inode, struct file *filp)
 {
        struct gendisk *disk = inode->i_bdev->bd_disk;
-       struct ub_lun *lun;
-       struct ub_dev *sc;
+       struct ub_lun *lun = disk->private_data;
+       struct ub_dev *sc = lun->udev;
        unsigned long flags;
        int rc;
 
-       if ((lun = disk->private_data) == NULL)
-               return -ENXIO;
-       sc = lun->udev;
-
        spin_lock_irqsave(&ub_lock, flags);
        if (atomic_read(&sc->poison)) {
                spin_unlock_irqrestore(&ub_lock, flags);