Skip to content

Commit

Permalink
UBI: mark few variables as __initdata
Browse files Browse the repository at this point in the history
The @mtd_devs and @mtd_dev_param variables are used only during the
initialization, and all functions that use the variables have
the __init prefix. This means we can safely mark the variables
as __initdata, which is a tiny optimization.

Impact: tiny RAM consumption optimization when UBI is used as a kernel
        module.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed Feb 1, 2010
1 parent 64a028a commit 9e0c7ef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/mtd/ubi/build.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ struct mtd_dev_param {
};

/* Numbers of elements set in the @mtd_dev_param array */
static int mtd_devs;
static int __initdata mtd_devs;

/* MTD devices specification parameters */
static struct mtd_dev_param mtd_dev_param[UBI_MAX_DEVICES];
static struct mtd_dev_param __initdata mtd_dev_param[UBI_MAX_DEVICES];

/* Root UBI "class" object (corresponds to '/<sysfs>/class/ubi/') */
struct class *ubi_class;
Expand Down

0 comments on commit 9e0c7ef

Please sign in to comment.