mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES
authorBen Hutchings <bhutchings@solarflare.com>
Fri, 29 Jan 2010 20:58:23 +0000 (20:58 +0000)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 25 Feb 2010 11:39:09 +0000 (11:39 +0000)
MAX_MTD_DEVICES is about to be removed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/devices/pmc551.c
drivers/mtd/mtdchar.c
drivers/mtd/mtdoops.c

index d2fd550f7e09d291c257ab092abdf11e3ba6f36c..fc8ea0a57ac2087dbbd46bf5a4791a8adffb727b 100644 (file)
@@ -668,7 +668,7 @@ static int __init init_pmc551(void)
 {
        struct pci_dev *PCI_Device = NULL;
        struct mypriv *priv;
-       int count, found = 0;
+       int found = 0;
        struct mtd_info *mtd;
        u32 length = 0;
 
@@ -695,7 +695,7 @@ static int __init init_pmc551(void)
        /*
         * PCU-bus chipset probe.
         */
-       for (count = 0; count < MAX_MTD_DEVICES; count++) {
+       for (;;) {
 
                if ((PCI_Device = pci_get_device(PCI_VENDOR_ID_V3_SEMI,
                                                  PCI_DEVICE_ID_V3_SEMI_V370PDC,
index bce0a07cbac971379b1c4c8a5e7a294f8b00aacf..9f826cda2748b0e78f809dcbe7dc07a4daa00df1 100644 (file)
@@ -67,9 +67,6 @@ static int mtd_open(struct inode *inode, struct file *file)
 
        DEBUG(MTD_DEBUG_LEVEL0, "MTD_open\n");
 
-       if (devnum >= MAX_MTD_DEVICES)
-               return -ENODEV;
-
        /* You can't open the RO devices RW */
        if ((file->f_mode & FMODE_WRITE) && (minor & 1))
                return -EACCES;
index 92e12df0917f38ef59a4943fe7aa0dedbb46ecee..328313c3dccb4c4cf8b57e35ba5794e0ddff0ff4 100644 (file)
@@ -429,11 +429,6 @@ static int __init mtdoops_init(void)
        mtd_index = simple_strtoul(mtddev, &endp, 0);
        if (*endp == '\0')
                cxt->mtd_index = mtd_index;
-       if (cxt->mtd_index > MAX_MTD_DEVICES) {
-               printk(KERN_ERR "mtdoops: invalid mtd device number (%u) given\n",
-                               mtd_index);
-               return -EINVAL;
-       }
 
        cxt->oops_buf = vmalloc(record_size);
        if (!cxt->oops_buf) {