public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH 4/6] mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES
@ 2010-01-05 15:20 Ben Hutchings
  2010-01-10 10:36 ` Artem Bityutskiy
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2010-01-05 15:20 UTC (permalink / raw)
  To: David Woodhouse; +Cc: linux-mtd

MAX_MTD_DEVICES is about to be removed.

Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
---
 drivers/mtd/devices/pmc551.c |    4 ++--
 drivers/mtd/mtdchar.c        |    3 ---
 drivers/mtd/mtdoops.c        |    5 -----
 3 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/mtd/devices/pmc551.c b/drivers/mtd/devices/pmc551.c
index d2fd550..fc8ea0a 100644
--- a/drivers/mtd/devices/pmc551.c
+++ b/drivers/mtd/devices/pmc551.c
@@ -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,
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 5b081cb..04fd7e5 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -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;
diff --git a/drivers/mtd/mtdoops.c b/drivers/mtd/mtdoops.c
index 92e12df..328313c 100644
--- a/drivers/mtd/mtdoops.c
+++ b/drivers/mtd/mtdoops.c
@@ -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) {
-- 
1.5.5


-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 4/6] mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES
  2010-01-05 15:20 [PATCH 4/6] mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES Ben Hutchings
@ 2010-01-10 10:36 ` Artem Bityutskiy
  0 siblings, 0 replies; 2+ messages in thread
From: Artem Bityutskiy @ 2010-01-10 10:36 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: linux-mtd, David Woodhouse

On Tue, 2010-01-05 at 15:20 +0000, Ben Hutchings wrote:
> MAX_MTD_DEVICES is about to be removed.
> 
> Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
> ---
>  drivers/mtd/devices/pmc551.c |    4 ++--
>  drivers/mtd/mtdchar.c        |    3 ---
>  drivers/mtd/mtdoops.c        |    5 -----
>  3 files changed, 2 insertions(+), 10 deletions(-)

Reviewed-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-01-10 10:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 15:20 [PATCH 4/6] mtd: Remove unnecessary comparisons with MAX_MTD_DEVICES Ben Hutchings
2010-01-10 10:36 ` Artem Bityutskiy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox