]> git.hungrycats.org Git - linux/commitdiff
[PATCH] remove some junk from hd98.c's ioctl implementation
authorChristoph Hellwig <hch@lst.de>
Sun, 20 Apr 2003 07:50:12 +0000 (00:50 -0700)
committerChristoph Hellwig <hch@lst.de>
Sun, 20 Apr 2003 07:50:12 +0000 (00:50 -0700)
Also pointed out by Al.

drivers/ide/legacy/hd98.c

index c7b61ac8424b999d02ba3be3f7d6da9dc7b1d60a..b21c147d9feeb55e87d58b353d4c0ecd8a96e4a1 100644 (file)
@@ -655,11 +655,8 @@ static int hd_ioctl(struct inode * inode, struct file * file,
        unsigned int cmd, unsigned long arg)
 {
        struct hd_geometry *loc = (struct hd_geometry *) arg;
-       int dev;
+       int dev = DEVICE_NR(inode->i_rdev);
 
-       if ((!inode) || kdev_none(inode->i_rdev))
-               return -EINVAL;
-       dev = DEVICE_NR(inode->i_rdev);
        if (dev >= NR_HD)
                return -EINVAL;
        switch (cmd) {