tree 09e7814dcca9c1a822c84c5225c7fdf762ae6ee0
parent 02b15e343aeefb49f8cac949be599d78250a568f
author Joern Engel <[EMAIL PROTECTED]> Tue, 07 Jun 2005 16:04:29 +0100
committer Thomas Gleixner <[EMAIL PROTECTED]> Wed, 29 Jun 2005 14:20:23 +0200

[MTD] Fix commandline parser alignement

Add alignment to cmdline.

From: "Timofei V. Bondarenko" <[EMAIL PROTECTED]>
Signed-off-by: Joern Engel <[EMAIL PROTECTED]>
Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>

 drivers/mtd/cmdlinepart.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -1,5 +1,5 @@
 /*
- * $Id: cmdlinepart.c,v 1.17 2004/11/26 11:18:47 lavinen Exp $
+ * $Id: cmdlinepart.c,v 1.18 2005/06/07 15:04:26 joern Exp $
  *
  * Read flash partition table from command line
  *
@@ -239,7 +239,8 @@ static int mtdpart_setup_real(char *s)
                                &num_parts,     /* out: number of parts */
                                0,              /* first partition */
                                (unsigned char**)&this_mtd, /* out: extra mem */
-                               mtd_id_len + 1 + sizeof(*this_mtd));
+                               mtd_id_len + 1 + sizeof(*this_mtd) + 
+                               sizeof(void*)-1 /*alignment*/);
                if(!parts)
                {
                        /*
@@ -252,6 +253,9 @@ static int mtdpart_setup_real(char *s)
                         return 0;
                 }
 
+               /* align this_mtd */
+               this_mtd = (struct cmdline_mtd_partition *) 
+                       ALIGN((unsigned long)this_mtd, sizeof(void*));
                /* enter results */         
                this_mtd->parts = parts;
                this_mtd->num_parts = num_parts;
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to