mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andries.Brouwer@cwi.nl
To: dwmw2@infradead.org, linux-kernel@vger.kernel.org,
	torvalds@transmeta.com
Subject: [PATCH] mtd/maps/impa7.c fixes
Date: Sat, 21 Jun 2003 01:57:24 +0200 (MEST)	[thread overview]
Message-ID: <UTC200306202357.h5KNvOm15238.aeb@smtp.cwi.nl> (raw)

I happened to come across mtd/maps/impa7.c.
It looks like some stuff that needs <linux/mtd/partitions.h>
occurs outside #ifdef CONFIG_MTD_PARTITIONS.
Also, there is a spurious #endif.
Also, there is one of the many redefinitions for ARRAY_SIZE.
Below a patch.

Not compiled. Not tested.

Andries

diff -u --recursive --new-file -X /linux/dontdiff a/drivers/mtd/maps/impa7.c b/drivers/mtd/maps/impa7.c
--- a/drivers/mtd/maps/impa7.c	Sun Jun 15 01:40:57 2003
+++ b/drivers/mtd/maps/impa7.c	Sat Jun 21 02:25:34 2003
@@ -66,12 +66,11 @@
 	},
 };
 
-#define NB_OF(x) (sizeof (x) / sizeof (x[0]))
+static int                   mtd_parts_nb = 0;
+static struct mtd_partition *mtd_parts    = 0;
 
 #endif
 
-static int                   mtd_parts_nb = 0;
-static struct mtd_partition *mtd_parts    = 0;
 static const char *probes[] = { "cmdlinepart", NULL };
 
 int __init init_impa7(void)
@@ -119,11 +118,11 @@
 							    0);
 			if (mtd_parts_nb > 0)
 			  part_type = "command line";
-#endif
+
 			if (mtd_parts_nb <= 0)
 			{
 				mtd_parts = static_partitions;
-				mtd_parts_nb = NB_OF(static_partitions);
+				mtd_parts_nb = ARRAY_SIZE(static_partitions);
 				part_type = "static";
 			}
 			if (mtd_parts_nb <= 0)

             reply	other threads:[~2003-06-20 23:43 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-20 23:57 Andries.Brouwer [this message]
2003-06-23 11:49 ` David Woodhouse

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=UTC200306202357.h5KNvOm15238.aeb@smtp.cwi.nl \
    --to=andries.brouwer@cwi.nl \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®